Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primod's basin mapping can't deal with integer basin id's with latest Rasterio dependecy #333

Open
HendrikKok opened this issue Oct 2, 2024 · 2 comments
Labels
bug Something isn't working dependencies Pull requests that update a dependency file

Comments

@HendrikKok
Copy link
Contributor

problem: imod.prepare.rasterize results in a crash if node_id is an integer and fill-value is the default np.nan.

solution: We could use a fill-value of 0 if node_id is integer but this does not work in combination with NodeBasinMapping logic. Best is to force node_id to float64 dtype.

@HendrikKok HendrikKok added bug Something isn't working dependencies Pull requests that update a dependency file labels Oct 2, 2024
@JoerivanEngelen
Copy link
Contributor

JoerivanEngelen commented Oct 28, 2024

FYI: This is an issue with rasterio >=1.3.10.

Setting fillid to -1 caused the tests to succeed, but I don't know if this aspect is well tested.

Update: This is not true; test_ribamod_partial_two_basin fails, which indicates my solution doesn't work immediately

@JoerivanEngelen
Copy link
Contributor

JoerivanEngelen commented Oct 30, 2024

FYI, as it is related: In this PR #348 I had to force the dtype argument for imod.prepare.rasterize to float, otherwise problems arose.

I recently updated iMOD Python to take a dtype argument for its rasterize function, but haven't released this yet. The branch uses a dev install of iMOD Python now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants