yamdb package
Subpackages
- yamdb.properties package
- Submodules
- yamdb.properties.density module
- yamdb.properties.dynamic_viscosity module
- yamdb.properties.expansion_coefficient module
- yamdb.properties.heat_capacity module
- yamdb.properties.resistivity module
Baker1968()
CusackEnderby1960()
Desaietal1984()
IAEA2008()
Janz1967exp()
Janzetal1968()
Linstrom1992DP()
Linstrom1992E2()
Linstrom1992I1()
Linstrom1992I2()
Linstrom1992I3()
Linstrom1992I4()
Linstrom1992P1()
Linstrom1992P2()
Linstrom1992P3()
Linstrom1992P4()
Linstrom1992plusE()
Massetetal2006()
Ohse1985()
Ohse1985_func()
SalyulevPotapov2015()
Sobolev2011()
Zinkle1998()
constant()
fractionalNegativeExponent()
- yamdb.properties.sound_velocity module
- yamdb.properties.surface_tension module
- yamdb.properties.thermal_conductivity module
- yamdb.properties.vapour_pressure module
- Module contents
Submodules
yamdb.yamdb module
yamdb … Yet Another Materials Database.
- class yamdb.yamdb.DirectProperty(func_dict)[source]
Bases:
object
Generate direct access methods for a property from all available sources.
- Parameters:
func_dict (dictionary) – Function dictionary containing property methods for all available sources.
- class yamdb.yamdb.MixtureProperties(substance)[source]
Bases:
object
Generate a mixture properties object from a substance dictionary.
- Parameters:
substance (dictionary) – Substance dictionary to build the mixture properties object from.
- get_compositions_with_property(property_, keep_range=False)[source]
Return a list of mixture compositions.
For that information on the requested property is available.
- Parameters:
property (str) – property for that compositions are search for
keep_range (bool, default: False) – if composition ‘range’ should be kept in the output list
- Returns:
list of compositions that contain property information
- Return type:
str
- get_compositions_with_property_source(property_, source, keep_range=False)[source]
Return a list of mixture compositions.
For that information on the requested property from the requested source is available.
- Parameters:
property (str) – property for that compositions are search for
source (str) – reference/source for coefficient values
keep_range (bool, default: False) – if composition ‘range’ should be kept in the output list
- Returns:
list of compositions that contain property information
- Return type:
str
- class yamdb.yamdb.Properties(substance)[source]
Bases:
object
Generate a properties object from a substance dictionary.
- Parameters:
substance (dictionary) – Substance dictionary to build the properties object from.
- constant_properties = ['Tm', 'Tb', 'M']
- get_comment(prop, source)[source]
Return commment if there is one.
- Parameters:
prop (str) – property to be investigated
source (str) – source for the property equation
- Returns:
comment if available else None
- Return type:
str
- get_default_source(prop)[source]
Return the default source for requested property.
- Parameters:
prop (str) – property to be investigated
- Returns:
default source, None if not defined
- Return type:
str
- get_equation_limits(prop, source, variable='T')[source]
Return temperature limits of the equation.
- Parameters:
prop (str) – property to be investigated
source (str) – source
variable (str) – variable who’s limits should be shown (‘T’ for temperature (default) or ‘x’ for fraction)
- Returns:
min (float) – lower bound variable range (temperature by default)
max (float) – upper bound variable range (temperature by default)
- get_property_list()[source]
Return a list of all available properties.
- Returns:
list of available properties
- Return type:
str
- class yamdb.yamdb.SubstanceDB(fname)[source]
Bases:
object
Load a database file (YAML or JSON) and build a substance object.
- Parameters:
fname (str) – Filename of the database file.
- get_substance(name)[source]
Return a properties dictionary for the requested substance.
- Parameters:
name (str) – Substance name (elemental symbol or composition, e.g., ‘Na’ or ‘CaCl2-NaCl’).
- Returns:
Dictionary of properties available for the substance.
- Return type:
dictionary or None
- has_component(name)[source]
Check if a component is available from the SubstanceDB.
- Parameters:
name (str) – Component name (e.g., ‘CaCl2’ that could be present as part of ‘CaCl2-NaCl’ or ‘BaCl2-CaCl2’).
- Returns:
List of compositions that contain the requested component.
- Return type:
str or None
- yamdb.yamdb.extract_concentration(key)[source]
Sort keys according to first concentration value (helper function).
- Parameters:
key (str) – Composition in mol%.
- Returns:
Fraction of first component in mol% or “999” if key is “range”.
- Return type:
float
- yamdb.yamdb.get_file_digest(fname, algorithm='sha1')[source]
Get file digest of file.
- Parameters:
fname (str) – Name of the file whose hash should be determined.
algorithm (str, optional) – Hash algorithm to be used (the default is ‘sha1’).
- Returns:
Hash as hexadecimal string.
- Return type:
str
See also
hashlib.file_digest
- yamdb.yamdb.get_from_Janz1992(substance)[source]
Get properties object from the Janz1992.yml file included in yamdb/data.
- Parameters:
substance (str) – Substance name (elemental symbol or composition, e.g., ‘NaCl’ or ‘CaCl2-NaCl’).
- Returns:
Properties or MixtureProperties object.
- Return type:
- yamdb.yamdb.get_from_metals(substance)[source]
Get properties object from the metals.yml file included in yamdb/data.
- Parameters:
substance (str) – Substance name (elemental symbol or composition, e.g., ‘Na’ or ‘Ga’).
- Returns:
Properties or MixtureProperties object.
- Return type:
- yamdb.yamdb.get_from_references(key)[source]
Get reference for key from the references.yml file included in yamdb/data.
- Parameters:
key (str) – Citation key of the reference, e.g. ‘IidaGuthrie1988’.
- Returns:
Reference corresponding to the supplied citation key.
- Return type:
str
- yamdb.yamdb.get_from_salts(substance)[source]
Get properties object from the salts.yml file included in yamdb/data.
- Parameters:
substance (str) – Substance name (elemental symbol or composition, e.g., ‘NaCl’ or ‘CaCl2-NaCl’).
- Returns:
Properties or MixtureProperties object.
- Return type:
- yamdb.yamdb.get_properties_from_db(db_file, substance)[source]
Get properties object from a specific database file.
- Parameters:
db_file (str) – Filename of the database file.
substance (str) – Substance name (elemental symbol or composition, e.g., ‘Na’ or ‘CaCl2-NaCl’).
- Returns:
Properties or MixtureProperties object.
- Return type:
- yamdb.yamdb.get_references_from_db(db_file, key)[source]
Get reference for key from db_file.
- Parameters:
db_file (str) – Name of the reference database YAML file, e.g. ‘references.yml’
key (str) – Citation key of the reference, e.g. ‘IidaGuthrie1988’.
- Returns:
Reference corresponding to the supplied citation key.
- Return type:
str
yamdb.yamref module
yamref … BibTeX references for yamdb (Yet Another Materials Database).
- class yamdb.yamref.BibTexDB(fname)[source]
Bases:
object
Provide the content of a BibTeX file to resolve references.
- Parameters:
fname (str) – Filename of the BibTeX database file.
- get_entry(key)[source]
Get the formatted BibTeX entry (string) for cite key.
- Parameters:
key (str) – Citation key of the entry, e.g ‘IidaGuthrie1988’.
- Returns:
Formatted entry/record belonging to the cite key.
- Return type:
str or None
See also
bibtexparser
- yamdb.yamref.get_from_references(key)[source]
Get reference for key from the references.bib file included in yamdb/data.
- Parameters:
key (str) – Citation key of the reference, e.g. ‘IidaGuthrie1988’.
- Returns:
Reference corresponding to the supplied citation key.
- Return type:
str
- yamdb.yamref.get_references_from_db(db_file, key)[source]
Get reference for key from db_file.
- Parameters:
db_file (str) – Name of the reference database BibTeX file, e.g. ‘references.bib’
key (str) – Citation key of the reference, e.g. ‘IidaGuthrie1988’.
- Returns:
Reference corresponding to the supplied citation key.
- Return type:
str