EnergyPATHWAYS model is a professional, open-source energy and carbon planning tool for use in evaluating long-term, economy-wide greenhouse gas mitigation scenarios.
As a pathways developer-user
I want my custom unit definitions to be part of my database
so that when I want to share my model, I just need to move one database dump around, rather than having to remember to send my custom unit definition file separately.
AC
Move unit definitions into a new table / SQLAlchemy model (probably just a two-column table with unit name and definition, though it looks like pint also allows for unit aliases so we may want a third column for that). Enforce uniqueness and not-null constraints where possible.
Remove unit_defs.txt
Update readme.md as necessary to remove references to unit_defs.txt
Notes
This work should be done on the data_access branch so the SQLAlchemy infrastructure is available.
We are currently loading unit definitions using pint's UnitRegistry.load_definitions(), which expects a text file. However, it looks like we could easily loop through a database table and create the units one at a time instead.
As a pathways developer-user I want my custom unit definitions to be part of my database so that when I want to share my model, I just need to move one database dump around, rather than having to remember to send my custom unit definition file separately.
AC
Notes
This work should be done on the data_access branch so the SQLAlchemy infrastructure is available.
We are currently loading unit definitions using pint's UnitRegistry.load_definitions(), which expects a text file. However, it looks like we could easily loop through a database table and create the units one at a time instead.