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

support average in generic concat #810

Merged
merged 6 commits into from
Apr 7, 2025
Merged

Conversation

otzi5300
Copy link
Collaborator

No description provided.

@ecomodeller ecomodeller linked an issue Mar 27, 2025 that may be closed by this pull request

def test_concat_average(tmp_path: Path) -> None:
# Test for multiple items?
g = mikeio.Grid1D(x=range(5), projection="LONG/LAT")
Copy link
Member

Choose a reason for hiding this comment

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

projection is not meaningful for Grid1D. I would skip it.

@otzi5300 otzi5300 marked this pull request as ready for review April 3, 2025 06:50
@otzi5300 otzi5300 requested a review from ecomodeller April 3, 2025 06:51
if not last_file:
dfs_n = DfsFileFactory.DfsGenericOpen(str(infilenames[i + 1]))
nf = dfs_n.FileInfo.TimeAxis.StartDateTime
next_start_time = datetime(
Copy link
Member

Choose a reason for hiding this comment

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

Why is this step necessary, isn't nf already a datetime?

da_x0 = ds[0].isel(x=0)

assert np.allclose(
da_x0.values.flatten(),
Copy link
Member

Choose a reason for hiding this comment

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

is .flatten() necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no you right, for a 1d array flatten is not needed. will remove it

@otzi5300 otzi5300 requested a review from ecomodeller April 7, 2025 12:13
@ecomodeller ecomodeller merged commit 8733c4c into main Apr 7, 2025
8 checks passed
@ecomodeller ecomodeller deleted the generic_concat_average branch April 7, 2025 13:14
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.

generic.concat (keep = average) :: bug
2 participants