I am wondering it might be better to replace species = set(map(_element_str, struct.species)) by species = list(dict.fromkeys(map(_element_str, struct.species))). This can avoid the unordered nature of set and help uniquely bookkeeping the defects together with defect_index. This could help database query.
I am wondering it might be better to replace
species = set(map(_element_str, struct.species))
byspecies = list(dict.fromkeys(map(_element_str, struct.species)))
. This can avoid the unordered nature ofset
and help uniquely bookkeeping the defects together withdefect_index
. This could help database query.