hydrac.model.model

Scattering models (hydrac.model.model)

class hydrac.model.model.Model(name=None, default=None)[source]

Bases: object

Base class for model generation.

Contains methods to look up for preset models saved previously in xml files (_set_model_presets()) or update the same xml file with new model parameter definition dedicated to another application (_update_model_presets()) given the user input model name of interest.

name_select(self, m)[source]

Prompts the user for a name if none is specified

_set_model_presets(self)[source]

If the model name is in the preset xml file along with the associated parameters, those are loaded in the Model object

_update_model_presets(self, a, b=None, remove_elem=False)[source]

Either saves the current parameters input by the user under the chosen model name in the xml file, or deletes the parameters from a specific model name in the xml file.

Parameters:
a : str

Nalme of the model to be saved in the xml

b = None : dict

Parameters to be saved under the name a in the xml

remove_elem=False : bool

Remove specified parameters saved under the name a in the xml file

Classes

Model([name, default]) Base class for model generation.