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

Merged
merged 1 commit into from
Feb 8, 2025

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.

@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 64.43%. Comparing base (7fdae74) to head (b34a89b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
- Coverage   65.25%   64.43%   -0.83%     
==========================================
  Files          25       25              
  Lines        2674     2674              
  Branches      420      367      -53     
==========================================
- Hits         1745     1723      -22     
- Misses        814      838      +24     
+ Partials      115      113       -2     
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.

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 4c7735b to 30b5a91 Compare February 8, 2025 13:05
@effigies
Copy link
Member

effigies commented Feb 8, 2025

Sorry, didn't realize this would fail on min. Feel free to revert and merge.

@effigies effigies force-pushed the AvoidEmptyTxtLoadWarning branch from b34a89b to 30b5a91 Compare February 8, 2025 16:25
@effigies effigies merged commit 383c913 into nipreps:main Feb 8, 2025
26 of 27 checks passed
@jhlegarreta jhlegarreta deleted the AvoidEmptyTxtLoadWarning branch February 8, 2025 17:31
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