kim-tools 0.3.9__py3-none-any.whl → 0.3.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
kim_tools/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.3.9"
1
+ __version__ = "0.3.10"
2
2
 
3
3
  from .aflow_util import *
4
4
  from .aflow_util import __all__ as aflow_all
@@ -787,6 +787,10 @@ class KIMTestDriver(ABC):
787
787
  if isinstance(instance[key], dict):
788
788
  if file_in_output_name == instance[key]["source-value"]:
789
789
  shutil.move(file_in_output, filename_parent)
790
+ elif isinstance(instance[key]["source-value"], list):
791
+ for file_in_property in instance[key]["source-value"]:
792
+ if file_in_output_name == file_in_property:
793
+ shutil.move(file_in_output, filename_parent)
790
794
 
791
795
  def get_isolated_energy_per_atom(self, symbol: str) -> float:
792
796
  """
@@ -1402,6 +1406,7 @@ class SingleCrystalTestDriver(KIMTestDriver):
1402
1406
  cell_rtol: float = 0.01,
1403
1407
  rot_rtol: float = 0.01,
1404
1408
  rot_atol: float = 0.01,
1409
+ match_library_proto: bool = True,
1405
1410
  ) -> None:
1406
1411
  """
1407
1412
  Update the nominal parameter values of the nominal crystal structure from the
@@ -1446,6 +1451,8 @@ class SingleCrystalTestDriver(KIMTestDriver):
1446
1451
  Parameter to pass to :func:`numpy.allclose` for compariong fractional
1447
1452
  rotations. Default value chosen to be commensurate with AFLOW
1448
1453
  default distance tolerance of 0.01*(NN distance)
1454
+ match_library_proto:
1455
+ Whether to match to library prototypes
1449
1456
 
1450
1457
  Raises:
1451
1458
  AFLOW.FailedToMatchException:
