MeteoSwiss / MeteoSwiss/fdb-utils

"fdb-utils list" returns 0.0 instead of 0 for levelist

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

See the difference in outputs:
```console
$ fdb-axes param=500166,class=od,expver=0001
IndexAxis[(...),levelist=(0,0.005,0.01,0.02,0.03,0.06,0.09,0.1,0.18,0.27,0.54,0.81,1.62,14.58,2.43,4.86,7.29),(...)]
```
```
$ fdb-utils list --filter param=500166
(...)
levelist: [0.0, 0.005, 0.02, 0.06, 0.18, 0.54, 1.62, 4.86, 14.58]
(...)
```

This is relevant since the index stored in fdb is actually `0` and not `0.0`. When requesting through polytope with feature extraction, `levelist=[0.0]` does **not** work, it must be `levelist=[0]`. Although for some reason, with a full-field request also `0.0` works.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reproducing the discrepancy with `fdb-utils list --filter param=500166` and compare it with the stored values shown by `fdb-axes`. Trace the list command's levelist formatting and its existing tests, if any. Done means integer-valued levels are displayed as `0` rather than `0.0` while decimal levels retain their precision, with regression coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.