def __init__(self, composition, thermodata, temperature=298): """ Args: composition: Composition of the entry. For flexibility, this can take the form of all the typical input taken by a Composition, including a {symbol: amt} dict, a string formula, and others. thermodata: A sequence of ThermoData associated with the entry. temperature: A temperature for the entry in Kelvin. Defaults to 298K. """ comp = Composition(composition) self._thermodata = thermodata found = False enthalpy = float("inf") for data in self._thermodata: if data.type == "fH" and data.value < enthalpy and \ (data.phaseinfo != "gas" and data.phaseinfo != "liquid"): enthalpy = data.value found = True if not found: raise ValueError("List of Thermodata does not contain enthalpy " "values.") self.temperature = temperature PDEntry.__init__(self, comp, enthalpy)
def __init__(self, composition, energy, correction=0.0, parameters=None, data=None, entry_id=None): """ Args: composition: Composition of the entry. For flexibility, this can take the form of all the typical input taken by a Composition, including a {symbol: amt} dict, a string formula, and others. energy: Energy of the entry. Usually the final calculated energy from VASP or other electronic structure codes. correction: A correction to be applied to the energy. This is used to modify the energy for certain analyses. Defaults to 0.0. parameters: An optional dict of parameters associated with the entry. Defaults to None. data: An optional dict of any additional data associated with the entry. Defaults to None. entry_id: An optional id to uniquely identify the entry. """ comp = Composition(composition) PDEntry.__init__(self, comp, energy) self.correction = correction self.parameters = parameters if parameters else {} self.data = data if data else {} self.entry_id = entry_id
def __init__(self, composition, energy, correction=0.0, parameters=None, data=None, entry_id=None, attribute=None): """ Initializes a ComputedEntry. Args: composition (Composition): Composition of the entry. For flexibility, this can take the form of all the typical input taken by a Composition, including a {symbol: amt} dict, a string formula, and others. energy (float): Energy of the entry. Usually the final calculated energy from VASP or other electronic structure codes. correction (float): A correction to be applied to the energy. This is used to modify the energy for certain analyses. Defaults to 0.0. parameters (dict): An optional dict of parameters associated with the entry. Defaults to None. data (dict): An optional dict of any additional data associated with the entry. Defaults to None. entry_id (obj): An optional id to uniquely identify the entry. attribute: Optional attribute of the entry. This can be used to specify that the entry is a newly found compound, or to specify a particular label for the entry, or else ... Used for further analysis and plotting purposes. An attribute can be anything but must be MSONable. """ comp = Composition(composition) PDEntry.__init__(self, comp, energy, attribute=attribute) self.correction = correction self.parameters = parameters if parameters else {} self.data = data if data else {} self.entry_id = entry_id self._attribute = attribute
def __init__(self, composition, energy, correction=0.0, parameters=None, data=None, entry_id=None, attribute=None): """ Args: composition: Composition of the entry. For flexibility, this can take the form of all the typical input taken by a Composition, including a {symbol: amt} dict, a string formula, and others. energy: Energy of the entry. Usually the final calculated energy from VASP or other electronic structure codes. correction: A correction to be applied to the energy. This is used to modify the energy for certain analyses. Defaults to 0.0. parameters: An optional dict of parameters associated with the entry. Defaults to None. data: An optional dict of any additional data associated with the entry. Defaults to None. entry_id: An optional id to uniquely identify the entry. attribute: Optional attribute of the entry. This can be used to specify that the entry is a newly found compound, or to specify a particular label for the entry, or else ... Used for further analysis and plotting purposes. An attribute can be anything but must be MSONable. """ comp = Composition(composition) PDEntry.__init__(self, comp, energy, attribute=attribute) self.correction = correction self.parameters = parameters if parameters else {} self.data = data if data else {} self.entry_id = entry_id self._attribute = attribute
def __init__(self, composition, thermodata, temperature=298): comp = Composition(composition) self._thermodata = thermodata found = False enthalpy = float("inf") for data in self._thermodata: if data.type == "fH" and data.value < enthalpy and \ (data.phaseinfo != "gas" and data.phaseinfo != "liquid"): enthalpy = data.value found = True if not found: raise ValueError("List of Thermodata does not contain enthalpy " "values.") self.temperature = temperature PDEntry.__init__(self, comp, enthalpy)