PressureReservoirs#

class PressureReservoirs(res_dict, temperature=None, phase_diagram=None, mu_refs=None, are_chempots_delta=False)[source]#

Bases: Reservoirs

Subclass 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

as_dict

Json-serializable dict representation of a PressureReservoirs object.

copy

filter_reservoirs

Get new Reservoir object filtering the chempots dictionary.

from_dict

Constructor of PressureReservoirs object from dictionary representation.

from_json

Build PressureReservoirs object from json file or string.

get_absolute_res_dict

Return values of chempots from referenced to absolute

get_dataframe

Get DataFrame object of the dictionary of reservoirs.

get_latex_table

Get string with formatted latex table of chemical potentials.

get_plot

Plot the stability diagram with the reservoir points.

get_referenced_res_dict

Return values of chempots from absolute to referenced

items

keys

load

Load an instance from a JSON file written by save().

save

Serialize the instance to JSON on disk, pickling fields if needed.

set_to_absolute

Set reservoir dictionary to absolute values of chempots.

set_to_referenced

Set reservoir dictionary to referenced values of chempots.

to_json

Save Reservoirs object as json string or file

unsafe_hash

Return a hash of the current object.

update

validate_monty_v1

Pydantic validator with correct signature for pydantic v1.x.

validate_monty_v2

Pydantic validator with correct signature for pydantic v2.x.

values

Attributes

REDIRECT

are_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.