From 9020b53a0dba91f688c9f0c083a6cfecf3f3d952 Mon Sep 17 00:00:00 2001 From: Patrick Huck Date: Wed, 31 Oct 2018 22:58:27 +0000 Subject: [PATCH 1/2] quantity.from_key_value --- propnet/core/quantity.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/propnet/core/quantity.py b/propnet/core/quantity.py index 00ff6703..be46e95d 100644 --- a/propnet/core/quantity.py +++ b/propnet/core/quantity.py @@ -240,6 +240,12 @@ def as_dict(self): "@module": "propnet.core.quantity", "@class": "Quantity"} + @classmethod + def from_key_value(cls, key, value): + for symbol_type, prop in DEFAULT_SYMBOLS.items(): + if key == symbol_type or key in prop.display_symbols: + return cls(symbol_type, ureg.parse_expression(value)) + @classmethod def from_weighted_mean(cls, quantities): """ From 2cdd342a7bbea8619501c62e9f41df0c372bf23d Mon Sep 17 00:00:00 2001 From: Patrick Huck Date: Wed, 31 Oct 2018 22:58:48 +0000 Subject: [PATCH 2/2] formation_enthalpy_per_mole --- .../symbols/properties/formation_enthalpy_per_mole.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 propnet/symbols/properties/formation_enthalpy_per_mole.yaml diff --git a/propnet/symbols/properties/formation_enthalpy_per_mole.yaml b/propnet/symbols/properties/formation_enthalpy_per_mole.yaml new file mode 100644 index 00000000..cc42cf2a --- /dev/null +++ b/propnet/symbols/properties/formation_enthalpy_per_mole.yaml @@ -0,0 +1,7 @@ +name: formation_enthalpy_per_mole +units: eV / mol +display_names: [Formation Enthalpy per Mole] +display_symbols: ["ΔH"] +shape: 1 +comment: '' +category: property