-
Notifications
You must be signed in to change notification settings - Fork 3.1k
examples/heatmap_and_track: improve CLI argument parsing #2055
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the CLI argument parsing for the heatmap and tracking script by replacing argparse with conditional jsonargparse support and a positional argument fallback. The main function is renamed from heatmap_and_track to main and includes comprehensive parameter documentation.
Key Changes:
- Replaced
argparsewithjsonargparse(with fallback to positional arguments when unavailable) - Renamed main function to
mainand added detailed docstring - Simplified CLI entrypoint using
ArgumentParser.add_function_arguments()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a4d4d3b to
f2efcc3
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2055 +/- ##
=======================================
Coverage 52% 52%
=======================================
Files 61 61
Lines 7077 7076 -1
=======================================
Hits 3657 3657
+ Misses 3420 3419 -1 🚀 New features to boost your workflow:
|
This pull request refactors the CLI interface and entrypoint logic for the heatmap and tracking script, making it more robust and flexible. The main function is renamed and documented, and the CLI argument parsing now supports both
jsonargparseand a fallback to positional arguments if the package is unavailable. This improves usability and maintainability of the script.CLI and Entrypoint Refactor:
argparsewith a conditional import ofjsonargparsefor CLI parsing, with fallback to positional arguments ifjsonargparseis unavailable. This makes the script more flexible for different environments. [1] [2]heatmap_and_tracktomainand added a comprehensive docstring describing all parameters for better clarity and maintainability. [1] [2]maindirectly with parsed arguments, removing the previous manual mapping and improving code readability.Part of #2090