eWaterCycle / eWaterCycle/ewatercycle

(minor) bug report: Incorrect line numbers in GRDC metadata reader

Open
#480 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
41
Forks
6
Avg merge
8d 23h
Merged PRs (30d)
2

Description

In `def _grdc_metadata_reader` the line numbers used to extract metadata from .txt are off by one:

https://github.com/eWaterCycle/ewatercycle/blob/ce0099673757ece2f3026c841290312ec9323185/src/ewatercycle/observation/grdc.py#L354-L361

- `dataSetContent` is currently read from index 20, but should be 21 to read line 22 in the .txt
- `units` is currently read from index 22, but should be 23 to read line 24 in the .txt

Additionally, the "units" attribute is not currently used, units are currently hardcoded in the description when creating the xarray object

Proposed fix:

- Update the indices to 21 and 23.
- Optionally remove or repurpose the unused "units" attribute to avoid confusion.

PS: As mentioned to @RolfHut, I’m currently working on extending the GRDC station reader to also handle stations with monthly data instead of daily. I could bundle these bugfixes with that, if preferred.

Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.