-
Notifications
You must be signed in to change notification settings - Fork 8
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 files as argument in CLI #246
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.
I set the whole Area-B team in review so you are aware of this change. Please give it a run and see if it works well for you
Pull Request Test Coverage Report for Build 7991873551Details
💛 - Coveralls |
LGTM, I have two points to mention here.
|
@@ -17,15 +17,17 @@ | |||
# | |||
"""Test cases for the convert script used to access the DataConverter.""" | |||
|
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.
I do not see any reflection on the test. The test can also be modified if it is out of mind but needed.
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.
I removed the --input-file
inputs except for test_cli
as we cannot test this like this. click is already checking that the file we pass is existing, therefore we never start parsing there. But I think it's fine to still test the option there.
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.
There are some --input-file
options in the test file and they can be removed.
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.
No the only occurrence left is
pynxtools/tests/dataconverter/test_convert.py
Lines 126 to 127 in f982c0e
elif "--input-file" in cli_inputs: | |
assert "test_input" in caplog.text |
test_input
exists (and it doesn't). We can remove this test entirely but I would keep it until we completely remove --input-file
.
This is how it's implemented. I just removed all documentation of the
I don't understand what you mean. The nxdl is clearly specified by |
If I understand @RubelMozumder correctly, you want to still keep |
Yes, I agree with you @lukaspie. In this case the direct file arguments should be used (it should also work now with shell pattern replacement, e.g., something like |
Great, then we all agree to use positional arguments. I will test now with the XPS reader and the data that I have here locally. |
I just checked it for a couple of runs of the dataconverter I had in my terminal history. They work well. I just have one suggestion. In the --input-file help text, can you bring the Deprecated warning before the actual doc? This way it's more obvious for someone who is quickly doing a --help and not reading thoroughly. It is at the end currently without any space after the bracket. --input-file TEXT The path to the input data file to read.
(Repeat for more than one file.)Deprecated:
Please use the positional file arguments
instead. |
I change it, now it looks like this:
|
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.
I approved it, if all are fixed it is ready to merge.
As discussed with Florian already, making |
Yeah. That's why I added that custom check. I see that Florian has already replaced the IOError with clicks own set. This should be fine with having |
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.
LGTM, works for the XPS reader too
Fixes #238
dataconverter --reader my_reader --nxdl NXmynxdl filename1 filename2
.dataconverter --reader my_reader --nxdl NXmynxdl *.h5
ordataconverter ... my_folder/**/*
for files in folders--input-file
option but shows a deprecation warning.