@@ -340,85 +340,21 @@ def test_get_conventional_standard_structure(self):
340
340
assert conv .site_properties .get ("magmom" ) is None
341
341
342
342
def test_get_primitive_standard_structure (self ):
343
- structure = Structure .from_file (f"{ TEST_FILES_DIR } /bcc_1927.cif" )
344
- spga = SpacegroupAnalyzer (structure , symprec = 1e-2 )
345
- prim = spga .get_primitive_standard_structure ()
346
- assert prim .lattice .alpha == approx (109.47122063400001 )
347
- assert prim .lattice .beta == approx (109.47122063400001 )
348
- assert prim .lattice .gamma == approx (109.47122063400001 )
349
- assert prim .lattice .a == approx (7.9657251015812145 )
350
- assert prim .lattice .b == approx (7.9657251015812145 )
351
- assert prim .lattice .c == approx (7.9657251015812145 )
352
-
353
- structure = Structure .from_file (f"{ TEST_FILES_DIR } /btet_1915.cif" )
354
- spga = SpacegroupAnalyzer (structure , symprec = 1e-2 )
355
- prim = spga .get_primitive_standard_structure ()
356
- assert prim .lattice .alpha == approx (105.015053349 )
357
- assert prim .lattice .beta == approx (105.015053349 )
358
- assert prim .lattice .gamma == approx (118.80658411899999 )
359
- assert prim .lattice .a == approx (4.1579321075608791 )
360
- assert prim .lattice .b == approx (4.1579321075608791 )
361
- assert prim .lattice .c == approx (4.1579321075608791 )
362
-
363
- structure = Structure .from_file (f"{ TEST_FILES_DIR } /orci_1010.cif" )
364
- spga = SpacegroupAnalyzer (structure , symprec = 1e-2 )
365
- prim = spga .get_primitive_standard_structure ()
366
- assert prim .lattice .alpha == approx (134.78923546600001 )
367
- assert prim .lattice .beta == approx (105.856239333 )
368
- assert prim .lattice .gamma == approx (91.276341676000001 )
369
- assert prim .lattice .a == approx (3.8428217771014852 )
370
- assert prim .lattice .b == approx (3.8428217771014852 )
371
- assert prim .lattice .c == approx (3.8428217771014852 )
372
-
373
- structure = Structure .from_file (f"{ TEST_FILES_DIR } /orcc_1003.cif" )
374
- spga = SpacegroupAnalyzer (structure , symprec = 1e-2 )
375
- prim = spga .get_primitive_standard_structure ()
376
- assert prim .lattice .alpha == approx (90 )
377
- assert prim .lattice .beta == approx (90 )
378
- assert prim .lattice .gamma == approx (164.985257335 )
379
- assert prim .lattice .a == approx (15.854897098324196 )
380
- assert prim .lattice .b == approx (15.854897098324196 )
381
- assert prim .lattice .c == approx (3.99648651 )
382
-
383
- structure = Structure .from_file (f"{ TEST_FILES_DIR } /orac_632475.cif" )
384
- spga = SpacegroupAnalyzer (structure , symprec = 1e-2 )
385
- prim = spga .get_primitive_standard_structure ()
386
- assert prim .lattice .alpha == approx (90 )
387
- assert prim .lattice .beta == approx (90 )
388
- assert prim .lattice .gamma == approx (144.40557588533386 )
389
- assert prim .lattice .a == approx (5.2005185662155391 )
390
- assert prim .lattice .b == approx (5.2005185662155391 )
391
- assert prim .lattice .c == approx (3.5372412099999999 )
392
-
393
- structure = Structure .from_file (f"{ TEST_FILES_DIR } /monoc_1028.cif" )
394
- spga = SpacegroupAnalyzer (structure , symprec = 1e-2 )
395
- prim = spga .get_primitive_standard_structure ()
396
- assert prim .lattice .alpha == approx (63.579155761999999 )
397
- assert prim .lattice .beta == approx (116.42084423747779 )
398
- assert prim .lattice .gamma == approx (148.47965136208569 )
399
- assert prim .lattice .a == approx (7.2908007159612325 )
400
- assert prim .lattice .b == approx (7.2908007159612325 )
401
- assert prim .lattice .c == approx (6.8743926325200002 )
402
-
403
- structure = Structure .from_file (f"{ TEST_FILES_DIR } /hex_1170.cif" )
404
- spga = SpacegroupAnalyzer (structure , symprec = 1e-2 )
405
- prim = spga .get_primitive_standard_structure ()
406
- assert prim .lattice .alpha == approx (90 )
407
- assert prim .lattice .beta == approx (90 )
408
- assert prim .lattice .gamma == approx (120 )
409
- assert prim .lattice .a == approx (3.699919902005897 )
410
- assert prim .lattice .b == approx (3.699919902005897 )
411
- assert prim .lattice .c == approx (6.9779585500000003 )
412
-
413
- structure = Structure .from_file (f"{ TEST_FILES_DIR } /rhomb_3478_conv.cif" )
414
- spga = SpacegroupAnalyzer (structure , symprec = 1e-2 )
415
- prim = spga .get_primitive_standard_structure ()
416
- assert prim .lattice .alpha == approx (28.049186140546812 )
417
- assert prim .lattice .beta == approx (28.049186140546812 )
418
- assert prim .lattice .gamma == approx (28.049186140546812 )
419
- assert prim .lattice .a == approx (5.9352627428399982 )
420
- assert prim .lattice .b == approx (5.9352627428399982 )
421
- assert prim .lattice .c == approx (5.9352627428399982 )
343
+ for file_name , expected_angles , expected_abc in [
344
+ ("bcc_1927.cif" , [109.47122063400001 ] * 3 , [7.9657251015812145 ] * 3 ),
345
+ ("btet_1915.cif" , [105.015053349 , 105.015053349 , 118.80658411899999 ], [4.1579321075608791 ] * 3 ),
346
+ ("orci_1010.cif" , [134.78923546600001 , 105.856239333 , 91.276341676000001 ], [3.8428217771014852 ] * 3 ),
347
+ ("orcc_1003.cif" , [90 , 90 , 164.985257335 ], [15.854897098324196 , 15.854897098324196 , 3.99648651 ]),
348
+ ("orac_632475.cif" , [90 , 90 , 144.40557588533386 ], [5.2005185662 , 5.20051856621 , 3.53724120999 ]),
349
+ ("monoc_1028.cif" , [63.579155761 , 116.420844 , 148.479651 ], [7.2908007159 , 7.29080071 , 6.87439263 ]),
350
+ ("hex_1170.cif" , [90 , 90 , 120 ], [3.699919902005897 , 3.699919902005897 , 6.9779585500000003 ]),
351
+ ("rhomb_3478_conv.cif" , [28.0491861 , 28.049186140 , 28.049186140 ], [5.93526274 , 5.9352627428 , 5.9352627428 ]),
352
+ ]:
353
+ structure = Structure .from_file (f"{ TEST_FILES_DIR } /{ file_name } " )
354
+ spga = SpacegroupAnalyzer (structure , symprec = 1e-2 )
355
+ prim = spga .get_primitive_standard_structure ()
356
+ assert prim .lattice .angles == approx (expected_angles )
357
+ assert prim .lattice .abc == approx (expected_abc )
422
358
423
359
structure = Structure .from_file (f"{ TEST_FILES_DIR } /rhomb_3478_conv.cif" )
424
360
structure .add_site_property ("magmom" , [1.0 ] * len (structure ))
0 commit comments