atsim.potentials.config
¶
Package Contents¶
Classes¶
ConfigParser (fp, overrides=[], additional=[]) |
Performs initial stage (tokenizing) of generating a potential model |
FilteredConfigParser (config_parser, exclude=[], include=[]) |
Class that wraps around ConfigParser instances and |
Potential_Form_Registry (cfg, register_standard=False, register_pymath_functions=False) |
Factory class that takes [Potential-Form] and [Table-Form] definitions |
Modifier_Registry () |
Registry of factories for potential modifiers |
Configuration () |
Factory class that allows Tabulation objects to be built from .ini files |
-
class
atsim.potentials.config.
ConfigParser
(fp, overrides=[], additional=[])[source]¶ Bases:
object
Performs initial stage (tokenizing) of generating a potential model suitable for tabulation functions.
-
pair
¶ Returns the contents of the config file’s [Pair] section.
Returns: List of tuples of (SpeciesPair, potential_form_label, params) Where params = [p1, p2, …, pn] and p1 etc are the potential parameters
-
potential_form
¶ Return the contents of the config file’s [Potential-Form] section.
Returns: List of (PotentialFormSignature, formula_string) pairs.
-
tabulation
¶ Return the parsed contents of the config file’s [Tabulation] section.
This defines what type of model (pair, EAM) the config file contains and also how the model should be tabulated.
Returns: _Tabulation_Section object
-
table_form
¶ Returns parsed content of config file’s [Table-Form] section.
This allows pre-tabulated data to be used within atsim.potentials.
Returns: List of TableFormTuple instance tuples.
-
eam_embed
¶ Return the parsed contents of the configuration file’s [EAM-Embed] section.
Returns: List of (SPECIES, potential_form_label, params) Where params = [p1, p2, …, pn] and p1 etc are the embedding function parameters )
-
eam_density
¶ Return the parsed contents of the configuration file’s [EAM-Density] section.
Returns: List of (SPECIES, potential_form_label, params) Where params = [p1, p2, …, pn] and p1 etc are the density function parameters )
-
eam_density_fs
¶ Return the parsed contents of the configuration file’s [EAM-Density] section.
This assumes Finnis-Sinclair parsing rules. This means that SPECIES (below) is parsed as a EAMFSDensitySpeciesTuple with from_species and to_species attributes.
Returns: List of (SPECIES, potential_form_label, params) Where params = [p1, p2, …, pn] and p1 etc are the density function parameters )
-
parsed_sections
¶ Returns a list of relevant sections found inside configuration file.
Names are returned as the ConfigParser attribute names which could be used to access each parsed section. So [Pair] becomes pair and [EAM-Density] is eam_density.
Returns: List of attribute names representing parseable sections of the configuration file
-
orphan_sections
¶ Returns list of section keys, in current configuration file, that are not relevant to the ConfigParser class.property
Returns: List of section labels.
-
raw_config_parser
¶
-
species
¶ Return reference data for atomic species.
Data is returned as a dictionary relating each species label to a dictionary mapping property name to propety value.
Returns: Dictionary of dictionaries.
-
parse_pair_like
(self, section_name)¶ Parse a section as if it contains pair potentials.
Parameters: section_name – Name of section that should be parsed in the same way as the [Pair] section. Returns: List of tuples of (SpeciesPair, potential_form_label, params) Where params = [p1, p2, …, pn] and p1 etc are the potential parameters
-
-
exception
atsim.potentials.config.
ConfigOverrideException
[source]¶ Bases:
atsim.potentials.config._common.ConfigParserException
Common base class for all non-exit exceptions.
-
class
atsim.potentials.config.
FilteredConfigParser
(config_parser, exclude=[], include=[])[source]¶ Bases:
wrapt.ObjectProxy
Class that wraps around ConfigParser instances and filters out entries for particular, unwanted species
-
pair
¶
-
eam_embed
¶
-
eam_density
¶
-
eam_density_fs
¶
-
-
class
atsim.potentials.config.
Potential_Form_Registry
(cfg, register_standard=False, register_pymath_functions=False)[source]¶ Bases:
object
Factory class that takes [Potential-Form] and [Table-Form] definitions from ConfigParser and turns them into Potential_Form objects
-
registered
¶ Returns the labels for the potentials registered here.
-
__getitem__
(self, k)¶
-
-
class
atsim.potentials.config.
Modifier_Registry
[source]¶ Bases:
object
Registry of factories for potential modifiers
-
__getitem__
(self, k)¶
-
-
class
atsim.potentials.config.
Configuration
[source]¶ Bases:
object
Factory class that allows Tabulation objects to be built from .ini files
-
read
(self, fp)¶ Read potential data from the file object fp and return a PairTabulation or EAMTabulation object.
Params fp: File like object containing potential information. Returns: Tabulation object
-
read_from_parser
(self, cp)¶ Read potential data from the ConfigParser object cp and return a PairTabulation or EAMTabulation instance.
Parameters: cp – atsim.potentials.config.ConfigParser instance. Returns: Tabulation object
-
-
exception
atsim.potentials.config.
ConfigParserException
[source]¶ Bases:
atsim.potentials.config._common.ConfigurationException
Common base class for all non-exit exceptions.
-
exception
atsim.potentials.config.
Potential_Form_Registry_Exception
[source]¶ Bases:
atsim.potentials.config._common.ConfigurationException
Common base class for all non-exit exceptions.
-
exception
atsim.potentials.config.
Potential_Form_Exception
[source]¶ Bases:
atsim.potentials.config._common.ConfigurationException
Common base class for all non-exit exceptions.