Skip to content

RFC: On updates to the f2py CLI #24552

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

Closed
HaoZeke opened this issue Aug 26, 2023 · 4 comments
Closed

RFC: On updates to the f2py CLI #24552

HaoZeke opened this issue Aug 26, 2023 · 4 comments

Comments

@HaoZeke
Copy link
Member

HaoZeke commented Aug 26, 2023

Scope

The complexity (perceived or otherwise) and maintainer burden of f2py is largely in two sections:

  1. The frontend parser for command-line options which operates directly on sys.argv
  2. Parsing the Fortran grammar into an operable form
  3. Generating equivalent Python, sometimes with more Fortran

This is only to discuss (1) though (2) might be made more palpable with Lark (noted here, supports regex based parsing). (3) is where most user-facing requests happen.

Context

(1) was tackled by @NamamiShanker in #21923 (earlier guidelines in #21700, now superseded) but, the CLI in f2py2e can be tricky, with some global state and other considerations. There seems to be little appetite for a wholesale rewrite of the CLI without additional tests (as noted by @mattip), which makes sense, given the large number of (mostly unknown / silent) downstream users.

That isn't to say the existing CLI is bug free (#20520), or unambiguous for both new and experienced users (#22819).

Proposal

Moving forward, the plan is to upgrade the CLI incrementally as needed. Practically this means pre-processing sys.argv for now as seen here.

This will keep compatibility and make it easier to review / reason / work with updates to the CLI. Eventually some day, the entire CLI will be in argparse, but incrementally seems to be the best way forward.

There is no deadline for the implementation of the CLI in argparse, and this is mostly an informational document.

@HaoZeke HaoZeke mentioned this issue Aug 26, 2023
4 tasks
@HaoZeke HaoZeke changed the title RFC: On updates to the f2py CLI RFC: On updates to the f2py CLI Aug 26, 2023
@rgommers
Copy link
Member

Moving forward, the plan is to upgrade the CLI incrementally as needed.

Sounds good to me. Not sure what else to say - is this more an FYI than an RFC?

My $2c is that further improvements to the CLI are of course welcome, but I don't see it as a top prio nor as one of the key complex parts of f2py (signature generation, Fortran parsing and quality of emitted C code are a lot more complex and important).

@HaoZeke
Copy link
Member Author

HaoZeke commented Aug 27, 2023

Moving forward, the plan is to upgrade the CLI incrementally as needed.

Sounds good to me. Not sure what else to say - is this more an FYI than an RFC?

Yup, really more FYI, but I wasn't sure how else to phrase it, not really enough meat for a NEP but just informational.

My $2c is that further improvements to the CLI are of course welcome, but I don't see it as a top prio nor as one of the key complex parts of f2py (signature generation, Fortran parsing and quality of emitted C code are a lot more complex and important).

Yup, this is more towards "what if we need new flags" / "what if we need to enforce constraints on the CLI" / the CLI is tough to to work with kind of thing.

@rgommers
Copy link
Member

Okay, thanks. In that case I'd suggest closing this issue with resolution "current plan sounds fine".

@HaoZeke
Copy link
Member Author

HaoZeke commented Aug 27, 2023

Current plan sounds fine to all involved parties, future discussions of the CLI can be redirected to this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants