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

Fix and test code against newer versions of nibabel #470

Closed
mvdoc opened this issue Nov 2, 2022 · 0 comments · Fixed by #471
Closed

Fix and test code against newer versions of nibabel #470

mvdoc opened this issue Nov 2, 2022 · 0 comments · Fixed by #471

Comments

@mvdoc
Copy link
Contributor

mvdoc commented Nov 2, 2022

The newer version of nibabel (4.0) introduced some deprecation errors. We need to test our code against this newer version and fix the code that fails.


----> 1 cortex.freesurfer.import_subj("subj01")

File ~/.local/lib/python3.8/site-packages/cortex/freesurfer.py:206, in import_subj(fs_subject, cx_subject, freesurfer_subject_dir, whitematter_surf)
    204         pts, polys, _ = get_surf(fs_subject, hemi, fsname, freesurfer_subject_dir=freesurfer_subject_dir)
    205         fname = str(surfs.format(subj=cx_subject, name=name, hemi=hemi))
--> 206         formats.write_gii(fname, pts=pts + surfmove, polys=polys)
    208 for curv, info in dict(sulc="sulcaldepth", thickness="thickness", curv="curvature").items():
    209     lh, rh = [parse_curv(curvs.format(hemi=hemi, name=curv)) for hemi in ['lh', 'rh']]

File ~/.local/lib/python3.8/site-packages/cortex/formats.pyx:193, in cortex.formats.write_gii()

File ~/.local/lib/python3.8/site-packages/nibabel/deprecator.py:181, in Deprecator.__call__.<locals>.deprecator.<locals>.deprecated_func(*args, **kwargs)
    178 @functools.wraps(func)
    179 def deprecated_func(*args, **kwargs):
    180     if until and self.is_bad_version(until):
--> 181         raise error_class(message)
    182     warnings.warn(message, warn_class, stacklevel=2)
    183     return func(*args, **kwargs)

ExpiredDeprecationError: from_array method is deprecated. Please use GiftiDataArray constructor instead.

* deprecated from version: 2.1
* Raises <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 4.0

Originally posted by @mingxue1204 in #469 (comment)

@mvdoc mvdoc linked a pull request Nov 3, 2022 that will close this issue
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 a pull request may close this issue.

1 participant