File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,8 @@ def _get_chemical_formulas(self) -> tuple[set[str], set[str]]:
461461 chemical_formulas : set [str ] = set ()
462462
463463 for sample in self ._sample_class_refs ["NXsample" ]:
464- if (atom_types := sample .get ("atom_types__field" )) is not None :
464+ if sample .get ("atom_types__field" ) is not None :
465+ atom_types = sample .atom_types__field
465466 if isinstance (atom_types , list ):
466467 for symbol in atom_types :
467468 if symbol in chemical_symbols [1 :]:
@@ -477,6 +478,10 @@ def _get_chemical_formulas(self) -> tuple[set[str], set[str]]:
477478 for symbol in atom_types .replace (" " , "" ).split ("," ):
478479 if symbol in chemical_symbols [1 :]:
479480 element_set .add (symbol )
481+ else :
482+ self ._logger .warn (
483+ f"Ignoring { symbol } as it is not for an element from the periodic table"
484+ )
480485 # given that the element list will be overwritten
481486 # in case a single chemical formula is found we do not add
482487 # a chemical formula here as this anyway be correct only
You can’t perform that action at this time.
0 commit comments