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

Python binding ectrans4py #205

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

AlexandreMary
Copy link
Contributor

@AlexandreMary AlexandreMary commented Jan 28, 2025

This branch, based on PRs #203 and #204, introduces the Python binding ectrans4py.

This is a Python interface to some ectrans functions, mainly the necessary routines to be able to:

  • transform a spectral field into gridpoint
  • transform a gridpoint field into spectral
  • compute gridpoint derivatives of a field in spectral space

both for global and LAM fields.

It uses ctypesForFortran Python package for the Fortran<>Python interface.

Note: version number is duplicated in src/ectrans4py/__init__.py for now, until better solution.
Replaces PR #199

@AlexandreMary
Copy link
Contributor Author

@samhatfield I guess I'd need to re-rebase this (commits 8f57c77 to b900eed) on top of #203 or even develop when you're done ?

@samhatfield
Copy link
Collaborator

Yes exactly! :) Then you can just force push to your repo and the PR will update itself.

@AlexandreMary
Copy link
Contributor Author

OK I wait for 203 to be merged in develop then.

@samhatfield
Copy link
Collaborator

Hi @AlexandreMary - you can try rebasing this branch against develop now.

@AlexandreMary AlexandreMary force-pushed the ectrans4py_isolated_and_rebased branch from b900eed to 3c0c564 Compare February 25, 2025 08:09
@AlexandreMary
Copy link
Contributor Author

Rebasing done, branch force-pushed.
License for ctypesForFortran being switched to Apache-2.0 as requested, cf. UMR-CNRM/ctypesForFortran#6
@SebastienRietteMTO, should you take this opportunity to also switch to version 2 of ctypesForFortran ?

@AlexandreMary AlexandreMary changed the title Python binding ectrans4py [WiP] Python binding ectrans4py Feb 25, 2025
@AlexandreMary AlexandreMary changed the title [WiP] Python binding ectrans4py Python binding ectrans4py Mar 6, 2025
@AlexandreMary
Copy link
Contributor Author

License of ctypesforFortran dependency has been switched to Apache-2.0

@@ -0,0 +1,20 @@
if(HAVE_ETRANS)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Because HAVE_ETRANS is a condition of the ECTRANS4PY feature, I think this if statement is not necessary.


ecbuild_add_option( FEATURE ECTRANS4PY
DEFAULT OFF
CONDITION HAVE_ETRANS
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I understand right, HAVE_DOUBLE_PRECISION is effectively a condition for ECTRANS4PY. Why not make it "official" and put it as a condition here?

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