sparks-baird / CrabNet

Predict materials properties using only the composition information!
https://crabnet.readthedocs.io/
MIT License
15 stars 5 forks source link

changed get_sym_dict() to handle scientific notation in chemical formula #77

Open kyledmiller opened 2 months ago

kyledmiller commented 2 months ago

changed get_sym_dict() to handle scientific notation in chemical formulae (e.g. the S amount in Nb O1.9 S1e-1) Addresses #43

kyledmiller commented 2 months ago

Some very primitive testing

from crabnet.utils.composition import get_sym_dict
print(get_sym_dict('XFO2e-04Xasdf11', 2))
print(get_sym_dict('Xaaaae+03', -1))
print(get_sym_dict('Xaaaa1e+0090', 1))
print(get_sym_dict('', 1))