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: Catch warning when loaded text file contains no data in test #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jhlegarreta
Copy link
Collaborator

Catch warning when loaded text file contains no data in test.

Fixes:

nireports/tests/test_reportlets.py::test_plot_melodic_components
  /home/runner/work/nireports/nireports/nireports/reportlets/xca.py:128:
   UserWarning: loadtxt: input contained no data:
    "/tmp/pytest-of-runner/pytest-0/popen-gw0/test_plot_melodic_components0/noise_none.csv"
    noise_components = np.loadtxt(noise_components_file, dtype=int, delimiter=",", ndmin=1)

raised for example in:
https://github.com/nipreps/nireports/actions/runs/12681153218/job/35344304375#step:12:347

Catch warning when loaded text file contains no data in test.

Fixes:
```
nireports/tests/test_reportlets.py::test_plot_melodic_components
  /home/runner/work/nireports/nireports/nireports/reportlets/xca.py:128:
   UserWarning: loadtxt: input contained no data:
    "/tmp/pytest-of-runner/pytest-0/popen-gw0/test_plot_melodic_components0/noise_none.csv"
    noise_components = np.loadtxt(noise_components_file, dtype=int, delimiter=",", ndmin=1)
```

raised for example in:
https://github.com/nipreps/nireports/actions/runs/12681153218/job/35344304375#step:12:347
@jhlegarreta jhlegarreta force-pushed the AvoidEmptyTxtLoadWarning branch from 47d7ff0 to 868d7ae Compare January 9, 2025 01:20
@jhlegarreta
Copy link
Collaborator Author

jhlegarreta commented Jan 10, 2025

Do not have permissions to stop codecov: it has been running for more than a day now. This PR does not impact the coverage. This is ready to be merged. @effigies @oesteban.

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.

1 participant