HumanBrainProject / neuroglancer-scripts

Conversion of neuroimaging data for display in Neuroglancer
MIT License
27 stars 18 forks source link

Restrict nibable to compatible versions #27

Closed blowekamp closed 1 year ago

blowekamp commented 1 year ago

Ran into CI testing error when the latest version of NIbabel was installed:

File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/neuroglancer_scripts/volume_reader.py", line 290, in nibabel_image_to_precomputed
[273](https://github.com/niaid/tomojs-pytools/actions/runs/4175708111/jobs/7231009526#step:8:274)
    volume = img.get_data()
[274](https://github.com/niaid/tomojs-pytools/actions/runs/4175708111/jobs/7231009526#step:8:275)
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/nibabel/deprecator.py", line 185, in deprecated_func
[275](https://github.com/niaid/tomojs-pytools/actions/runs/4175708111/jobs/7231009526#step:8:276)
    raise error_class(message)
[276](https://github.com/niaid/tomojs-pytools/actions/runs/4175708111/jobs/7231009526#step:8:277)
nibabel.deprecator.ExpiredDeprecationError: get_data() is deprecated in favor of get_fdata(), which has a more predictable return type. To obtain get_data() behavior going forward, use numpy.asanyarray(img.dataobj).
[277](https://github.com/niaid/tomojs-pytools/actions/runs/4175708111/jobs/7231009526#step:8:278)

[278](https://github.com/niaid/tomojs-pytools/actions/runs/4175708111/jobs/7231009526#step:8:279)
* deprecated from version: 3.0
[279](https://github.com/niaid/tomojs-pytools/actions/runs/4175708111/jobs/7231009526#step:8:280)
* Raises <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 5.0
codecov[bot] commented 1 year ago

Codecov Report

Merging #27 (7dd311d) into master (b1baf42) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #27   +/-   ##
=======================================
  Coverage   92.45%   92.45%           
=======================================
  Files          25       25           
  Lines        1485     1485           
  Branches      219      219           
=======================================
  Hits         1373     1373           
  Misses         63       63           
  Partials       49       49           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

xgui3783 commented 1 year ago

Assigned myself so it would not disappear from my radar

ylep commented 1 year ago

Thank you for making us aware of this bug, however in the interest of future compatibility I prefer to use one of the new APIs instead of restricting the version of nibabel, see #28.