Skip to content
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

ENH: Add CLI entry point test #184

Merged
merged 5 commits into from
Jun 8, 2024

Conversation

jhlegarreta
Copy link
Collaborator

Add CLI entry point test.

Add CLI entry point test.
@esavary
Copy link
Member

esavary commented May 2, 2024

@jhlegarreta
Copy link
Collaborator Author

jhlegarreta commented May 15, 2024

Sorry to ping you again this morning @effigies @oesteban.

@jhlegarreta
Copy link
Collaborator Author

@effigies Maybe you have more insight into #184 (comment). Suggestions are welcome. Thanks.

@oesteban
Copy link
Member

oesteban commented Jun 8, 2024

@effigies, can you have a look if you meet some bandwidth?

@effigies
Copy link
Member

effigies commented Jun 8, 2024

Sure, had a look and just went ahead and patched. I think the main(argv=None) pattern is simple enough. I moved the monkeypatching just to set the command to eddymotion for realism (otherwise checking output would show usage: pytest [-h] ...).

Ran into an empty array error here:

src/eddymotion/cli/run.py:47: in main
    _ = estimator.estimate(
src/eddymotion/estimator.py:170: in estimate
    fixed, moving = _prepare_registration_data(
src/eddymotion/estimator.py:336: in _prepare_registration_data
    _to_nifti(dwframe, affine, moving)
src/eddymotion/estimator.py:243: in _to_nifti
    data = _advanced_clip(data)
src/eddymotion/estimator.py:223: in _advanced_clip
    a_min = np.percentile(denoised[denoised > 0] if nonnegative else denoised, p_min)

Simple fix to change that to >=0, which matches the variable.

@oesteban oesteban marked this pull request as ready for review June 8, 2024 15:50
@oesteban oesteban merged commit 9574a7b into nipreps:main Jun 8, 2024
6 checks passed
@jhlegarreta jhlegarreta deleted the AddCLIEntryPointTest branch June 8, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants