ThermoData#

class ThermoData(thermodata, name=None)[source]#

Bases: MSONable

Class to handle defect thermodynamics data

Class that handles dict of defect thermodynamics data.

Parameters:
  • thermodata (dict) –

    Dict that contains the thermodynamic data, typically output from the methods in the DefectThermodynamics class. Keys of the dict are set as attributes of ThermoData.

    Possible items are:

    partial_pressures(list)

    partial pressure values.

    variable_defect_specie(str)

    Name of variable defect species.

    variable_concentrations(list)

    Concentrations of variable species.

    defect_concentrations(list)

    DefectConcentrations objects (cm^-3).

    carrier_concentrations(list)

    Tuples with intrinsic carriers concentrations (holes,electrons) in cm^-3.

    conductivities(list)

    Conductivity values (in S/m).

    fermi_levels(list)

    Fermi level values in eV.

    temperatures(list)

    Temperature values in K.

  • name (str) – Name to assign to ThermoData.

Methods

as_dict

from_dict

Reconstitute a ThermoData object from a dict representation created using as_dict().

from_json

Build ThermoData object from json file or string.

get_specific_pressures

Get ThermoData object only for specific pressure values.

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_data

Set data dictionary.

to_json

Save ThermoData object as json string or file

unsafe_hash

Return a hash of the current object.

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

as_dict()[source]#
Returns:

Json-serializable dict representation of ThermoData

classmethod from_dict(d)[source]#

Reconstitute a ThermoData object from a dict representation created using as_dict().

Parameters:

d (dict) – Dictionary representation of ThermoData.

Return type:

ThermoData object.

static from_json(path_or_string)[source]#

Build ThermoData 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:

ThermoData object.

get_specific_pressures(p_values)[source]#

Get ThermoData object only for specific pressure values. The closest pressure value present in list is chosen for each provided value.

Parameters:

p_values (list) – List of partial pressure values.

Return type:

ThermoData object

items()[source]#
keys()[source]#
set_data(key, value)[source]#

Set data dictionary.

to_json(path=None)[source]#

Save ThermoData object as json string or file

Parameters:

path (str) – Path to the destination file. If None the name of ThermoData is used as filename.

Returns:

d – If path is not set a string is returned.

Return type:

str

values()[source]#