Skip to content

Variable "Registry" #3

@abukowski21

Description

@abukowski21

[FEAT]: Create a csv file with all the possible variable info

Problem

Models may write variables with different names. Some file types include metadata about units, long_name, etc. and some do not. The code often needs a variable name (e- density -> TEC, for example) which can cause inconsistencies

Proposed Solution

A csv file to define the mapping from every supported model to the pyitm internal "shortname".

Details

  • csv file is read when needed and cached (to prevent it reading over and over again)
  • Columns are (using vertical ion drifts for example):
    • shortname (Viv): the 'common name' that we use to access the data (o+,
    • longname (Ion Vertical Velocity): name used for plotting
    • unit (m/s): shown for plotting
    • prettyname (V_{v;i} -> $V_{v;i}$): LaTeX render-able name for stylish plots
    • modelname (Vi(up), velocity_up_ion): a list of the possible mappings to this variable. Can be any length!

Should be compatible with everything existing

More details

  • csv file can contain comments and a long descriptor, reading starts after #START and lines beginning with # aren't parsed
  • If the modelname contains a comma, use a ; and the code will know to convert it to , (to ensure the csv is comma separated)
  • units, prettyname are optional.
  • shortname, longname, *modelnames all index the same row of the CSV file. So units can be fetched using anything!
    • This means they all need to be identical

This is basically done, but I'm writing an issue for it so I have something to reference in the PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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