Skip to content
This repository was archived by the owner on Jan 4, 2024. It is now read-only.
This repository was archived by the owner on Jan 4, 2024. It is now read-only.

Move unit definitions to database #64

@mactyr

Description

@mactyr

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

  1. 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.
  2. Remove unit_defs.txt
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions