Closed ppinard closed 7 years ago
I would modify the above procedure.
First, I think it is better to use the Standard Atomic Weight
field to retrieve the atomic weight. Secondly, since the parser strategy has changed (see #4), a parser should be created for the NIST database in pyxray/parser/nist.py and should return ElementAtomicWeight objects.
The commit f73c35ebdc2a46b9a736b6c982f0ec8f05cdd547 looks very good. I modified some small syntax issues in commit b2f214240b1dfb347a4b51fad5ea406c9fd8388c:
ATOMIC_WEIGHTS
to atomic_weights
Finally, I activated caching in commit cf011617305b0193dbb2e5479d533f5e21cac43e and added a unit test in 51f70bd687895ebb6794b2d7024637f9253b38d2.
Unless @fingenerf sees other issues, I would close this issue.
Referring to issue #2, this issue is to populate the SQL database with atomic weight. Ideally, this should be done automatically from an available online resource.
The most official tabulation of atomic weight appears to come from the CIAAW. Unfortunately, their website does not directly provide an ASCII table of the values. NIST has an online database of atomic weight and isotopes which can be generated as an ASCII file (website, results). The information appears to come from the CIAAW/IUPAC.
The goal would therefore to write a parser to extract the atomic weight from the NIST output. I would proceed as follows:
requests
to download the NIST ASCII outputAtomic Number
,Relative Atomic Mass
andIsotopic Composition
ElementAtomicWeightProperty
model (seepopulate_element_symbol_table(engine)
in pyxray/sql/default.py as an example)The code should go in a new function
populate_element_atomic_weight_table_(engine)
in pyxray/sql/default.py.