HydrologicEngineeringCenter / HydrologicEngineeringCenter/cwms-python
rate_values default time
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 16
- Forks
- 11
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 8
Description
As shown below, the documentation in ratings.py states that if times are not specified, the current time is used. However, in my experience, the latest rating curve is not being used when I leave the time out. I had to specify a time to get it to use the latest rating.
Not a big deal to add the time (probably best to always do so anyway). I just wanted to make note of this.
Parameters
----------
rating_id: string
The rating-id (rating specification) of the the rating set to use
office_id: string
The owning office of the rating set.
units: string
The unit of each independent parameter separated by commas concatenated with a semicolon followed by the
desired dependent_parameter unit (e.g., 'ft;ac-ft' or 'unit,%,ft;cfs')
values: list[list[float]]
The independent parameter values to rate (one list for each independent parameter, in parameter order).
For multiple independent parameters, each list must be of the same length.
times: list[integer] Optional Default = None
A list of times (in milliseconds since 1970-01-01T00:00:00Z) for the independent parameter values.
If None, the current time is used.
If specified but the constains fewer times than the number of independent parameter values, the last
time is used for all independent parameter values from that position to the end of the list.
rating_time: integer Optional Default = None
A specific date/time to use as the "current time" of the rating. No ratings with a create date later than
this will be used. Useful for performing historical ratings. If not specified or NULL, the current time is used.
round: boolean Optional Default = False
Whether to round the rated values according to the rounding spec contained in the rating specification in the database
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ratings.py at rate_values and compare the documented behavior when times is omitted with the behavior when an explicit time is supplied. Reproduce the latest-rating case using both calls, then verify that the implementation and documentation agree about the time used for selecting ratings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100