GEOS-DEV / GEOS-DEV/GEOS

[EPIC] Unit system

Open
#2,704 3 comments 0 reactions 1 assignee View on GitHub

@MelReyCG is already working on this.

Since Sep 22, 2023.

  • #2552 by @MelReyCG — merged
EPIC type: feature type: new
Dominant language
C++
Stars
287
Forks
109
Avg merge
4d 41m
Merged PRs (30d)
5

Description

Issue general information

What is the requested feature?

  • A unit system for GEOS.

Is your request related to a specific problem?

  1. Some data structures, as the TableFunction, hold data and does not know its unit, so related reports or error message can be misleading.
  2. GEOS users cannot specify which unit they want for the various input & output data.
  3. The code could be more self-explaining if variables could be declared as Pressure, Distance or Viscosity type rather than real64.
  4. There is a lack of information on the temperature units (Kelvin or Celsius) at different places in the code.

  • I. Add a simple unit system to GEOS so when we store unqualified data, we can add the wanted unit metadata to it.
  • GEOS PR that need this system: #2552
  • #3733
  • Attach unit info to inputs (Wrapper)
  • Attach unit info to HDF5 output as a metadata (as a data description)

  • II. Add a statically typed unit system.
  • We could add or inspire from a library like mp-units.
  • We need an extensive, simple and light solution, the goal is not to complexify the code nor to affect the performances.
  • We need to be able to statically or dynamically add an unit to a value or a container.

  • III. Expose a unit system configuration for GEOS input / output.
  • Add a <UnitSystem/> node to <Problem/>
  • Add a preset attribute to UnitSystem, which would allow to quickly use a unit system preset as a base. These preset would be documented in the user guide, and would be added by the different teams working on GEOS.
  • Add <UnitSystem/> children node for each characteristics.
    As an exemple : <Time inputFiles="years" stdout="days" outputFiles="s" />
    Or, as a more uniform exemple : <Time units="d" />

_Note: I'm not perfectly convinced that the task II. is required for GEOS, input / output conversion may be sufficient.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.