Conversation
SimonRit
left a comment
There was a problem hiding this comment.
I'm mostly unable to read this code. It would be good to add some documentation to required_dests and is there any way of testing this?
|
I created a small test: acoussat@4bbce8d. The test does not pass with the previous version of the code but works using this branch. Should I add this test to this PR, or perhaps even push it to RTK? |
Here is good I believe. Thanks! |
|
Thanks @acoussat ! |
|
https://docs.python.org/3/library/argparse.html#option-value-syntax |
|
The test fail because the rtk wheel installed is the one from pypi, so we need to wait for the next release to merge this PR. |
| def test_parser_inherits_from_rtk(): | ||
| assert issubclass(pct.PCTArgumentParser, rtk.RTKArgumentParser) | ||
|
|
||
|
|
||
| def test_version_flag_uses_pct_version(parser): | ||
| assert parser._version == pct.__version__ |
There was a problem hiding this comment.
Perhaps we could remove all tests from this file except those two, are it is already tested in RTK?
Multi-value (nargs="+") options were only comma-split for non-str types
because the neutralization gate skipped str-typed arguments. Passing a
list of paths through the Python API, e.g.
pct.pctcheckimagequality(reference=["a.nrrd","b.nrrd"]), serialized as
a single comma token but was never split, yielding one bogus filename
"a.nrrd,b.nrrd".
Neutralize the type of every nargs="+" option, including str/path lists,
then split comma tokens and re-cast each piece (str cast is a no-op).