atsim.potentials.config._config_parser

Module Contents

Classes

ConfigParser(fp, overrides=[], additional=[]) Performs initial stage (tokenizing) of generating a potential model
atsim.potentials.config._config_parser.ConfigParserOverrideTuple[source]
exception atsim.potentials.config._config_parser.ConfigOverrideException[source]

Bases: atsim.potentials.config._common.ConfigParserException

Common base class for all non-exit exceptions.

exception atsim.potentials.config._config_parser.ConfigOverrideDuplicateException[source]

Bases: atsim.potentials.config._config_parser.ConfigOverrideException, atsim.potentials.config._common.ConfigParserDuplicateEntryException

Common base class for all non-exit exceptions.

class atsim.potentials.config._config_parser.ConfigParser(fp, overrides=[], additional=[])[source]

Bases: object

Performs initial stage (tokenizing) of generating a potential model suitable for tabulation functions.

pair[source]

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[source]

Return the contents of the config file’s [Potential-Form] section.

Returns:List of (PotentialFormSignature, formula_string) pairs.
tabulation[source]

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[source]

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[source]

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[source]

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[source]

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[source]

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[source]

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[source]
species[source]

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)[source]

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