Skip to content

Conversation

@SebastienRietteMTO
Copy link

This PR aims at introducing a python wrapper around ecrad.

@FussyDuck
Copy link

FussyDuck commented May 22, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot requested review from reuterbal and rjhogan May 22, 2025 16:04
@SebastienRietteMTO SebastienRietteMTO marked this pull request as draft May 22, 2025 16:04
@SebastienRietteMTO
Copy link
Author

The python package can be installed in two ways:

  • by entering pip install . in the ecrad root directory
  • using the wheel from pypi test: pip3 install -i https://test.pypi.org/simple/ pyecrad --extra-index-url https://pypi.org/simple/

The wheels are built and pushed on pypi by ./pyecrad_wheel.sh all pyecrad (provided that a pyecrad entry exists in ~/.pypirc)

A simple test can be performed with cd practical; python3 -c "import pyecrad; ecrad=pyecrad.Ecrad('config.nam').driver('era5slice.nc', 'output_py.nc')". This will create the output_py.nc which must be equivalent to the file obtained with ../bin/ecrad config.nam era5slice.nc outpu_ori.nc.

@SebastienRietteMTO SebastienRietteMTO marked this pull request as ready for review July 3, 2025 06:55
Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

Many thanks for this, that looks very interesting. I would like to give that a proper round of testing before I will be able to make more substantial remarks on the implementation. In the meantime, I'm flagging already a few things that would help the integration:

  • Would you mind adding a README to the pyecrad directory to explain the purpose and use?
  • Can you please add licence headers to the script and Python files? Take a look at the equivalent headers in other files for this.
  • We will need a build system integration into CMake as well. We have templates for this e.g. in https://github.com/ecmwf-ifs/ifsbench and https://github.com/ecmwf-ifs/loki that we can adapt here. I can help with that.
  • I would like to add the definition of some CTest tests (e.g. via pytest) to ensure this remains functional going forward, e.g., by comparing the produced output against the equivalent output of CTest runs of the pure Fortran binaries. Again, I can help with that.
  • The compare.py script serves the same purpose as the existing nccmp.py script, could the latter be used instead of duplicating the functionality?

I hope that makes sense and happy to help with the above where required.

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.

3 participants