File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,14 @@ def iter(
9696 dict[str, StatItem]
9797 The statistics of the environment matrix.
9898 """
99+ if self .last_dim == 4 :
100+ radial_only = False
101+ elif self .last_dim == 1 :
102+ radial_only = True
103+ else :
104+ raise ValueError (
105+ "last_dim should be 1 for raial-only or 4 for full descriptor."
106+ )
99107 if len (data ) == 0 :
100108 # workaround to fix IndexError: list index out of range
101109 yield from ()
@@ -119,14 +127,6 @@ def iter(
119127 dtype = get_xp_precision (xp , "global" ),
120128 device = array_api_compat .device (data [0 ]["coord" ]),
121129 )
122- if self .last_dim == 4 :
123- radial_only = False
124- elif self .last_dim == 1 :
125- radial_only = True
126- else :
127- raise ValueError (
128- "last_dim should be 1 for raial-only or 4 for full descriptor."
129- )
130130 for system in data :
131131 coord , atype , box , natoms = (
132132 system ["coord" ],
You can’t perform that action at this time.
0 commit comments