Several unit strings used in the literature metadata do not parse with astropy, which the website (and unitpackage's quantity) rely on, and have no direct astropy-compatible spelling:
| Unit |
Occurrences |
Used for |
volume percent |
92 |
e.g. electrolyte compositions |
ppb |
21 |
impurities, water quality |
ppm |
11 |
gas/impurity concentrations |
All other unit spelling issues (M, mol L⁻¹, degC, percent, MΩ cm, cm², uA cm-2, ...) have been normalized to astropy-parseable spellings on the branch fix-concentration-units.
The remaining units currently do not break the website build because the templates only call .quantity on concentrations of acid/base/alkaline/salt components. Any future template or API use that touches these fields will fail like the M unit did.
Possible directions:
- register custom units (e.g.
astropy.units.def_unit) centrally in unitpackage so ppm, ppb and volume percent parse everywhere,
- convert them in the data to astropy-parseable equivalents (e.g.
umol / mol for ppm — though this changes the familiar notation),
- add a CI validation to this repository that every
unit: string in literature/ parses with astropy, so unsupported units are caught in data PRs rather than at website build time.
Related observation:
briega-martos_2021_cation_48: the HClO4 component has a concentration with unit: mol / l but no value (needs to be looked up in the paper).
Several unit strings used in the literature metadata do not parse with astropy, which the website (and unitpackage's
quantity) rely on, and have no direct astropy-compatible spelling:volume percentppbppmAll other unit spelling issues (
M,mol L⁻¹,degC,percent,MΩ cm,cm²,uA cm-2, ...) have been normalized to astropy-parseable spellings on the branchfix-concentration-units.The remaining units currently do not break the website build because the templates only call
.quantityon concentrations of acid/base/alkaline/salt components. Any future template or API use that touches these fields will fail like theMunit did.Possible directions:
astropy.units.def_unit) centrally in unitpackage soppm,ppbandvolume percentparse everywhere,umol / molfor ppm — though this changes the familiar notation),unit:string inliterature/parses with astropy, so unsupported units are caught in data PRs rather than at website build time.Related observation:
briega-martos_2021_cation_48: the HClO4 component has a concentration withunit: mol / lbut novalue(needs to be looked up in the paper).