[Project Proposal]: UDUNITS javascript library
Opened this issue · 6 comments
Project Description
This project would explore and pursue ways of offering UDUNITS functionality to front end applications. Depending on expertise and interest, a few methods could be looked at:
- Ingest UDUNITS xml config files and create typescript application that replicates existing UDUNITS functionality. Could be deployed on front or back end
- Extend existing typescript units library so that UDUNITS codes can be used for file conversion. Candidate libraries include: convert-units and js-quantities.
- Compile existing library to web assembly and create helper methods. Note: wouldn’t
Expected Outcomes
A typescript library that can be included in an existing project using npm-install
that would allow client side or server side on the fly conversion between units using udunit codes as unit identifiers.
Should include:
- Proof of concept application that demonstrates conversions
- Tests that can be run against different cases
- Helper methods for getting/setting display labels
- Possible inclusion within ERDDAP mobile app
Skills required
Any of:
- Knowledge about UDUNITS, including compiling code; ideally someone that understands how configs are put together and is capable of compiling/running existing UDUNITS application
- Experience or keen interest in creating web assembly from C
- Typescript/Javascript
Expertise
Intermediate
Topic Lead(s)
akbstone
Relevant links
- UDUNITS Documentation https://docs.unidata.ucar.edu/udunits/current/#Database
- UDUNITS XML configs: https://docs.unidata.ucar.edu/udunits/current/#Database
- Existing libraries:
- MDN: Compiling an existing C module to web assembly
We've built on top of convert-units
for the NERACOOS Mariner's Dashboard. We weren't trying to match UDUNITS, but we'd be willing to upstream any of it's code that is useful to others.
BTW, in the Python world, it is quite hard to depend on anything related to the udunits2 library and/or any effort to re-write it exactly was abandoned. The most successful MetOcean library that requires units, metpy, uses pint.
TL;DR it may be easier to just reuse something that has the basic units than pursing the ideal 100% unit support in udunits.
Could there be some overlap here with #33? The focus there is on CF standard names but I can imagine a combined library with front end components for CF, UDUNITS, GCMD keywords, NERC, etc.
@akbstone, @iwensu0313 For this year's Code Sprint, there wasn't a lot of interest in this topic. If it is something you'd still like to pursue during the event, does someone want to take the lead on this topic? If so, please identify who that lead will be. Will this be a topic to execute during the sprint or somewhere else?
Expectations for topic leads: Leads are expected to identify a plan for the code sprint topic, establish a team, and take the lead on executing said plan.
For more information on how topics will be selected see the contributing guide
Otherwise, let's mark it as wont fix 2024
and come back to it later.
@MathewBiddle - we can mark it as wont fix 2024
for this round. Thanks for checking in
Thanks @iwensu0313. We can always pivot day of.