Exemple #1
0
    def __init_parser(self):

        self.parser = argparse.ArgumentParser()

        # TODO System for monitoring and registering models automatically
        # The available models are just hard coded at the moment
        self._registered_models = pybiosas.models.models

        self.parser.add_argument('command',
                                 type=str,
                                 choices=['fit', 'calc', 'calculate'],
                                 help="""Fit a model or calculate data given
                                 a set of parameters and a model""")

        self.parser.add_argument('-dataset',
                                 type=str,
                                 help="The dataset to fit in SasXML format")

        models = []
        for model in self._registered_models.iterkeys():
            models.append(model)
        self.parser.add_argument('-model',
                                 type=str,
                                 choices=models,
                                 help=("""The model to fitted or calculated.
                                 Available models are""" + str(models)))

        self.parser.add_argument('-parameters',
                                 type=str,
                                 help="""The paramaters, as either a json
                          file or a list of dictionaries with structure as defined
                          for the parinfo option of mpfit.""")

        self.parser.add_argument('-q_vals',
                                 '-q_values',
                                 type=str,
                                 help="""A list of q values for calculating
                                 intensities from a model. Provide as a string
                                 or file containing either the list of q values
                                 [1st, 2nd...last] or [1st, last, step] where
                                 step is optional""",
                                 default="[0.0, 0.5, 0.0005]")

        self.parser.add_argument('-outpath',
                                 type=str,
                                 help="""A path to a directory for the output
                                 files. If it is desired to name the output file
                                 then terminate the path with that filename.
                                 Otherwise terminate the path with a '/'.
                                 Default is to place output files in
                                 same directory as the input parameter file. The
                                 default output filename is 'outfile.json'. If
                                 parameters are passed as a string on the
                                 command line then outpath defaults to the
                                 current working directory.""")

        self.parser.add_argument('-xml',
                                 action='store_true',
                                 help="""Write output to CML file.""")
Exemple #2
0
    def __init_parser(self):

        self.parser = argparse.ArgumentParser()
        
        # TODO System for monitoring and registering models automatically
        # The available models are just hard coded at the moment
        self._registered_models = pybiosas.models.models

        self.parser.add_argument('command', type = str,
                                 choices = ['fit', 'calc', 'calculate'],
                                 help = """Fit a model or calculate data given
                                 a set of parameters and a model""")

        self.parser.add_argument('-dataset', type = str,
                                     help = "The dataset to fit in SasXML format")

        models = []
        for model in self._registered_models.iterkeys():
            models.append(model)
        self.parser.add_argument('-model', type=str,
                                 choices = models,
                                 help = ("""The model to fitted or calculated.
                                 Available models are""" +
                                     str(models)))
        
        self.parser.add_argument('-parameters', type = str,
                                 help = """The paramaters, as either a json
                          file or a list of dictionaries with structure as defined
                          for the parinfo option of mpfit.""")

        self.parser.add_argument('-q_vals', '-q_values', type = str,
                                 help = """A list of q values for calculating
                                 intensities from a model. Provide as a string
                                 or file containing either the list of q values
                                 [1st, 2nd...last] or [1st, last, step] where
                                 step is optional""",
                                 default = "[0.0, 0.5, 0.0005]")

        self.parser.add_argument('-outpath', type = str,
                                 help = """A path to a directory for the output
                                 files. If it is desired to name the output file
                                 then terminate the path with that filename.
                                 Otherwise terminate the path with a '/'.
                                 Default is to place output files in
                                 same directory as the input parameter file. The
                                 default output filename is 'outfile.json'. If
                                 parameters are passed as a string on the
                                 command line then outpath defaults to the
                                 current working directory.""")

        self.parser.add_argument('-xml', action = 'store_true',
                                 help = """Write output to CML file.""")
Exemple #3
0
    def __init_parser(self):
        """Command line parser for taking in optional arguments"""

        self.parser = argparse.ArgumentParser()

        self._registered_models = pybiosas.models.models

        self.parser.add_argument('-command',
                                 type=str,
                                 choices=['fit', 'write'],
                                 help="""Fit models or write out a bag of
                                 tasks given a parameter space to sweep""")

        self.parser.add_argument('-script',
                                 type=str,
                                 help="""Location of the python script to
                                 run the model fit on this system""")

        self.parser.add_argument('-dataset',
                                 type=str,
                                 help="The dataset to use in SasXML format")

        models = []
        for model in self._registered_models.iterkeys():
            models.append(model)
        self.parser.add_argument('-model',
                                 type=str,
                                 choices=models,
                                 help=("""The model to be fitted.
                                 Available models are""" + str(models)))

        self.parser.add_argument('-parameters',
                                 type=str,
                                 help="""The paramaters, as either a json
                          file or a list of dictionaries with structure as defined
                          for the parinfo option of mpfit. Parameter sweeps should
                          be defined as lists, 3-tuples (lowest, highest, step)"""
                                 )

        self.parser.add_argument('-outpath',
                                 type=str,
                                 help="""A path to a directory for the output
                                 files. If it is desired to name the output file
                                 then terminate the path with that filename.
                                 Otherwise terminate the path with a '/'.
                                 Default is to place output files in
                                 same directory as the input data file.""")

        self.parser.add_argument('-xml',
                                 action='store_true',
                                 help="""Write output to CML file.""")
Exemple #4
0
    def __init_parser(self):
        """Command line parser for taking in optional arguments"""

        self.parser = argparse.ArgumentParser()
        
        self._registered_models = pybiosas.models.models

        self.parser.add_argument('-command', type = str,
                                 choices = ['fit', 'write'],
                                 help = """Fit models or write out a bag of
                                 tasks given a parameter space to sweep""")

        self.parser.add_argument('-script', type = str,
                                 help = """Location of the python script to
                                 run the model fit on this system""")

        self.parser.add_argument('-dataset', type = str,
                                     help = "The dataset to use in SasXML format")

        models = []
        for model in self._registered_models.iterkeys():
            models.append(model)
        self.parser.add_argument('-model', type=str,
                                 choices = models,
                                 help = ("""The model to be fitted.
                                 Available models are""" +
                                     str(models)))
        
        self.parser.add_argument('-parameters', type = str,
                                 help = """The paramaters, as either a json
                          file or a list of dictionaries with structure as defined
                          for the parinfo option of mpfit. Parameter sweeps should
                          be defined as lists, 3-tuples (lowest, highest, step)""")

        self.parser.add_argument('-outpath', type = str,
                                 help = """A path to a directory for the output
                                 files. If it is desired to name the output file
                                 then terminate the path with that filename.
                                 Otherwise terminate the path with a '/'.
                                 Default is to place output files in
                                 same directory as the input data file.""")

        self.parser.add_argument('-xml', action = 'store_true',
                                 help = """Write output to CML file.""")