PressureReservoirs#
- class PressureReservoirs(res_dict, temperature=None, phase_diagram=None, mu_refs=None, are_chempots_delta=False)[source]#
Bases:
ReservoirsSubclass of Reservoirs which contains temperature information. Useful for partial pressure analysis.
Class to handle dictionaries of chemical potentials. Works almost completely like a python dictionary.
- Parameters:
res_dict (dict) – Dictionary with reservoir names as key and dictionaries of chemical potentials as values.
phase_diagram (PhaseDiagram) – PhaseDiagram object, useful to convert absolute chempots in referenced chempots.
mu_refs (dict) – Dictionary with chemical potentials of reference elements ({Element:chempot}). If the PhaseDiagram is provided mu_refs is taken from the mu_refs attribute.
are_chempots_delta (bool) – Set this variable to True if chempots in dictionary are referenced values.
Methods
Json-serializable dict representation of a PressureReservoirs object.
copyfilter_reservoirsGet new Reservoir object filtering the chempots dictionary.
Constructor of PressureReservoirs object from dictionary representation.
Build PressureReservoirs object from json file or string.
get_absolute_res_dictReturn values of chempots from referenced to absolute
get_dataframeGet DataFrame object of the dictionary of reservoirs.
get_latex_tableGet string with formatted latex table of chemical potentials.
get_plotPlot the stability diagram with the reservoir points.
get_referenced_res_dictReturn values of chempots from absolute to referenced
itemskeysloadLoad an instance from a JSON file written by
save().saveSerialize the instance to JSON on disk, pickling fields if needed.
set_to_absoluteSet reservoir dictionary to absolute values of chempots.
set_to_referencedSet reservoir dictionary to referenced values of chempots.
to_jsonSave Reservoirs object as json string or file
unsafe_hashReturn a hash of the current object.
updatevalidate_monty_v1Pydantic validator with correct signature for pydantic v1.x.
validate_monty_v2Pydantic validator with correct signature for pydantic v2.x.
valuesAttributes
REDIRECTare_chempots_delta- as_dict()[source]#
Json-serializable dict representation of a PressureReservoirs object. The Pymatgen element is expressed with the symbol of the element.
- Returns:
d – Json-serializable dict of a PressureReservoirs object.
- Return type:
dict
- classmethod from_dict(d)[source]#
Constructor of PressureReservoirs object from dictionary representation.
- Parameters:
d (dict)
- Return type:
PressureReservoirs object.
- static from_json(path_or_string)[source]#
Build PressureReservoirs object from json file or string.
- Parameters:
path_or_string (str) – If an existing path to a file is given the object is constructed reading the json file. Otherwise it will be read as a string.
- Return type:
PressureReservoir object.