Closed shnizzedy closed 2 months ago
It seems like a good chunk of the code & maintenance of this package is re-implementing argparse of cpac and now gradients + tsconcat. Would it make sense to just expose the argparse parsers of these packages and then programmatically changing them? Then we would not need to keep it in sync manually as much
It seems like a good chunk of the code & maintenance of this package is re-implementing argparse of cpac and now gradients + tsconcat. Would it make sense to just expose the argparse parsers of these packages and then programmatically changing them? Then we would not need to keep it in sync manually as much
Besides the BIDS app positional arguments, cpac just passes C-PAC arguments through as extra_args
https://github.com/FCP-INDI/cpac/blob/0f0e91a3619b480f135f36bfcd26ca992cc6597b/src/cpac/__main__.py#L351 and is just directly importing the parser from ba_timeseries_gradients
, https://github.com/FCP-INDI/cpac/blob/0f0e91a3619b480f135f36bfcd26ca992cc6597b/src/cpac/utils/bare_wrap.py#L22-L25 It's only reimplementing tsconcat's parser because in tsconcat the parser is built directly in the main
function: https://github.com/childmindresearch/tsconcat/blob/f70d8715e722b2e6e4fe305f417a8c7117f6ac9d/src/tsconcat/cli.py#L86-L123
Ah I see, perfect I'll pull it out tomorrow!
Fixes
Replaces #42 & #43 by @shnizzedy Resolves #39 by @shnizzedy Blocked by ~#45~ #59 by @shnizzedy
Description
gradients
command tocpac
wrapper to callba-timeseries-gradients
tsconcat
command tocpac
wrapper to callba-tsconcat
Technical details
ba-timeseries-gradients
only works in Python 3.11, socpac gradients
command informs user that in all other Python versions.cpac gradients
", butba-timeseries-gradients
persists in all other logs and outputs from the wrapped package.ba-tsconcat
only works in Python ≥ 3.11, socpac tsconcat
command informs user that in all other Python versions.cpac tsconcat
", butba-tsconcat
persists in all other logs and outputs from the wrapped package.tsconcat
, so it's copied into https://github.com/FCP-INDI/cpac/blob/c0ba496afb177c2b9f0ff686f71494b979ed7ad4/src/cpac/utils/bare_wrap.py#L34-L64 and will require manual intervention to keep it synced.Tests
https://github.com/FCP-INDI/cpac/blob/693eb9372ba47712947724b1df41ffe6b2643601/tests/test_wrapped.py#L16-L43
Screenshots
3.8
cpac --help
cpac gradients --help
cpac gradients
cpac tsconcat --help
cpac tsconcat
3.11
cpac --help
cpac gradients --help
cpac gradients
cpac tsconcat --help
cpac tsconcat
Checklist
Update index.md
).poetry
branch of the repository.Developer Certificate of Origin
Developer Certificate of Origin
``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ```