From e9dd4795c8e50f4e67f7e0a656302b1216d23174 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 6 May 2025 21:36:15 -0700 Subject: [PATCH 1/4] update: add test for SiC poscar --- tests/fixtures/data.py | 4 ++-- tests/fixtures/structural/test-003/POSCAR | 20 ++++++++++++++++++++ tests/integration/parsers/test_structure.py | 5 ++++- tests/manifest.yaml | 4 ++++ 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 tests/fixtures/structural/test-003/POSCAR diff --git a/tests/fixtures/data.py b/tests/fixtures/data.py index d25c9c15..689fee69 100644 --- a/tests/fixtures/data.py +++ b/tests/fixtures/data.py @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c6dfc86c91e91091a18ae8006cb9ba5d6d7e0935111273d1396ca78be82297df -size 23287 +oid sha256:2aabda2a71e0de9745e1349838e3f7117099056d317ec18cdb918111295b7099 +size 26202 diff --git a/tests/fixtures/structural/test-003/POSCAR b/tests/fixtures/structural/test-003/POSCAR new file mode 100644 index 00000000..bc91063a --- /dev/null +++ b/tests/fixtures/structural/test-003/POSCAR @@ -0,0 +1,20 @@ +SiC +1.0 + 3.094884000 0.000000000 0.000000000 + -1.547442000 2.680248000 0.000000000 + 0.000000000 0.000000000 15.184530000 +Si C Si C +4 5 2 1 +direct + 0.333333000 0.666667000 0.832986000 Si + 0.666667000 0.333333000 0.332986000 Si + 0.666667000 0.333333000 0.666509000 Si + 0.000000000 0.000000000 0.000000000 Si + 0.000000000 0.000000000 0.874352000 C + 0.000000000 0.000000000 0.374352000 C + 0.333333000 0.666667000 0.708004000 C + 0.666667000 0.333333000 0.208004000 C + 0.666667000 0.333333000 0.541526000 C + 0.333333000 0.666667000 0.166509000 Si + 0.000000000 0.000000000 0.499723000 Si + 0.333333000 0.666667000 0.041526000 C diff --git a/tests/integration/parsers/test_structure.py b/tests/integration/parsers/test_structure.py index c87b9ba3..2dca4083 100644 --- a/tests/integration/parsers/test_structure.py +++ b/tests/integration/parsers/test_structure.py @@ -1,7 +1,7 @@ import os from express.parsers.structure import StructureParser -from tests.fixtures.data import SI, JVASP_677 +from tests.fixtures.data import SI, JVASP_677, SiC from tests.integration import IntegrationTestBase @@ -40,3 +40,6 @@ def test_structure_jarvis_db_entry_basis(self): def test_structure_jarvis_db_entry_lattice_bravais(self): self.assertDeepAlmostEqual(self.parser.lattice_bravais(), JVASP_677["lattice"], places=2) + + def test_structure_silicon_carbide(self): + self.assertDeepAlmostEqual(self.parser.basis(), SiC["basis"], places=2) diff --git a/tests/manifest.yaml b/tests/manifest.yaml index 18390c32..25ba2b45 100644 --- a/tests/manifest.yaml +++ b/tests/manifest.yaml @@ -247,6 +247,10 @@ test_material_from_structure: structurePath: fixtures/espresso/v5_4/test-001/pw-scf.in structureFormat: espresso-in +test_structure_silicon_carbide: + structurePath: fixtures/structural/test-003/POSCAR + structureFormat: poscar + test_material_serialize_and_validate: workDir: fixtures/vasp/test-001 stdoutFile: fixtures/vasp/test-001/vasp.out From 984c7a7817cfe3fe785faaeacec2f1aedc253d31 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Fri, 9 May 2025 20:33:02 -0700 Subject: [PATCH 2/4] fix: lint --- express/properties/material.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/express/properties/material.py b/express/properties/material.py index 8754afd4..21b70e43 100644 --- a/express/properties/material.py +++ b/express/properties/material.py @@ -85,7 +85,7 @@ def derived_properties(self): derived_properties.extend(self._p_norms()) # TODO: Determine how to avoid an eternal pass when one derived property fails except Exception as e: - logging.info(f"NOTE: derived properties array is empty due to failure to calculate values. Exception: {e} ") + logging.info(f"NOTE: derived properties are empty due to failure to calculate values. Exception: {e} ") print("NOTE: derived properties array is empty due to failure to calculate values.", e) pass return sorted(derived_properties, key=lambda x: x["name"]) From d2f6b199e903a7cb739aa9150c9277183698c7fa Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 9 May 2025 22:09:17 -0700 Subject: [PATCH 3/4] update: remove cell from fixture --- tests/fixtures/data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fixtures/data.py b/tests/fixtures/data.py index 689fee69..5d03bd92 100644 --- a/tests/fixtures/data.py +++ b/tests/fixtures/data.py @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2aabda2a71e0de9745e1349838e3f7117099056d317ec18cdb918111295b7099 -size 26202 +oid sha256:1856a70b24c1282e38835fbfdcdcdcb2ec4dac9cd0081bf88b66141412eeacf1 +size 24072 From ee1edfd794cc6cbfda93f945e81328cbe5339e9d Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 9 May 2025 22:15:45 -0700 Subject: [PATCH 4/4] update: rename --- tests/integration/parsers/test_structure.py | 4 ++-- tests/manifest.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/parsers/test_structure.py b/tests/integration/parsers/test_structure.py index 2dca4083..a8c3a0e0 100644 --- a/tests/integration/parsers/test_structure.py +++ b/tests/integration/parsers/test_structure.py @@ -1,7 +1,7 @@ import os from express.parsers.structure import StructureParser -from tests.fixtures.data import SI, JVASP_677, SiC +from tests.fixtures.data import JVASP_677, SI, SiC from tests.integration import IntegrationTestBase @@ -41,5 +41,5 @@ def test_structure_jarvis_db_entry_basis(self): def test_structure_jarvis_db_entry_lattice_bravais(self): self.assertDeepAlmostEqual(self.parser.lattice_bravais(), JVASP_677["lattice"], places=2) - def test_structure_silicon_carbide(self): + def test_material_vasp_structure_order_of_elements(self): self.assertDeepAlmostEqual(self.parser.basis(), SiC["basis"], places=2) diff --git a/tests/manifest.yaml b/tests/manifest.yaml index 25ba2b45..31f49dc5 100644 --- a/tests/manifest.yaml +++ b/tests/manifest.yaml @@ -247,7 +247,7 @@ test_material_from_structure: structurePath: fixtures/espresso/v5_4/test-001/pw-scf.in structureFormat: espresso-in -test_structure_silicon_carbide: +test_material_vasp_structure_order_of_elements: structurePath: fixtures/structural/test-003/POSCAR structureFormat: poscar