Skip to content

Commit 9fc12fd

Browse files
committed
Fix NoneType error for QbC without excluded triples or pairs
1 parent 5bc77b1 commit 9fc12fd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

aml/acsf.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ def format_ACSFs_radial(
188188
lines.append(f'#\n# Radial symmetry functions for {element1:s}\n#\n')
189189
for element2 in elements:
190190
comment = f'# {element1:s} - {element2:s}'
191-
if any(cmp_same_count([element1, element2], exc) for exc in exclude_pairs):
192-
lines.append(comment + ': excluded')
193-
continue
191+
if (exclude_pairs is not None):
192+
if any(cmp_same_count([element1, element2], exc) for exc in exclude_pairs):
193+
lines.append(comment + ': excluded')
194+
continue
194195
lines.extend([
195196
comment,
196197
format_ACSFs_radial_single(radials[(element1, element2)], element1, element2),
@@ -264,9 +265,10 @@ def format_ACSFs_angular(
264265
if ie3 < ie2:
265266
continue
266267
comment = f'# {element1:s} - {element2:s}-{element3:s}'
267-
if any(cmp_same_count([element1, element2, element3], exc) for exc in exclude_triples):
268-
lines.append(comment + ': excluded')
269-
continue
268+
if (exclude_triples is not None):
269+
if any(cmp_same_count([element1, element2, element3], exc) for exc in exclude_triples):
270+
lines.append(comment + ': excluded')
271+
continue
270272
lines.extend([
271273
comment,
272274
format_ACSFs_angular_single(angulars[(element1, element2, element3)], element1, element2, element3),

0 commit comments

Comments
 (0)