-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add basic CLI around get_benchmark() #321
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #321 +/- ##
=====================================
Coverage 91.9% 92.0%
=====================================
Files 46 47 +1
Lines 2406 2441 +35
=====================================
+ Hits 2213 2246 +33
- Misses 193 195 +2 ☔ View full report in Codecov by Sentry. |
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.
Hey 👋🏼
Many thanks for this first contribution! As discussed in other channels, this seems like a useful feature and the current PR is a solid basis for that.
I added some inline suggestions on some small improvements and some todos to make this feature complete. Those shouldn't really take long to incorporate.
(If you are not aware of that: if you go to the "Files changed" tab on GitHub, you can batch up suggestions into a single commit and apply them in one go directly from the web. This also resolves the related comments)
As already hinted at by the CLI, this PR is missing one more thing in addition to these small comments: test (coverage). There is a convenient way to test CLIs with unittests:
- you add the
pytest-console-scripts
dependency as illustrated here: https://github.com/cda-tum/mqt-core/blob/4d6f788df95513b9c14db938bae69f1683e26f3d/pyproject.toml#L39 - you write tests similar to https://github.com/cda-tum/mqt-core/blob/main/test/python/test_cli.py
Those tests need not be massive, but they should cover the most common scenarios in which a user would run the CI.
Once those changes are implemented, this should be good to go and a really nice addition to the library. Many thanks 🙏🏼
Co-authored-by: Lukas Burgholzer <[email protected]>
Re. tests: |
Yeah. Some of the benchmarks involve steps that aren't very easy to seed for reproducibility. Thus, sometimes a check like comparing the result of the CLI with the result of the same
As stated in the comment at the top, the tests here really don't need to be too exhaustive. If the above helps to create a working set of tests, that should be fine 😌 |
Signed-off-by: burgholzer <[email protected]>
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.
Many thanks for the additional changes and the quick workaround.
Everything looks good to me now!
Would really appreciate another PR resolving the special casing as discussed in the comment above!
Mainly to be used automatically by tooling.
Options are simple CLI options for now, but should probably become more dynamic in the future (does argparse support dynamic/unregistered options?).