Skip to content

ENH: Implement f2py2e with argparse - #21923

Closed
NamamiShanker wants to merge 115 commits into
numpy:mainfrom
NamamiShanker:f2py_front
Closed

NamamiShanker wants to merge 115 commits into
numpy:mainfrom
NamamiShanker:f2py_front

Conversation

@NamamiShanker

@NamamiShanker NamamiShanker commented Jul 5, 2022 •

Copy link
Copy Markdown
Contributor

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

charris commented Jul 5, 2022

Copy link
Copy Markdown
Member

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 :)

Comment thread numpy/f2py/service.py Outdated
Comment thread numpy/f2py/__init__.py Outdated
Comment thread numpy/f2py/__init__.py Outdated
Comment thread numpy/f2py/capi_maps.py Outdated
Comment thread numpy/f2py/diagnose.py Outdated

@HaoZeke HaoZeke left a comment

Copy link
Copy Markdown
Member

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?

Comment thread numpy/f2py/service.py Outdated
Comment thread numpy/f2py/service.py Outdated
Comment thread numpy/f2py/service.py Outdated
Comment thread numpy/f2py/utils.py Outdated
Comment thread numpy/f2py/utils.py Outdated

@pearu pearu left a comment

Copy link
Copy Markdown
Contributor

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?

Comment thread numpy/f2py/diagnose.py Outdated
Comment thread numpy/f2py/diagnose.py Outdated
Comment thread numpy/f2py/utils.py Outdated
Comment thread numpy/f2py/utils.py Outdated
Comment thread numpy/f2py/utils.py Outdated
Comment thread numpy/f2py/f2pyarg.py Outdated
Comment thread numpy/f2py/utils.py Outdated
@NamamiShanker

Copy link
Copy Markdown
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
Copy Markdown
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

HaoZeke commented Jul 27, 2022

Copy link
Copy Markdown
Member

@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 :)

@jorenham

jorenham commented Jan 8, 2026

Copy link
Copy Markdown
Member

This seems to have stranded, so I'm going to close it. We can re-open if you still want to work on this @NamamiShanker

@jorenham jorenham closed this Jan 8, 2026
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.

6 participants