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

[Bug] iMOD5 Wel import: Duplicated entries within IPF are not summed in steady-state #1388

Open
JoerivanEngelen opened this issue Jan 24, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@JoerivanEngelen
Copy link
Contributor

We conduct a groupby by x, y, id, filter_top and filter_bottom. There unfortunately are cases where this results in non-unique groupby's and hence rates should be summed. This is at least going wrong in steady-state:

# imod.mf6.wel.py
...
def _df_groups_to_da_rates(
    unique_well_groups: pd.api.typing.DataFrameGroupBy,
) -> xr.DataArray:
    # Convert dataframes all groups to DataArrays
    is_steady_state = "time" not in unique_well_groups[0].columns
    if is_steady_state:
        da_groups = [
            xr.DataArray(df_group["rate"].iloc[0]) for df_group in unique_well_groups
        ]
...

The .iloc[0] selects the first entry in this group (Assuming there is always only one entry). Instead a call to sum() should be made.

@JoerivanEngelen JoerivanEngelen added the bug Something isn't working label Jan 24, 2025
@github-project-automation github-project-automation bot moved this to 📯 New in iMOD Suite Jan 24, 2025
@JoerivanEngelen JoerivanEngelen self-assigned this Jan 24, 2025
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: 📯 New
Development

No branches or pull requests

1 participant