duat.config
¶
Model OSIRIS configuration files.
-
class
duat.config.
CathodeList
(label='cathodes')[source]¶ List of sections defining the cathodes
-
__init__
(label='cathodes')[source]¶ Args: label (str): a label inserted as a comment when generating fortran code. lst (list of MetaSection): a preexisting list of sections conforming this one. default_type (str or class): the default type for implicit creation of content. If a str, a Section with the
provided name will be created. Otherwise, a instance of the provided class with no parameters will be created.
-
-
class
duat.config.
ConfigFile
(d=1, template='default')[source]¶ Set of Sections defining an input file.
-
__init__
(d=1, template='default')[source]¶ Create a default d-dimensional config file.
Parameters: - d (int) – The number of dimensions (1, 2 or 3), used if a template is provided.
- template (str) – A model for the initial configuration. Available values are: * “default”: A basic configuration based on the examples. * “none”: Absolutely no configuration.
-
clone
()[source]¶ Get a deep copy of the instance
Returns: a deep copy of this instance Return type: ConfigFile
-
classmethod
from_file
(file_path)[source]¶ Create and return an instance from a fortran code representation in a file
-
classmethod
from_string
(string)[source]¶ Create and return an instance from a fortran code representation
-
get_d
()[source]¶ Get the dimension of the configuration file.
Returns: - The dimension according to the mandatory xmax parameter in the space section. 0 if it could not be
- found.
Return type: int
-
-
class
duat.config.
MetaSection
[source]¶ Something behaving like a set of sections.
-
classmethod
get_structure
(offset=0)[source]¶ Get a string representing the structure of the class.
This methods returns a string with lines in the format “- index (type)”, where index is the one used to access a subitem and type is the class of that item.
Parameters: offset – Two spaces times this number will be used to indent the returned string. This is used to generate a multi-level description. Returns: A representation of the structure of the class. Return type: (str)
-
classmethod
-
class
duat.config.
NeutralList
(label='neutrals')[source]¶ List of sections defining the neutrals
-
__init__
(label='neutrals')[source]¶ Args: label (str): a label inserted as a comment when generating fortran code. lst (list of MetaSection): a preexisting list of sections conforming this one. default_type (str or class): the default type for implicit creation of content. If a str, a Section with the
provided name will be created. Otherwise, a instance of the provided class with no parameters will be created.
-
-
class
duat.config.
NeutralMovIonsList
(label='neutral moving ions')[source]¶ List of sections defining the neutral moving ions
-
__init__
(label='neutral moving ions')[source]¶ Args: label (str): a label inserted as a comment when generating fortran code. lst (list of MetaSection): a preexisting list of sections conforming this one. default_type (str or class): the default type for implicit creation of content. If a str, a Section with the
provided name will be created. Otherwise, a instance of the provided class with no parameters will be created.
-
-
class
duat.config.
SectionList
(label=None, lst=None, default_type=None)[source]¶ Class defining a list of sections in a numerical order.
Here ‘section’ refers to any subclass of MetaSection.
-
__init__
(label=None, lst=None, default_type=None)[source]¶ Parameters: - label (str) – a label inserted as a comment when generating fortran code.
- lst (list of MetaSection) – a preexisting list of sections conforming this one.
- default_type (str or class) – the default type for implicit creation of content. If a str, a Section with the provided name will be created. Otherwise, a instance of the provided class with no parameters will be created.
-
classmethod
get_structure
(offset=0)[source]¶ Get a string representing the structure of the class.
This methods returns a string with lines in the format “- index (type)”, where index is the one used to access a subitem and type is the class of that item.
Parameters: offset – Two spaces times this number will be used to indent the returned string. This is used to generate a multi-level description. Returns: A representation of the structure of the class. Return type: (str)
-
-
class
duat.config.
SectionOrdered
(label=None, order=None, fixed=True, types=None)[source]¶ Class defining a set of sections that must be outputted in a particular order given by a keyword related to them.
Here ‘section’ refers to any subclass of MetaSection.
-
__init__
(label=None, order=None, fixed=True, types=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
get_structure
(offset=0)[source]¶ Get a string representing the structure of the class.
This methods returns a string with lines in the format “- index (type)”, where index is the one used to access a subitem and type is the class of that item.
Parameters: offset – Two spaces times this number will be used to indent the returned string. This is used to generate a multi-level description. Returns: A representation of the structure of the class. Return type: (str)
-
-
class
duat.config.
SpeciesList
(label='species')[source]¶ List of sections defining the species
-
__init__
(label='species')[source]¶ Args: label (str): a label inserted as a comment when generating fortran code. lst (list of MetaSection): a preexisting list of sections conforming this one. default_type (str or class): the default type for implicit creation of content. If a str, a Section with the
provided name will be created. Otherwise, a instance of the provided class with no parameters will be created.
-
-
class
duat.config.
Variation
(*args, epilog=None)[source]¶ Represents a variation of a set of parameters in config files.
Each parameter varies in list of values. The configuration files produced by this class take into account all combinations of values, i.e., the parameter space is given by the cartesian product.
-
__init__
(*args, epilog=None)[source]¶ Create a Variation with the given parameters and values.
Parameters: - *args (2-
tuple
oflist
) – Each argument must be a 2-tuple whose first elements is a list of str or int which identifies the parameter in its section and a list of the values the parameter will take. The list can be None to perform no action while passing the parameter to the epilog function (see below). - epilog (callable) – A function of two arguments that will be called with the simulation and the list of parameters when a config is being generated. This can be used for advanced modification, for example, to set two parameters to a related value (like two species temperature).
- *args (2-
-
get_generator
(config)[source]¶ Get a generator that produces ConfigFile objects following the Variation.
Parameters: config (ConfigFile) – The configuration where the Variation will be applied. Returns: A generator which provides the ConfigFile instances. Return type: generator
-
get_parameter_list
()[source]¶ Get a list with the parameter values in the same order that
get_generator()
.This method might be useful to post-process the results if the parameter space is simple.
Returns: A list with the values of the parameters in the cartesian product order. Return type: list
of tuple
-
-
class
duat.config.
ZpulseList
(label='zpulses')[source]¶ List of sections defining the laser pulses
-
__init__
(label='zpulses')[source]¶ Args: label (str): a label inserted as a comment when generating fortran code. lst (list of MetaSection): a preexisting list of sections conforming this one. default_type (str or class): the default type for implicit creation of content. If a str, a Section with the
provided name will be created. Otherwise, a instance of the provided class with no parameters will be created.
-