Skip to content

Change to save netcdf files with 'h5netcdf' instead of netcdf4#374

Merged
FBumann merged 1 commit into
mainfrom
feature/h5netcdf
Sep 30, 2025
Merged

Change to save netcdf files with 'h5netcdf' instead of netcdf4#374
FBumann merged 1 commit into
mainfrom
feature/h5netcdf

Conversation

@FBumann
Copy link
Copy Markdown
Member

@FBumann FBumann commented Sep 30, 2025

Description

Change to save netcdf files with 'h5netcdf' instead of netcdf4. Following xarray default

  • Updated save_dataset_to_netcdf and related methods to accept the engine parameter.
  • Changed default netCDF engine to h5netcdf across the codebase.
  • Updated dependencies to include h5netcdf.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring

Related Issues

Closes #(issue number)

Testing

  • I have tested my changes
  • Existing tests still pass

Checklist

  • My code follows the project style
  • I have updated documentation if needed
  • I have added tests for new functionality (if applicable)

Summary by CodeRabbit

  • New Features
    • Added ability to choose the NetCDF engine when exporting results and flow systems (defaults to h5netcdf).
  • Bug Fixes
    • When optimization is infeasible, the flow system is now saved to NetCDF before the error is raised, improving debuggability.
  • Chores
    • Updated dependency to use h5netcdf instead of netcdf4 for NetCDF writing.

…wing xarray default

- Updated `save_dataset_to_netcdf` and related methods to accept the `engine` parameter.
- Changed default netCDF engine to `h5netcdf` across the codebase.
- Updated dependencies to include `h5netcdf`.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 30, 2025

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between 6041b58 and c4147f8.

📒 Files selected for processing (5)
  • flixopt/calculation.py (1 hunks)
  • flixopt/flow_system.py (2 hunks)
  • flixopt/io.py (2 hunks)
  • flixopt/results.py (2 hunks)
  • pyproject.toml (1 hunks)
 _____________________________________________________________________________________________________
< Trained in all forms of code review, from the ancient art of waterfall to the modern ways of agile. >
 -----------------------------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/h5netcdf

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

@FBumann FBumann changed the title Change to save netcdf files with 'h5netcdf' instead of netcdf4. Follo… Change to save netcdf files with 'h5netcdf' instead of netcdf4 Sep 30, 2025
@FBumann FBumann merged commit 0899360 into main Sep 30, 2025
11 of 12 checks passed
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.

1 participant