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

"mode" method in regridder keeps repeating first value of source grid over target grid #236

Closed
JoerivanEngelen opened this issue Apr 29, 2024 · 0 comments · Fixed by #237
Assignees
Labels
bug Something isn't working

Comments

@JoerivanEngelen
Copy link
Contributor

JoerivanEngelen commented Apr 29, 2024

MWE, add to test_regridder.py:

def test_overlap_regridder_structured_values(grid_data_a):
    grid_data_adapted = grid_data_a.copy()
    grid_data_adapted.values[0, 0] = 99
    regridder = OverlapRegridder(source=grid_data_adapted, target=grid_data_a, method="mode")
    result = regridder.regrid(grid_data_adapted)
    assert not np.all(result == 99.0)

This test fails, instead all values are turned into the first value (99).

I've found the culprit: It has to do with an indexing bug in regrid.reduce.mode, working on a fix.

@JoerivanEngelen JoerivanEngelen added the bug Something isn't working label Apr 29, 2024
@JoerivanEngelen JoerivanEngelen self-assigned this Apr 29, 2024
@github-project-automation github-project-automation bot moved this to 📯 New in iMOD Suite Apr 29, 2024
@JoerivanEngelen JoerivanEngelen moved this from 📯 New to 🤝 Accepted in iMOD Suite Apr 29, 2024
@JoerivanEngelen JoerivanEngelen moved this from 🤝 Accepted to 🏗 In Progress in iMOD Suite Apr 29, 2024
@JoerivanEngelen JoerivanEngelen moved this from 🏗 In Progress to 🧐 In Review in iMOD Suite Apr 29, 2024
Huite added a commit that referenced this issue Apr 29, 2024
…_method_regridding

Issue #236 fix indexing in mode method regridding
@github-project-automation github-project-automation bot moved this from 🧐 In Review to ✅ Done in iMOD Suite Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant