From 9f157d2bb5d27a885494dc1b2b81812d8e3e81a7 Mon Sep 17 00:00:00 2001 From: "Adam M. Krajewski" <54290107+amkrajewski@users.noreply.github.com> Date: Mon, 12 Feb 2024 18:37:17 -0500 Subject: [PATCH] (RSS) adding tests for `calculate_KS2022_randomSolutions` with matrix of input types: parallel pair --- pysipfenn/tests/test_pysipfenn.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pysipfenn/tests/test_pysipfenn.py b/pysipfenn/tests/test_pysipfenn.py index 527abc0..839c359 100644 --- a/pysipfenn/tests/test_pysipfenn.py +++ b/pysipfenn/tests/test_pysipfenn.py @@ -343,6 +343,19 @@ def test_descriptorCalculate_KS2022_randomSolution_serial_multiple(self): , places=6, msg="mean_NeighDiff_shell1_Number (KS2022[13]) should be different (1.0vs2.0)." ) + def test_descriptorCalculate_KS2022_randomSolution_parallel_pair(self): + """Test successful execution of a composition-structure pair in parallel mode. Just for the input passing + validation.""" + + with self.subTest(msg="Running single composition-structure pair"): + d1 = self.c.calculate_KS2022_randomSolutions( + 'BCC', + 'FeNi', + mode='parallel', + max_workers=1) + self.assertEqual(len(d1), 1, "Only one composition-structure pair should be processed.") + self.assertEqual(len(d1[0]), 256, "All 256 KS2022 features should be obtained.") + if __name__ == '__main__': unittest.main()