:mod:`atsim.potentials.config` ============================== .. py:module:: atsim.potentials.config Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: atsim.potentials.config.ConfigParser atsim.potentials.config.FilteredConfigParser atsim.potentials.config.Potential_Form_Registry atsim.potentials.config.Modifier_Registry atsim.potentials.config.Configuration .. py:class:: ConfigParser(fp, overrides=[], additional=[]) Bases: :class:`object` Performs initial stage (tokenizing) of generating a potential model suitable for tabulation functions. .. attribute:: 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 .. attribute:: potential_form Return the contents of the config file's [Potential-Form] section. :returns: List of (PotentialFormSignature, formula_string) pairs. .. attribute:: 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 .. attribute:: 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. .. attribute:: 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 ) .. attribute:: 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 ) .. attribute:: 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 ) .. attribute:: 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 .. attribute:: 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. .. attribute:: raw_config_parser .. attribute:: 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. .. method:: parse_pair_like(self, section_name) Parse a section as if it contains pair potentials. :param 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 .. data:: ConfigParserOverrideTuple .. py:exception:: ConfigOverrideException Bases: :class:`atsim.potentials.config._common.ConfigParserException` Common base class for all non-exit exceptions. .. py:class:: FilteredConfigParser(config_parser, exclude=[], include=[]) Bases: :class:`wrapt.ObjectProxy` Class that wraps around ConfigParser instances and filters out entries for particular, unwanted species .. attribute:: pair .. attribute:: eam_embed .. attribute:: eam_density .. attribute:: eam_density_fs .. py:class:: Potential_Form_Registry(cfg, register_standard=False, register_pymath_functions=False) Bases: :class:`object` Factory class that takes [Potential-Form] and [Table-Form] definitions from ConfigParser and turns them into Potential_Form objects .. attribute:: registered Returns the labels for the potentials registered here. .. method:: __getitem__(self, k) .. py:class:: Modifier_Registry Bases: :class:`object` Registry of factories for potential modifiers .. method:: __getitem__(self, k) .. py:class:: Configuration Bases: :class:`object` Factory class that allows Tabulation objects to be built from .ini files .. method:: 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 .. method:: read_from_parser(self, cp) Read potential data from the `ConfigParser` object `cp` and return a `PairTabulation` or `EAMTabulation` instance. :param cp: atsim.potentials.config.ConfigParser instance. :returns: Tabulation object .. py:exception:: ConfigParserException Bases: :class:`atsim.potentials.config._common.ConfigurationException` Common base class for all non-exit exceptions. .. py:exception:: Potential_Form_Registry_Exception Bases: :class:`atsim.potentials.config._common.ConfigurationException` Common base class for all non-exit exceptions. .. py:exception:: Potential_Form_Exception Bases: :class:`atsim.potentials.config._common.ConfigurationException` Common base class for all non-exit exceptions.