-
Notifications
You must be signed in to change notification settings - Fork 13
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
Testing for the command line interface. #223
Conversation
…exiting (no exception) and for testing, throw an exception only. Test this both ways.
…to the cli function.
…. Update docstrings.
…nd translations. Included in testing.
… NotImplemented exceptions where applicable.
@stewartboogert some cli tests will fail just now (5), but these are due to 3 bugs I'm not sure about actually in the main code and not the cli. If you could have a look that'd really help. Cheers! |
… prefixing with "g4edgetestdata/".
…r. Remove tests when I thought they weren't implemented.
…and not any solid generally. Update docstring to reflect that.
… code, it only does a nested set of boxes specified by the outer box. Accepts rotation and translation also.
…e only need a single number.
# Conflicts: # src/pyg4ometry/cli.py
Fixed the tests and little bugs. Now, the only tests failing are from genat42Fluka. There is some byte reading error but I'm reasonably sure this is unrelated to this pull request.
|
So the tests that fail are on writing fluka (not touched in this pull request). The fluka registry tries to read the low energy neutron cards template file and fails there. So the error is the ascii encoding of the package files.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #223 +/- ##
==========================================
+ Coverage 74.09% 75.57% +1.47%
==========================================
Files 157 157
Lines 22752 22822 +70
==========================================
+ Hits 16859 17248 +389
+ Misses 5893 5574 -319 ☔ View full report in Codecov by Sentry. |
…asily do this as exceptions could really be throw at many places in main. This ensures clean print out for users, but still good debugging and testing and avoids sprinkling exits deeper in the code. Technically, the if __main__ isn't needed at the end as it's an entrypoint.
Fluka conversion tests now pass. This was fixed by forcing the writer to read the the low material template file using 'utf-8' encoding explicitly (see d65e2a8). I'm can't see how this was related to the changes here, but it does fix it. All tests passing now. |
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.
Nice! I would only recommend to squash the pre-commit bot commits into the previous one with git rebase -i
(and then force-push), if you can.
Extended the parser class to optionally throw an exception instead of the exit so not all are exits and we can see the right exception.
Added tests for all options. Many tests pass on the basis that they should raise a NotImplementedError exception.
Fixed a decent number of minor bugs. The big one was that a lot of the arguments were in the wrong order for the cli function. Finished off some implementations also.