4
4
from crystal_toolkit .core .scene import Cylinders , Scene
5
5
6
6
7
- def _get_extras_cross_boundary (one_hop , only_wi_structure ):
7
+ def _get_extras_cross_boundary (self , one_hop , only_wi_structure ):
8
8
extras = []
9
9
working_struct = only_wi_structure .copy ()
10
10
wi = working_struct [0 ].specie .name
@@ -14,7 +14,8 @@ def _get_extras_cross_boundary(one_hop, only_wi_structure):
14
14
working_struct .insert (0 , wi , one_hop ["epos" ])
15
15
shifted_ipos = one_hop ["ipos" ] - np .array (one_hop ["to_jimage" ])
16
16
working_struct .insert (0 , wi , shifted_ipos )
17
- extras .extend ([working_struct [0 ].get_scene (), working_struct [1 ].get_scene ()])
17
+ sites_contents = [working_struct [0 ].get_scene (), working_struct [1 ].get_scene ()]
18
+ extras .extend (sites_contents )
18
19
19
20
# extra cylinders
20
21
extra_ipos = list (working_struct [0 ].coords )
@@ -55,7 +56,9 @@ def get_migrationgraph_scene(
55
56
one_hop_contents .append (hop_cyl )
56
57
57
58
if one_hop ["to_jimage" ] != (0 , 0 , 0 ):
58
- extras_cross_boundary = _get_extras_cross_boundary (one_hop , self .only_sites )
59
+ extras_cross_boundary = self ._get_extras_cross_boundary (
60
+ one_hop , self .only_sites
61
+ )
59
62
one_hop_contents .extend (extras_cross_boundary )
60
63
61
64
one_hop_scene = Scene (name = f"hop_{ k } " , contents = one_hop_contents )
@@ -69,4 +72,5 @@ def get_migrationgraph_scene(
69
72
return result_scene
70
73
71
74
75
+ MigrationGraph ._get_extras_cross_boundary = _get_extras_cross_boundary
72
76
MigrationGraph .get_scene = get_migrationgraph_scene
0 commit comments