NREL / GEOPHIRES-X

MIT License
26 stars 21 forks source link

Integrate enum values in tooltip text & schema [v3.4.41] #246

Closed softwareengineerprogrammer closed 5 days ago

softwareengineerprogrammer commented 6 days ago
  1. Consolidates enum parameter parsing into the corresponding enums
  2. Generate enum parameter tooltips programmatically from enum options instead of hardcoding
  3. Explicitly define int value per member in a non-order-dependent way
  4. Add enum_values field to generated schema. Note that I didn't use OpenAPI enum spec (https://swagger.io/docs/specification/data-models/enums/) due to the need to tightly couple enum metadata values. If desired, standard enum field could be generated in addition (though would be more fragile/complicated for clients to parse)
  5. Addresses https://github.com/NREL/GEOPHIRES-X/issues/245
  6. Includes unit tests covering some subtle changes in parsing/comparison of enums.
  7. Change is fully backwards compatible for inputs (note only change to example files is comment typo fix in Wanju example)
  8. Output Total Avoided Carbon Emissions in tonnes instead of metric tonnes for brevity and consistency; also fixes result parsing of units as a side effect since tonnes doesn't have a space in it

Enables UI to render enum params as dropdowns:

Screenshot 2024-06-26 at 11 07 15

image

Initially self-reviewed in https://github.com/softwareengineerprogrammer/GEOPHIRES-X/pull/29

kfbeckers commented 5 days ago

Looks great!