From 010e2ca887a374cff17efce5c61c2beb07766a75 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 14 Jul 2026 19:46:19 -0700 Subject: [PATCH 1/2] feat: defect energy --- express/settings.py | 3 +++ .../scalar/test_defect_formation_energy.py | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/unit/properties/scalar/test_defect_formation_energy.py diff --git a/express/settings.py b/express/settings.py index be222695..91f7dab8 100644 --- a/express/settings.py +++ b/express/settings.py @@ -20,6 +20,9 @@ }, "surface_energy": {"reference": "express.properties.scalar.scalar_property_context.ScalarPropertyFromContext"}, "interfacial_energy": {"reference": "express.properties.scalar.scalar_property_context.ScalarPropertyFromContext"}, + "defect_formation_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_defect_formation_energy.py b/tests/unit/properties/scalar/test_defect_formation_energy.py new file mode 100644 index 00000000..b19b6e83 --- /dev/null +++ b/tests/unit/properties/scalar/test_defect_formation_energy.py @@ -0,0 +1,18 @@ +from tests.unit import UnitTestBase +from express.properties.scalar.scalar_property_context import ScalarPropertyFromContext + +DEFECT_FORMATION_ENERGY = {"units": "eV/defect", "name": "defect_formation_energy", "value": 3.5} + + +class DefectFormationEnergyTest(UnitTestBase): + def setUp(self): + super().setUp() + + def tearDown(self): + super().tearDown() + + def test_defect_formation_energy(self): + property_ = ScalarPropertyFromContext( + "defect_formation_energy", None, value=DEFECT_FORMATION_ENERGY["value"] + ) + self.assertDeepAlmostEqual(property_.serialize_and_validate(), DEFECT_FORMATION_ENERGY) From efe9451c4247cb38bc644dbcc6e37aff5eba536b Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 28 Jul 2026 10:36:55 -0700 Subject: [PATCH 2/2] chore: eV --- tests/unit/properties/scalar/test_defect_formation_energy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/properties/scalar/test_defect_formation_energy.py b/tests/unit/properties/scalar/test_defect_formation_energy.py index b19b6e83..8b7da432 100644 --- a/tests/unit/properties/scalar/test_defect_formation_energy.py +++ b/tests/unit/properties/scalar/test_defect_formation_energy.py @@ -1,7 +1,7 @@ from tests.unit import UnitTestBase from express.properties.scalar.scalar_property_context import ScalarPropertyFromContext -DEFECT_FORMATION_ENERGY = {"units": "eV/defect", "name": "defect_formation_energy", "value": 3.5} +DEFECT_FORMATION_ENERGY = {"units": "eV", "name": "defect_formation_energy", "value": 3.5} class DefectFormationEnergyTest(UnitTestBase):