@@ -1458,16 +1465,29 @@ class SingleCrystalTestDriver(KIMTestDriver):
1458
1465
  """
1459
1466
  aflow = AFLOW(aflow_executable=self.aflow_executable)
1460
1467
  try:
1461
- (aflow_parameter_values, library_prototype_label, short_name) = (
1462
- aflow.solve_for_params_of_known_prototype(
1468
+ if match_library_proto:
1469
+ (aflow_parameter_values, library_prototype_label, short_name) = (
1470
+ aflow.solve_for_params_of_known_prototype(
1471
+ atoms=atoms,
1472
+ prototype_label=self.get_nominal_prototype_label(),
1473
+ max_resid=max_resid,
1474
+ cell_rtol=cell_rtol,
1475
+ rot_rtol=rot_rtol,
1476
+ rot_atol=rot_atol,
1477
+ )
1478
+ )
1479
+ else:
1480
+ aflow_parameter_values = aflow.solve_for_params_of_known_prototype(
1463
1481
  atoms=atoms,
1464
1482
  prototype_label=self.get_nominal_prototype_label(),
1465
1483
  max_resid=max_resid,
1466
1484
  cell_rtol=cell_rtol,
1467
1485
  rot_rtol=rot_rtol,
1468
1486
  rot_atol=rot_atol,
1487
+ match_library_proto=False,
1469
1488
  )
1470
- )
1489
+ library_prototype_label = None
1490
+ short_name = None
1471
1491
  except (AFLOW.FailedToMatchException, AFLOW.ChangedSymmetryException) as e:
1472
1492
  raise type(e)(
1473
1493
  "Encountered an error that MAY be the result of the nominal crystal "
@@ -1946,21 +1966,38 @@ class SingleCrystalTestDriver(KIMTestDriver):
1946
1966
  def get_nominal_space_group_number(self) -> int:
1947
1967
  return get_space_group_number_from_prototype(self.get_nominal_prototype_label())
1948
1968
 
1949
- def get_stoichiometry(self) -> List[int]:
1969
+ def get_nominal_stoichiometric_species(self) -> List[str]:
1970
+ return self._get_nominal_crystal_structure_npt()["stoichiometric-species"][
1971
+ "source-value"
1972
+ ]
1973
+
1974
+ def get_nominal_stoichiometry(self) -> List[int]:
1950
1975
  return get_stoich_reduced_list_from_prototype(
1951
1976
  self.get_nominal_prototype_label()
1952
1977
  )
1953
1978
 
1979
+ def get_nominal_a(self) -> float:
1980
+ return self._get_nominal_crystal_structure_npt()["a"]["source-value"]
1981
+
1954
1982
  def get_nominal_parameter_names(self) -> List[str]:
1955
- """
1956
- Get the list of parameter names besides "a". Return an
1957
- empty list for cubic crystals
1958
- """
1959
- crystal_structure = self._get_nominal_crystal_structure_npt()
1960
- if "parameter-names" in crystal_structure:
1961
- return crystal_structure["parameter-names"]["source-value"]
1962
- else:
1963
- return []
1983
+ return _get_optional_source_value(
1984
+ self._get_nominal_crystal_structure_npt(), "parameter-names"
1985
+ )
1986
+
1987
+ def get_nominal_parameter_values(self) -> List[float]:
1988
+ return _get_optional_source_value(
1989
+ self._get_nominal_crystal_structure_npt(), "parameter-values"
1990
+ )
1991
+
1992
+ def get_nominal_short_name(self) -> List[str]:
1993
+ return _get_optional_source_value(
1994
+ self._get_nominal_crystal_structure_npt(), "short-name"
1995
+ )
1996
+
1997
+ def get_nominal_library_prototype_label(self) -> str:
1998
+ return _get_optional_source_value(
1999
+ self._get_nominal_crystal_structure_npt(), "library-prototype-label"
2000
+ )
1964
2001
 
1965
2002
  def get_atom_indices_for_each_wyckoff_orb(self) -> List[Dict]:
1966
2003
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kim-tools
3
- Version: 0.3.9
3
+ Version: 0.3.10
4
4
  Summary: Base classes and helper routines for writing KIM Tests
5
5
  Author-email: ilia Nikiforov <nikif002@umn.edu>, Ellad Tadmor <tadmor@umn.edu>, Claire Waters <bwaters@umn.edu>, "Daniel S. Karls" <karl0100umn@gmail.com>, Matt Bierbaum <matt.bierbaum@gmail.com>, Eric Fuemmeler <efuemmel@umn.edu>, Philipp Hoellmer <ph2484@nyu.edu>, Guanming Zhang <gz2241@nyu.edu>, Tom Egg <tje3676@nyu.edu>
6
6
  Maintainer-email: ilia Nikiforov <nikif002@umn.edu>
@@ -1,4 +1,4 @@
1
- kim_tools/__init__.py,sha256=JnYWdvQufTnlREvqTcBFv0ZQoOwdekELyzJCKwE7XTI,433
1
+ kim_tools/__init__.py,sha256=JLUazZQCLoZytIvOaYLlsNL_HwIINUM3Qe4Z3ljGkoI,434
2
2
  kim_tools/kimunits.py,sha256=jOxBv9gRVhxPE6ygAIUxOzCAfPI6tT6sBaF_FNl9m-M,5387
3
3
  kim_tools/aflow_util/__init__.py,sha256=lJnQ8fZCma80QVRQeKvY4MQ87oCWu-9KATV3dKJfpDc,80
4
4
  kim_tools/aflow_util/core.py,sha256=PM-ww2zoZXksGHbyPKW54v8r1bignJvFhDByx7Qm1ac,80837
@@ -2023,11 +2023,11 @@ kim_tools/symmetry_util/data/wyck_pos_xform_under_normalizer.json,sha256=6g1YuYh
2023
2023
  kim_tools/symmetry_util/data/wyckoff_multiplicities.json,sha256=qG2RPBd_-ejDIfz-E4ZhkHyRpIboxRy7oiXkdDf5Eg8,32270
2024
2024
  kim_tools/symmetry_util/data/wyckoff_sets.json,sha256=f5ZpHKDHo6_JWki1b7KUGoYLlhU-44Qikw_-PtbLssw,9248
2025
2025
  kim_tools/test_driver/__init__.py,sha256=KOiceeZNqkfrgZ66CiRiUdniceDrCmmDXQkOw0wXaCQ,92
2026
- kim_tools/test_driver/core.py,sha256=sM0SPmNFuYVdvKbmCM3kJblFs5--k1xRm57FdUtgs34,97367
2026
+ kim_tools/test_driver/core.py,sha256=r7I4DXswo-f9Fl2aAwf0pBbRFnVk70Pyq9-mMlKGpaI,99055
2027
2027
  kim_tools/vc/__init__.py,sha256=zXjhxXCKVMLBMXXWYG3if7VOpBnsFrn_RjVpnohDm5c,74
2028
2028
  kim_tools/vc/core.py,sha256=BIjzEExnQAL2S90a_npptRm3ACqAo4fZBtvTDBMWMdw,13963
2029
- kim_tools-0.3.9.dist-info/licenses/LICENSE.CDDL,sha256=I2luEED_SHjuZ01B4rYG-AF_135amL24JpHvZ1Jhqe8,16373
2030
- kim_tools-0.3.9.dist-info/METADATA,sha256=mz0naaggDlfsGZXT1jSq9MbwQIaz3r8PkfKIO2DEw94,2032
2031
- kim_tools-0.3.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
2032
- kim_tools-0.3.9.dist-info/top_level.txt,sha256=w_YCpJ5ERigj9te74ln7k64tqj1VumOzM_s9dsalIWY,10
2033
- kim_tools-0.3.9.dist-info/RECORD,,
2029
+ kim_tools-0.3.10.dist-info/licenses/LICENSE.CDDL,sha256=I2luEED_SHjuZ01B4rYG-AF_135amL24JpHvZ1Jhqe8,16373
2030
+ kim_tools-0.3.10.dist-info/METADATA,sha256=Xkz5rrE_JMZpWPaQxRPJKoWH0CNolsnlgiGm32-FYws,2033
2031
+ kim_tools-0.3.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
2032
+ kim_tools-0.3.10.dist-info/top_level.txt,sha256=w_YCpJ5ERigj9te74ln7k64tqj1VumOzM_s9dsalIWY,10
2033
+ kim_tools-0.3.10.dist-info/RECORD,,