Skip to content

ENH: Implement f2py2e with argparse #21923

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

Open
wants to merge 115 commits into
base: main
Choose a base branch
from

Conversation

NamamiShanker
Copy link
Contributor

@NamamiShanker NamamiShanker commented Jul 5, 2022

This draft PR implements the F2PY frontend with argparse library. The aim is to split up one big f2py2e.py into 2 files. One file f2pyarg.py is responsible for parsing arguments file while other service.py deals with f2py core functionalities.

Some upcoming goals are:

  • Implement run_main(). It is the function responsible for generating wrappers and .pyf files.
  • Implement run_compile() responsible for compiling and building shared libraries.
  • Decide and implement deprecation of flags. For ex. - --f2py-wrapper-output, --skip-empty-wrappers
  • Code cleanup. Will involve refactoring and deciding which flags belong to which subparser.

@charris
Copy link
Member

charris commented Jul 5, 2022

I haven't read through this yet, but I approve of the goal. Having the front end use a modern standard should make f2py more maintainable. Next up, the templating :)

Copy link
Member

@HaoZeke HaoZeke left a comment

Choose a reason for hiding this comment

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

This is fantastic work, some minor comments aside. Also could you add a release note?

Copy link
Contributor

@pearu pearu left a comment

Choose a reason for hiding this comment

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

I did a quick review and have couple of nits.

I did not review f2pyarg.py nor service.py because it is hard to tell what is new code there and what is the result of splitting existing code into different files. Could you mark the new code in these files somehow to ease reviewing?

@NamamiShanker
Copy link
Contributor Author

I did a quick review and have couple of nits.

@pearu I have made the suggested changes, please have a look.

I did not review f2pyarg.py nor service.py because it is hard to tell what is new code there and what is the result of splitting existing code into different files. Could you mark the new code in these files somehow to ease reviewing?

I'll add comments explaining the changes in the frontend files.

@NamamiShanker
Copy link
Contributor Author

I have added comments explaining step by step how the new frontend works @pearu. Please have a look and let me know any improvements or if you want further explanation.

@HaoZeke
Copy link
Member

HaoZeke commented Jul 27, 2022

@NamamiShanker for the release notes, please create a file numpy/doc/release/upcoming_changes/21923.new_feature.rst and document it according to the numpy/doc/release/upcoming_changes/{README,template}.rst files :)

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.

5 participants