-
Notifications
You must be signed in to change notification settings - Fork 90
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
Update the EntryPoint class to provide user feedback on required positional arguments #922
Conversation
position argument when a user requests the help menu. Additionally, add a try/except around adding a new argument from case settings to handle duplicate entries more robustly rather than requiring exclusion of settings like `verbosity` and `branchVerbosity`.
For the life of me, I couldn't invoke any of the clone commands in This update allows me to. THANK YOU!!!!!!!!!!!!!!!! |
I'll push up some unit test fixes to this branch |
Having both a settings file and patterns arg is both redunant and causes unreliable use issues. Since only patterns was used in invoke, decided to remove the settingsArgument as optional. I also removed the sys.exit(), since there is no need that I can think of to do this. The armi unit test settings file, e.g., fails this check (with can start = UNKNOWN).
For some reason, this makes parse_args go bonkers (on my machine, at least). So this seemed like an easy resolution, even if I don't understand it.
This is only needed for 3 tests, and it was causing some annoying failures on the check-inputs entry point test (although I fixed it separately by rejecting the notion that there needed to be a sys.exit()).
@@ -86,7 +86,9 @@ def test_diffResultsBasic(self): | |||
def test_compareDatabaseDuplicate(self): | |||
"""end-to-end test of compareDatabases() on a photocopy database""" | |||
# build two super-simple H5 files for testing | |||
o, r = test_reactors.loadTestReactor(TEST_ROOT) | |||
o, r = test_reactors.loadTestReactor( | |||
TEST_ROOT, customSettings={"reloadDBName": "reloadingDB.h5"} |
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.
Love it!
self.assertIn("input is self consistent", mock._outputStream) | ||
|
||
|
||
class TestCloneArmiRunCommandBatch(unittest.TestCase): | ||
def test_cloneArmiRunCommandBatchBasics(self): | ||
ca = CloneArmiRunCommandBatch() | ||
ca.addOptions() | ||
ca.parse_args(["--additional-files", "test"]) | ||
ca.parse_args([ARMI_RUN_PATH, "--additional-files", "test"]) |
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.
Alternatively, this one needs to be a real file path
@@ -237,7 +271,7 @@ class TestRunEntryPoint(unittest.TestCase): | |||
def test_runEntryPointBasics(self): | |||
rep = RunEntryPoint() | |||
rep.addOptions() | |||
rep.parse_args([]) | |||
rep.parse_args([ARMI_RUN_PATH]) |
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.
Same here, needs to be real since the settingsArgument is required here too
@opotowsky But I see you fixed the coverage issue! Awesome! |
…tional arguments (terrapower#922) * Update the entry point class to provide the settings file as an required position argument when a user requests the help menu. Additionally, add a try/except around adding a new argument from case settings to handle duplicate entries more robustly rather than requiring exclusion of settings like `verbosity` and `branchVerbosity`. * Suppress the printing of all possible settings in clone CLI * There are 18 entry points! * Make changes to checkInputs CLI and tests Having both a settings file and patterns arg is both redundant and causes unreliable use issues. Since only patterns was used in invoke, decided to remove the settingsArgument as optional. I also removed the sys.exit(), since there is no need that I can think of to do this. The armi unit test settings file, e.g., fails this check (with can start = UNKNOWN). * Move settings arg processing to not be first (nargs='*' behavior means this can't be first in the list) * Minor docstring add * Remove reloadDBName setting from armiRun.yaml This is only needed for 3 tests, and it was causing some annoying failures on the check-inputs entry point test (although I fixed it separately by rejecting the notion that there needed to be a sys.exit()). * Update warning to error for checkInputs CLI * Remove unused CLI args from checkInputs (finishing what terrapower#754 started) * Remove update to real file because that ain't necessary * Release Notes Co-authored-by: Arrielle Opotowsky <c-aopotowsky@terrapower.com>
Description
Update the entry point class to provide the settings file as an required position argument when a user requests the help menu. Additionally, add a try/except around adding a new argument from case settings to handle duplicate entries more robustly rather than requiring exclusion of settings like
verbosity
andbranchVerbosity
.@opotowsky update:
In getting the unit tests to work, a few more changes were made.
reloadDBName
setting was removed fromarmiRun.yaml
. This ended up not being necessary after other fixes were made, but it is only used for 3 tests (inbookkeeping/db
).checkInputs
needed some love. There are minor code updates, deletions, and some small updates to the tests.Checklist
doc/release/0.X.rst
) are up-to-date with any bug fixes or new features.doc
folder.setup.py
.