Skip to content

migrate to Fire from argparse, set up entrypoints#21

Closed
vit1-irk wants to merge 0 commit intosuncast-org:mainfrom
vit1-irk:main
Closed

migrate to Fire from argparse, set up entrypoints#21
vit1-irk wants to merge 0 commit intosuncast-org:mainfrom
vit1-irk:main

Conversation

@vit1-irk
Copy link

This commit has the following changes:

  1. Remove unused dependencies
  2. Add Fire dependency to handle command line arguments with less boilerplate code (it uses docstrings and function parameters for that). Breaking change notice: coordinates and box dimensions should be specified without spaces, as (x,y,z)
  3. Add package entrypoints, so user does not have to type python /path/to/script every time. After fresh pip install you just type pyampp or gxbox_factory and the app works. Try this! It makes things much easier.

@sageyu123 also, try to run gxbox_factory without any arguments from terminal and see what it outputs

@sageyu123
Copy link
Contributor

sageyu123 commented Jun 5, 2025

Looks great! @vit1-irk
I especially love the addition of entry points — running pyampp and gxbox_factory directly is super convenient.

That said, I was looking for more detailed help messages, which Fire doesn’t support well. This PR inspired me to explore alternatives, and I found Typer to be a better fit for this use case:

Benefits of using Typer over Fire and argparse:

  • Cleaner, more readable code
  • Built-in help, type validation, and argument parsing
  • Easier to extend and maintain

I've submitted a follow-up PR that replaces argparse with Typer, while preserving backward compatibility:
PR 22

Thanks again for the inspiration! Let me know if you are happy with PR 22. If so, I will go ahead and close this PR.

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.

2 participants