nipy / nibabel

Python package to access a cacophony of neuro-imaging file formats
http://nipy.org/nibabel/
Other
634 stars 258 forks source link

RF: Remove unnecessary call to `asbytes` for `b`-prepended strings #1331

Closed jhlegarreta closed 1 week ago

jhlegarreta commented 1 week ago

Remove unnecessary call to asbytes for b-prepended strings: strings prepended with b are already treated as bytes literals:

Documentation: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals

Fixes:

/home/runner/work/nibabel/nibabel/nibabel/streamlines/tests/test_streamlines.py:9:
 DeprecationWarning: `np.compat`, which was used during the Python 2 to 3 transition,
 is deprecated since 1.26.0, and will be removed
      from numpy.compat.py3k import asbytes

raised for example at: https://github.com/nipy/nibabel/actions/runs/9637811213/job/26577586721#step:7:178

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.20%. Comparing base (d18022d) to head (d1235a6).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1331 +/- ## ======================================= Coverage 92.20% 92.20% ======================================= Files 98 98 Lines 12400 12400 Branches 2557 2557 ======================================= Hits 11433 11433 Misses 644 644 Partials 323 323 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jhlegarreta commented 1 week ago

doctest build failures are unrelated.