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

@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.

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 868d7ae to 4c7735b Compare January 11, 2025 17:00
Copy link

codecov bot commented Jan 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.51%. Comparing base (eb3832c) to head (4c7735b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
+ Coverage   65.25%   65.51%   +0.26%     
==========================================
  Files          25       25              
  Lines        2674     2674              
  Branches      420      420              
==========================================
+ Hits         1745     1752       +7     
+ Misses        814      810       -4     
+ Partials      115      112       -3     
Flag Coverage Δ
unittests 64.91% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jhlegarreta
Copy link
Collaborator Author

Resolved conflicts, push-forced, codecov is happy now. Ready to be merged.

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.

3 participants