Skip to content

add vmm grid support#76

Merged
stijnvanhoey merged 42 commits intofluves:masterfrom
barisoztas:support-grid
Apr 8, 2026
Merged

add vmm grid support#76
stijnvanhoey merged 42 commits intofluves:masterfrom
barisoztas:support-grid

Conversation

@barisoztas
Copy link
Copy Markdown
Contributor

@barisoztas barisoztas commented Sep 13, 2025

Hi @stijnvanhoey , after our discussion on how to support for the raster data products, I could work on the remaining issues and now here we add support for:

  • KiWIS vmm grid api
  • requesting raster data as BytesIO
  • parsing the response as xarray.Dataset

Changes

  1. For pywaterinfo to support raster data, an extension for the Waterinfo.request_kiwis() method is made. Now, it is possible to pass return_bytesio: bool argument to optionally return raw binary data (via BytesIO), enabling support for file downloads and non-JSON responses from the grid API.
  2. To parse the raster response of request type getRasterTimeseriesValues as xarray Dataset, parse_waterinfo_hdf5() is added. (which I believe the module parser.py should also hold the specific json parsing logic for getTimeseriesValues, getTimeseriesValueLayer, getGroupList, getTimeseriesList request types)
  3. To support the new kiwis request type getRasterTimeseriesValues, Waterinfo.get_raster_timeseries_values() method is added

I really enjoyed implementing and exploring the data on a map. I hope you also enjoy reviewing and giving it a try 😃

closes #66 . However there are still room for improvements for VMM-Grid api (more request types are available such as GetRasterToPointValues, GetRasterFile)

@barisoztas barisoztas marked this pull request as draft September 13, 2025 11:26
@barisoztas barisoztas changed the title add vmm grid kiwis support add vmm grid support Sep 13, 2025
@barisoztas barisoztas marked this pull request as ready for review November 6, 2025 19:07
@stijnvanhoey stijnvanhoey self-requested a review December 1, 2025 12:21
Copy link
Copy Markdown
Contributor

@stijnvanhoey stijnvanhoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fitting it in the current implementation withou big refactorings.

I do have some comment, but should be easy to update.

Comment thread setup.cfg Outdated
Comment thread src/pywaterinfo/parser.py
Comment thread src/pywaterinfo/parser.py
Comment thread src/pywaterinfo/waterinfo.py Outdated
VMM_GRID_AUTH = "https://hydro.vmm.be/kiwis-auth/token"

# Provider registry for easier maintenance
PROVIDERS = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thanks. Also relevant for @TimFranken

Comment thread src/pywaterinfo/waterinfo.py Outdated
Comment thread src/pywaterinfo/waterinfo.py Outdated
Comment thread src/pywaterinfo/waterinfo.py
Comment thread tests/conftest.py Outdated
@stijnvanhoey stijnvanhoey mentioned this pull request Dec 1, 2025
@barisoztas
Copy link
Copy Markdown
Contributor Author

Thanks for the review @stijnvanhoey . I adjusted your comments, and provided a little bit more detail about the attributes of the hdf5-file. The PR is ready for review again.

Copy link
Copy Markdown
Contributor

@stijnvanhoey stijnvanhoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, with these adjustments I do think we are good to go

Comment thread src/pywaterinfo/waterinfo.py Outdated
"extra_deps": 1,
# True if extra dependencies are required for this provider.
# Add the dependencies to the setup.cfg under '[options.extras_require]'
"extra_deps": True,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good to have this feedback to the user

Copy link
Copy Markdown
Contributor

@stijnvanhoey stijnvanhoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still a depdency issue

Comment thread setup.cfg Outdated
@barisoztas
Copy link
Copy Markdown
Contributor Author

Still a depdency issue

now we hit to pytz issue also here in this PR -> https://github.com/fluves/pywaterinfo/actions/runs/24124066789/job/70384387893?pr=76

I propose we first merge #77 as we will remove pytz dependency which will hopefully solve also the issues in this PR

@barisoztas
Copy link
Copy Markdown
Contributor Author

I have also updated python versions of the CI pipelines for pypi deployment and documentation building (3.9 -> 3.11)

@barisoztas barisoztas requested a review from stijnvanhoey April 8, 2026 12:21
Copy link
Copy Markdown
Contributor

@stijnvanhoey stijnvanhoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update and adjustments, ready to merge!

@stijnvanhoey stijnvanhoey merged commit a1164ac into fluves:master Apr 8, 2026
7 of 8 checks passed
@barisoztas barisoztas deleted the support-grid branch April 8, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for the raster data products using the KiWIS grid api to pywaterinfo

2 participants