Skip to content

D3D updates#428

Open
browniea wants to merge 21 commits intoMHKiT-Software:developfrom
browniea:D3D_updates
Open

D3D updates#428
browniea wants to merge 21 commits intoMHKiT-Software:developfrom
browniea:D3D_updates

Conversation

@browniea
Copy link
Contributor

@browniea browniea commented Nov 18, 2025

Updates to io/d3d.py code

  • Added new coordinate names for the latest version of Delft3D
  • new calculate_grid_convergence_index function to calculate the grid convergence index between two grid's results basted on the equation GCI
  • Allows xarray or netCDF4 input

@browniea browniea requested a review from akeeste November 19, 2025 19:19
@browniea
Copy link
Contributor Author

Hey @akeeste I added the updates for the updated variable names in the Delft3D 2025 version. I was thinking about updating the code to also accept xarry in addition to netCDF.

@browniea browniea marked this pull request as ready for review January 28, 2026 19:11
@browniea
Copy link
Contributor Author

Hey @akeeste pending all the checks pass, this is ready for review.

@akeeste akeeste self-assigned this Jan 28, 2026
@akeeste
Copy link
Contributor

akeeste commented Jan 28, 2026

Thanks @browniea I'll look for some time to review next week

Copy link
Contributor

@akeeste akeeste left a comment

Choose a reason for hiding this comment

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

Thanks @browniea! I have a few minor requests to fine tune this PR and then we can merge

if not isinstance(data, netCDF4.Dataset):
raise TypeError("data must be a NetCDF4 object")
if not isinstance(data, (netCDF4.Dataset, xr.Dataset)):
raise TypeError("data must be a NetCDF4 object or xarray Dataset")
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a test for xarray input

@browniea
Copy link
Contributor Author

browniea commented Feb 6, 2026

@akeeste The xarry input is a little more complicate than I initially thought. It might be worth adding an example. I'll plan to have a few functions converted for you to look at our next meeting.

The rest of the changes are done.

@akeeste
Copy link
Contributor

akeeste commented Feb 24, 2026

@browniea I checked your recent changes and pulled in dev. This looks good so far.

The last remaining item is to add a test for d3d.py that uses xarray input. I don't think we need a full example--perhaps just duplicating an existing test that uses netcdf and inputting an xarray Dataset instead

@akeeste
Copy link
Contributor

akeeste commented Feb 24, 2026

I also pulled develop into this branch. Might have to do so again when #435 is merged

@browniea
Copy link
Contributor Author

Making a note here that currently there is some redundancy processing both xarray and netCDF file formats. For now, I'm leaving the redundancy but, in the future, we could convert the input format instead of processing both. D3D outputs netCDF files although xarray has some advantages tabulating the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants