MeteoSwiss / MeteoSwiss/dvas

Allow for flexible time units by accessing prm_unit from Profile

Open
#194 0 comments 0 reactions 0 assignees View on GitHub
enhancement wontfix
Dominant language
Python
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

**Describe the change**
At the moment, the code assumes that time deltas are provided in 's'. This is directly related to the fact the ``prm_unit`` set in the ``parameter_config.yml`` file is NOT accessible at the level of the ``Profile`` class, but only from the ``MultiProfile`` class.

To allow more flexibility on the input type, we would need to fix this.

But for now, we'll simply force the user to use 's' as the unit of time. This is not too bad a restriction, since users can use the ``get(..)`` functions to adjust the input values (e.g. min, hours, etc ...) as required.

For the record, the missing connection is located in `src.dvas.data.strategy.data.py` on l.256 (search for ``#194``).
There is also a check made in `src.dvas.database.model.py` in ``check_unit``, to make sure the use of another time unit by the user does not go un-noticed.

Contributor guide

Open the contributing guide

Research direction

Start by reading the #194 location around line 256 in src.dvas.data.strategy.data.py, then inspect check_unit in src.dvas.database.model.py and the prm_unit setting in parameter_config.yml. Determine how Profile currently differs from MultiProfile. Done means the requested time-unit handling is supported or its restriction is consistently enforced and checked.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.