From d17c4942adb4d3894a311119b6f391164409e9dc Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Sun, 24 May 2026 14:07:24 -0700 Subject: [PATCH 1/4] update: add formation energy property --- express/settings.py | 1 + .../properties/scalar/test_formation_energy.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/unit/properties/scalar/test_formation_energy.py diff --git a/express/settings.py b/express/settings.py index 7b12344c..4e545d90 100644 --- a/express/settings.py +++ b/express/settings.py @@ -19,6 +19,7 @@ "reference": "express.properties.scalar.thermal_correction_to_enthalpy.ThermalCorrectionToEnthalpy" }, "surface_energy": {"reference": "express.properties.scalar.scalar_property_context.ScalarPropertyFromContext"}, + "formation_energy": {"reference": "express.properties.scalar.scalar_property_context.ScalarPropertyFromContext"}, "reaction_energy_barrier": {"reference": "express.properties.scalar.reaction_energy_barrier.ReactionEnergyBarrier"}, "valence_band_offset": {"reference": "express.properties.scalar.scalar_property_context.ScalarPropertyFromContext"}, } diff --git a/tests/unit/properties/scalar/test_formation_energy.py b/tests/unit/properties/scalar/test_formation_energy.py new file mode 100644 index 00000000..ad61c6aa --- /dev/null +++ b/tests/unit/properties/scalar/test_formation_energy.py @@ -0,0 +1,18 @@ +from tests.unit import UnitTestBase +from express.properties.scalar.scalar_property_context import ScalarPropertyFromContext + +FORMATION_ENERGY = {"units": "eV", "name": "formation_energy", "value": -0.123} +FORMATION_ENERGY_VALUE = -0.123 + + +class FormationEnergyTest(UnitTestBase): + def setUp(self): + super().setUp() + + def tearDown(self): + super().tearDown() + + def test_formation_energy(self): + parser = self.get_mocked_parser("formation_energy", FORMATION_ENERGY_VALUE) # noqa : F841 + property_ = ScalarPropertyFromContext("formation_energy", None, value=FORMATION_ENERGY_VALUE) + self.assertDeepAlmostEqual(property_.serialize_and_validate(), FORMATION_ENERGY) From de3fb2ff50ed9ce41f215b12765384162c2b8e4d Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 29 May 2026 15:05:59 -0700 Subject: [PATCH 2/4] chore: pin mat3ra-esse MVP commit and use eV/atom in formation energy test --- pyproject.toml | 2 +- tests/unit/properties/scalar/test_formation_energy.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 04dc0c13..c79c71fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ classifiers = [ dependencies = [ "pymatgen>=2023.8.10", "ase>=3.17.0", - "mat3ra-esse>=2026.5.27.post0", + "mat3ra-esse @ git+https://github.com/Exabyte-io/esse.git@4c9a72446269b3ca643e75fb48814a27d0e14fe9", "jarvis-tools>=2023.12.12", # To avoid module 'numpy.linalg._umath_linalg' has no attribute '_ilp64' in Colab "numpy>=1.24.4,<2", diff --git a/tests/unit/properties/scalar/test_formation_energy.py b/tests/unit/properties/scalar/test_formation_energy.py index ad61c6aa..23d5c8c2 100644 --- a/tests/unit/properties/scalar/test_formation_energy.py +++ b/tests/unit/properties/scalar/test_formation_energy.py @@ -1,7 +1,7 @@ from tests.unit import UnitTestBase from express.properties.scalar.scalar_property_context import ScalarPropertyFromContext -FORMATION_ENERGY = {"units": "eV", "name": "formation_energy", "value": -0.123} +FORMATION_ENERGY = {"units": "eV/atom", "name": "formation_energy", "value": -0.123} FORMATION_ENERGY_VALUE = -0.123 From 59b2ba3a79d4e0b9a270f2fc85caf6854b51ea9f Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Mon, 1 Jun 2026 11:23:34 -0700 Subject: [PATCH 3/4] chore: bump esse --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c79c71fd..0f3a4d81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ classifiers = [ dependencies = [ "pymatgen>=2023.8.10", "ase>=3.17.0", - "mat3ra-esse @ git+https://github.com/Exabyte-io/esse.git@4c9a72446269b3ca643e75fb48814a27d0e14fe9", + "mat3ra-esse>=2026.5.30.post0", "jarvis-tools>=2023.12.12", # To avoid module 'numpy.linalg._umath_linalg' has no attribute '_ilp64' in Colab "numpy>=1.24.4,<2", From 195badb7b1aedcb7d96333408e974c3a268981f3 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 5 Jun 2026 18:08:20 -0700 Subject: [PATCH 4/4] chore: simplify --- tests/unit/properties/scalar/test_formation_energy.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/unit/properties/scalar/test_formation_energy.py b/tests/unit/properties/scalar/test_formation_energy.py index 23d5c8c2..f35ef34d 100644 --- a/tests/unit/properties/scalar/test_formation_energy.py +++ b/tests/unit/properties/scalar/test_formation_energy.py @@ -2,7 +2,6 @@ from express.properties.scalar.scalar_property_context import ScalarPropertyFromContext FORMATION_ENERGY = {"units": "eV/atom", "name": "formation_energy", "value": -0.123} -FORMATION_ENERGY_VALUE = -0.123 class FormationEnergyTest(UnitTestBase): @@ -13,6 +12,6 @@ def tearDown(self): super().tearDown() def test_formation_energy(self): - parser = self.get_mocked_parser("formation_energy", FORMATION_ENERGY_VALUE) # noqa : F841 - property_ = ScalarPropertyFromContext("formation_energy", None, value=FORMATION_ENERGY_VALUE) + parser = self.get_mocked_parser("formation_energy", FORMATION_ENERGY["value"]) # noqa : F841 + property_ = ScalarPropertyFromContext("formation_energy", None, value=FORMATION_ENERGY["value"]) self.assertDeepAlmostEqual(property_.serialize_and_validate(), FORMATION_ENERGY)