@@ -408,67 +408,76 @@ def test_nsc2(self, setup):
408408 assert len (lattice .sc_off ) == np .prod (lattice .nsc )
409409
410410 def test_rotation1 (self , setup ):
411- rot = setup .g .rotate (180 , [0 , 0 , 1 ], what = "xyz+abc" )
411+ rot = setup .g .rotate ([ 180 , [0 , 0 , 1 ] ], what = "xyz+abc" )
412412 rot .lattice .cell [2 , 2 ] *= - 1
413413 assert np .allclose (- rot .lattice .cell , setup .g .lattice .cell )
414414 assert np .allclose (- rot .xyz , setup .g .xyz )
415415
416- rot = setup .g .rotate (np .pi , [0 , 0 , 1 ], rad = True , what = "xyz+abc" )
416+ rot = setup .g .rotate ([ np .pi , [0 , 0 , 1 ] ], rad = True , what = "xyz+abc" )
417417 rot .lattice .cell [2 , 2 ] *= - 1
418418 assert np .allclose (- rot .lattice .cell , setup .g .lattice .cell )
419419 assert np .allclose (- rot .xyz , setup .g .xyz )
420420
421- rot = rot .rotate (180 , "z" , what = "xyz+abc" )
421+ rot = rot .rotate ([ 180 , "z" ] , what = "xyz+abc" )
422422 rot .lattice .cell [2 , 2 ] *= - 1
423423 assert np .allclose (rot .lattice .cell , setup .g .lattice .cell )
424424 assert np .allclose (rot .xyz , setup .g .xyz )
425425
426+ # Just check it runs,
427+ # xy-plane == z-direction
428+ rot = setup .g .rotate ([180 , "xy" ], what = "xyz+abc" )
429+ rot .lattice .cell [2 , 2 ] *= - 1
430+ assert np .allclose (- rot .lattice .cell , setup .g .lattice .cell )
431+ assert np .allclose (- rot .xyz , setup .g .xyz )
432+
433+ rot .rotate ([180 , "x+y" ], what = "xyz+abc" )
434+
426435 def test_rotation2 (self , setup ):
427- rot = setup .g .rotate (180 , "z" , what = "abc" )
436+ rot = setup .g .rotate ([ 180 , "z" ] , what = "abc" )
428437 rot .lattice .cell [2 , 2 ] *= - 1
429438 assert np .allclose (- rot .lattice .cell , setup .g .lattice .cell )
430439 assert np .allclose (rot .xyz , setup .g .xyz )
431440
432- rot = setup .g .rotate (np .pi , [0 , 0 , 1 ], rad = True , what = "abc" )
441+ rot = setup .g .rotate ([ np .pi , [0 , 0 , 1 ] ], rad = True , what = "abc" )
433442 rot .lattice .cell [2 , 2 ] *= - 1
434443 assert np .allclose (- rot .lattice .cell , setup .g .lattice .cell )
435444 assert np .allclose (rot .xyz , setup .g .xyz )
436445
437- rot = rot .rotate (180 , [0 , 0 , 1 ], what = "abc" )
446+ rot = rot .rotate ([ 180 , [0 , 0 , 1 ] ], what = "abc" )
438447 rot .lattice .cell [2 , 2 ] *= - 1
439448 assert np .allclose (rot .lattice .cell , setup .g .lattice .cell )
440449 assert np .allclose (rot .xyz , setup .g .xyz )
441450
442451 def test_rotation3 (self , setup ):
443- rot = setup .g .rotate (180 , [0 , 0 , 1 ], what = "xyz" )
452+ rot = setup .g .rotate ([ 180 , [0 , 0 , 1 ] ], what = "xyz" )
444453 assert np .allclose (rot .lattice .cell , setup .g .lattice .cell )
445454 assert np .allclose (- rot .xyz , setup .g .xyz )
446455
447- rot = setup .g .rotate (np .pi , [0 , 0 , 1 ], rad = True , what = "xyz" )
456+ rot = setup .g .rotate ([ np .pi , [0 , 0 , 1 ] ], rad = True , what = "xyz" )
448457 assert np .allclose (rot .lattice .cell , setup .g .lattice .cell )
449458 assert np .allclose (- rot .xyz , setup .g .xyz )
450459
451- rot = rot .rotate (180 , "z" , what = "xyz" )
460+ rot = rot .rotate ([ 180 , "z" ] , what = "xyz" )
452461 assert np .allclose (rot .lattice .cell , setup .g .lattice .cell )
453462 assert np .allclose (rot .xyz , setup .g .xyz )
454463
455464 def test_rotation4 (self , setup ):
456465 ref = setup .g .tile (2 , 0 ).tile (2 , 1 )
457466
458- rot = ref .rotate (10 , "z" , atoms = 1 )
467+ rot = ref .rotate ([ 10 , "z" ] , atoms = 1 )
459468 assert not np .allclose (ref .xyz [1 ], rot .xyz [1 ])
460469
461- rot = ref .rotate (10 , "z" , atoms = [1 , 2 ])
470+ rot = ref .rotate ([ 10 , "z" ] , atoms = [1 , 2 ])
462471 assert not np .allclose (ref .xyz [1 ], rot .xyz [1 ])
463472 assert not np .allclose (ref .xyz [2 ], rot .xyz [2 ])
464473 assert np .allclose (ref .xyz [3 ], rot .xyz [3 ])
465474
466- rot = ref .rotate (10 , "z" , atoms = [1 , 2 ], what = "y" )
475+ rot = ref .rotate ([ 10 , "z" ] , atoms = [1 , 2 ], what = "y" )
467476 assert ref .xyz [1 , 0 ] == rot .xyz [1 , 0 ]
468477 assert ref .xyz [1 , 1 ] != rot .xyz [1 , 1 ]
469478 assert ref .xyz [1 , 2 ] == rot .xyz [1 , 2 ]
470479
471- rot = ref .rotate (10 , "z" , atoms = [1 , 2 ], what = "xy" , origin = ref .xyz [2 ])
480+ rot = ref .rotate ([ 10 , "z" ] , atoms = [1 , 2 ], what = "xy" , origin = ref .xyz [2 ])
472481 assert ref .xyz [1 , 0 ] != rot .xyz [1 , 0 ]
473482 assert ref .xyz [1 , 1 ] != rot .xyz [1 , 1 ]
474483 assert ref .xyz [1 , 2 ] == rot .xyz [1 , 2 ]
@@ -669,8 +678,8 @@ def test___add1__(self, setup):
669678 assert np .allclose (double .xyz , d .xyz )
670679
671680 def test___add2__ (self , setup ):
672- g1 = setup .g .rotate (15 , setup .g .cell [2 , :])
673- g2 = setup .g .rotate (30 , setup .g .cell [2 , :])
681+ g1 = setup .g .rotate ([ 15 , setup .g .cell [2 , :] ])
682+ g2 = setup .g .rotate ([ 30 , setup .g .cell [2 , :] ])
674683
675684 assert g1 != g2
676685 assert g1 + g2 == g1 .add (g2 )
@@ -1559,11 +1568,11 @@ def test_geometry_dispatch(self):
15591568 gr = sisl_geom .graphene ()
15601569 to_ase = gr .to .ase ()
15611570
1562- ase_rotate = si .rotate (to_ase , 30 , [0 , 0 , 1 ])
1571+ ase_rotate = si .rotate (to_ase , [ 30 , [0 , 0 , 1 ] ])
15631572 assert isinstance (ase_rotate , type (to_ase ))
1564- ase_sisl_rotate = si .rotate (to_ase , 30 , [0 , 0 , 1 ], ret_sisl = True )
1573+ ase_sisl_rotate = si .rotate (to_ase , [ 30 , [0 , 0 , 1 ] ], ret_sisl = True )
15651574 assert isinstance (ase_sisl_rotate , Geometry )
1566- geom_rotate = si .rotate (gr , 30 , [0 , 0 , 1 ])
1575+ geom_rotate = si .rotate (gr , [ 30 , [0 , 0 , 1 ] ])
15671576
15681577 assert geom_rotate .equal (ase_sisl_rotate , R = False )
15691578
0 commit comments