kim-tools 0.3.1__py3-none-any.whl → 0.3.2__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.1"
1
+ __version__ = "0.3.2"
2
2
 
3
3
  from .aflow_util import *
4
4
  from .aflow_util import __all__ as aflow_all
@@ -396,6 +396,7 @@ def prototype_labels_are_equivalent(
396
396
  prototype_label_1: str,
397
397
  prototype_label_2: str,
398
398
  allow_enantiomorph: bool = False,
399
+ log: bool = True,
399
400
  ) -> bool:
400
401
  """
401
402
  Checks if two prototype labels are equivalent (species permutations not allowed)
@@ -403,6 +404,8 @@ def prototype_labels_are_equivalent(
403
404
  Args:
404
405
  allow_enantiomorph:
405
406
  Whether to consider enantiomorphic pairs of space groups to be equivalent
407
+ log:
408
+ Whether to log results
406
409
  """
407
410
 
408
411
  if prototype_label_1 == prototype_label_2:
@@ -414,20 +417,22 @@ def prototype_labels_are_equivalent(
414
417
  if not stoich_reduced_list_1 == get_stoich_reduced_list_from_prototype(
415
418
  prototype_label_2
416
419
  ):
417
- logger.info(
418
- "Found non-matching stoichiometry in labels "
419
- f"{prototype_label_1} and {prototype_label_2}"
420
- )
420
+ if log:
421
+ logger.info(
422
+ "Found non-matching stoichiometry in labels "
423
+ f"{prototype_label_1} and {prototype_label_2}"
424
+ )
421
425
  return False
422
426
 
423
427
  # Check Pearson symbol
424
428
  if not get_pearson_symbol_from_prototype(
425
429
  prototype_label_1
426
430
  ) == get_pearson_symbol_from_prototype(prototype_label_2):
427
- logger.info(
428
- "Found non-matching Pearson symbol in labels "
429
- f"{prototype_label_1} and {prototype_label_2}"
430
- )
431
+ if log:
432
+ logger.info(
433
+ "Found non-matching Pearson symbol in labels "
434
+ f"{prototype_label_1} and {prototype_label_2}"
435
+ )
431
436
  return False
432
437
 
433
438
  # Check space group number
@@ -436,16 +441,18 @@ def prototype_labels_are_equivalent(
436
441
  if allow_enantiomorph and not space_group_numbers_are_enantiomorphic(
437
442
  sg_num_2, sg_num_1
438
443
  ):
439
- logger.info(
440
- "Found non-matching Space group in labels "
441
- f"{prototype_label_1} and {prototype_label_2}"
442
- )
444
+ if log:
445
+ logger.info(
446
+ "Found non-matching Space group in labels "
447
+ f"{prototype_label_1} and {prototype_label_2}"
448
+ )
443
449
  return False
444
450
  elif sg_num_2 != sg_num_1:
445
- logger.info(
446
- "Found non-matching Space group in labels "
447
- f"{prototype_label_1} and {prototype_label_2}"
448
- )
451
+ if log:
452
+ logger.info(
453
+ "Found non-matching Space group in labels "
454
+ f"{prototype_label_1} and {prototype_label_2}"
455
+ )
449
456
  return False
450
457
 
451
458
  # OK, so far everything matches, now check the Wyckoff letters
@@ -487,16 +494,18 @@ def prototype_labels_are_equivalent(
487
494
  wyckoff_lists_match_for_each_species = False
488
495
  break
489
496
  if wyckoff_lists_match_for_each_species:
490
- logger.warning(
491
- f"Labels {prototype_label_1} and {prototype_label_2} were found to "
492
- "be equivalent despite being non-identical. "
493
- "This indicates a failure to find the lowest Wyckoff enumeration."
494
- )
497
+ if log:
498
+ logger.warning(
499
+ f"Labels {prototype_label_1} and {prototype_label_2} were found"
500
+ " to be equivalent despite being non-identical. This indicates "
501
+ "a failure to find the lowest Wyckoff enumeration."
502
+ )
495
503
  return True
496
- logger.info(
497
- f"Labels {prototype_label_1} and {prototype_label_2} were not found to be "
498
- "equivalent under any permutations allowable by the normalizer."
499
- )
504
+ if log:
505
+ logger.info(
506
+ f"Labels {prototype_label_1} and {prototype_label_2} were not found to "
507
+ "be equivalent under any permutations allowable by the normalizer."
508
+ )
500
509
  return False
501
510
  else:
502
511
  for wyckoff_list_1, wyckoff_list_2 in zip(wyckoff_lists_1, wyckoff_lists_2):
@@ -505,17 +514,19 @@ def prototype_labels_are_equivalent(
505
514
  # need to re-sort anything.
506
515
  # This is NOT true for all SGs (e.g. #200, Wyckoff set eh )
507
516
  if not are_in_same_wyckoff_set(letter_1, letter_2, sg_num_1):
508
- logger.info(
509
- f"Labels {prototype_label_1} and {prototype_label_2} have "
510
- f"corresponding letters {letter_1} and {letter_2} that are not "
511
- "in the same Wyckoff set"
512
- )
517
+ if log:
518
+ logger.info(
519
+ f"Labels {prototype_label_1} and {prototype_label_2} have "
520
+ f"corresponding letters {letter_1} and {letter_2} that are "
521
+ "not in the same Wyckoff set"
522
+ )
513
523
  return False
514
- logger.info(
515
- f"Labels {prototype_label_1} and {prototype_label_2} were found to be "
516
- "equivalent despite being non-identical. This is a normal occurrence for "
517
- "triclinic and monoclinic space groups such as this."
518
- )
524
+ if log:
525
+ logger.info(
526
+ f"Labels {prototype_label_1} and {prototype_label_2} were found to be "
527
+ "equivalent despite being non-identical. This is a normal occurrence "
528
+ "for triclinic and monoclinic space groups such as this."
529
+ )
519
530
  return True
520
531
 
521
532
 
@@ -523,6 +534,7 @@ def find_species_permutation_between_prototype_labels(
523
534
  prototype_label_1: str,
524
535
  prototype_label_2: str,
525
536
  allow_enantiomorph: bool = False,
537
+ log: bool = True,
526
538
  ) -> Optional[Tuple[int]]:
527
539
  """
528
540
  Find the permutation of species required to match two prototype labels
@@ -530,6 +542,8 @@ def find_species_permutation_between_prototype_labels(
530
542
  Args:
531
543
  allow_enantiomorph:
532
544
  Whether to consider enantiomorphic pairs of space groups to be equivalent
545
+ log:
546
+ Whether to log results
533
547
 
534
548
  Returns:
535
549
  The permutation of species of ``prototype_label_1`` required to match
@@ -289,8 +289,11 @@ def space_group_numbers_are_enantiomorphic(sg_1: int, sg_2: int) -> bool:
289
289
  }
290
290
  enantiomorph_conversion_2 = {v: k for k, v in enantiomorph_conversion.items()}
291
291
  enantiomorph_conversion.update(enantiomorph_conversion_2)
292
- if enantiomorph_conversion[sg_1] == sg_2:
293
- return True
292
+ if sg_1 in enantiomorph_conversion:
293
+ if enantiomorph_conversion[sg_1] == sg_2:
294
+ return True
295
+ else:
296
+ return False
294
297
  else:
295
298
  return False
296
299
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kim-tools
3
- Version: 0.3.1
3
+ Version: 0.3.2
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,7 +1,7 @@
1
- kim_tools/__init__.py,sha256=dOQsrWeoyK-9Fr4gPNLzdouLMm0J0hhh6qd86cPECns,433
1
+ kim_tools/__init__.py,sha256=AhAW6unNWB_4jaiwxb0_XxUKtCv1rwG3CNqLk4aqqso,433
2
2
  kim_tools/kimunits.py,sha256=jOxBv9gRVhxPE6ygAIUxOzCAfPI6tT6sBaF_FNl9m-M,5387
3
3
  kim_tools/aflow_util/__init__.py,sha256=lJnQ8fZCma80QVRQeKvY4MQ87oCWu-9KATV3dKJfpDc,80
4
- kim_tools/aflow_util/core.py,sha256=NULg8zJG4B5lh4p-Q7yPsJvgzPG_BgSRjgrLpyX3UUI,75526
4
+ kim_tools/aflow_util/core.py,sha256=CsqN6MNVXE4QFrM0SxWhahTwu_gTeUXITk7ZMXLXfv0,75954
5
5
  kim_tools/aflow_util/aflow_prototype_encyclopedia/data/A108B24C11D24_cP334_222_h4i_i_bf_i-001/info.json,sha256=IsFiO9X2Ko7yoq2QkDurUVP7k1BE4WFgblu7oxl6iZs,2013
6
6
  kim_tools/aflow_util/aflow_prototype_encyclopedia/data/A10B11_tI84_139_dehim_eh2n-001/info.json,sha256=f1EdtouuSL2y9NNw40Rvz2J9ZZcsqQBcyEmlHj6XoW8,1186
7
7
  kim_tools/aflow_util/aflow_prototype_encyclopedia/data/A10B2C_hP39_171_5c_c_a-001/info.json,sha256=vD1xjZKWShL0E6XNsSlmIhilGcGNefl56oQDLQlHO1M,1596
@@ -2004,7 +2004,7 @@ kim_tools/aflow_util/aflow_prototype_encyclopedia/data/A_tP50_134_a2m2n-001/info
2004
2004
  kim_tools/ase/__init__.py,sha256=1i6ko5tNr0VZC3T7hoEzq4fnSU0DdxNpxXcSaWMcJWc,76
2005
2005
  kim_tools/ase/core.py,sha256=d6eOu_HSxVr-ae0TSEbY4HKdePxhNu3yv8NN9VDl-BA,30256
2006
2006
  kim_tools/symmetry_util/__init__.py,sha256=uu-ZSUDUTe2P81rkAS3tXverx31s_uZ3wL4SD_dn5aI,86
2007
- kim_tools/symmetry_util/core.py,sha256=RVvKisrNxHKq36ceIorc06cnX3la3WoWNPVV0hKnptM,30789
2007
+ kim_tools/symmetry_util/core.py,sha256=HfDy1CwNWUZIkb4cs3ebUDgWjtt4jRSkBKgGEnlkjuI,30888
2008
2008
  kim_tools/symmetry_util/data/possible_primitive_shifts.json,sha256=4OVNgn3NnykgGlYiAcecERmVWiIZFrmP2LZI3ml_Sh0,25010
2009
2009
  kim_tools/symmetry_util/data/primitive_GENPOS_ops.json,sha256=FDu4H4PosOpK9yKwOPy3SxbH7xLMOmZfKZ4ItKPMjoQ,224498
2010
2010
  kim_tools/symmetry_util/data/space_groups_for_each_bravais_lattice.json,sha256=wSNu6d5pH72lJ6Zj5MZ64qzwS_6Fn5WOs0ts7E9uPC4,2507
@@ -2015,8 +2015,8 @@ kim_tools/test_driver/__init__.py,sha256=KOiceeZNqkfrgZ66CiRiUdniceDrCmmDXQkOw0w
2015
2015
  kim_tools/test_driver/core.py,sha256=r4hiZcV-PkWcOo0uEqfqeP1-YGGpPepaAjmR4LJog0w,89208
2016
2016
  kim_tools/vc/__init__.py,sha256=zXjhxXCKVMLBMXXWYG3if7VOpBnsFrn_RjVpnohDm5c,74
2017
2017
  kim_tools/vc/core.py,sha256=BIjzEExnQAL2S90a_npptRm3ACqAo4fZBtvTDBMWMdw,13963
2018
- kim_tools-0.3.1.dist-info/licenses/LICENSE.CDDL,sha256=I2luEED_SHjuZ01B4rYG-AF_135amL24JpHvZ1Jhqe8,16373
2019
- kim_tools-0.3.1.dist-info/METADATA,sha256=scnOzhP0hy9JNn5NS6W9lSESU6G0PS2rPoCdkwIIVSE,1962
2020
- kim_tools-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
2021
- kim_tools-0.3.1.dist-info/top_level.txt,sha256=w_YCpJ5ERigj9te74ln7k64tqj1VumOzM_s9dsalIWY,10
2022
- kim_tools-0.3.1.dist-info/RECORD,,
2018
+ kim_tools-0.3.2.dist-info/licenses/LICENSE.CDDL,sha256=I2luEED_SHjuZ01B4rYG-AF_135amL24JpHvZ1Jhqe8,16373
2019
+ kim_tools-0.3.2.dist-info/METADATA,sha256=EAQFkPk6S0svLhGMBstoSj4Kk9vdzbIDATWefRyb8zE,1962
2020
+ kim_tools-0.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
2021
+ kim_tools-0.3.2.dist-info/top_level.txt,sha256=w_YCpJ5ERigj9te74ln7k64tqj1VumOzM_s9dsalIWY,10
2022
+ kim_tools-0.3.2.dist-info/RECORD,,