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

typing errors on python 3.8 #128

Closed
Mrswolf opened this issue Jun 6, 2024 · 3 comments
Closed

typing errors on python 3.8 #128

Mrswolf opened this issue Jun 6, 2024 · 3 comments

Comments

@Mrswolf
Copy link

Mrswolf commented Jun 6, 2024

Hey there,

It seems that mri-nufft has some typing errors when running on python 3.8.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/swolf/miniconda3/envs/test/lib/python3.8/site-packages/mrinufft/__init__.py", line 9, in <module>
    from .operators import (
  File "/home/swolf/miniconda3/envs/test/lib/python3.8/site-packages/mrinufft/operators/__init__.py", line 7, in <module>
    from .base import (
  File "/home/swolf/miniconda3/envs/test/lib/python3.8/site-packages/mrinufft/operators/base.py", line 184, in <module>
    class FourierOperatorBase(ABC):
  File "/home/swolf/miniconda3/envs/test/lib/python3.8/site-packages/mrinufft/operators/base.py", line 192, in FourierOperatorBase
    interfaces: dict[str, tuple] = {}
TypeError: 'type' object is not subscriptable

This new grammar is officially supported since python 3.9, see this, so please consider setting the minimum required python version to 3.9.

or adding the following line to both operators/base.py and io/nsp.py files

from __future__ import annotations

It should fix the typing errors.

@paquiteau
Copy link
Member

Good catch, it should be fixed on master now! We test MRI-NUFFT on 3.10 mostly. Note that 3.8 end-of-life is in October 2024 1, so I advise you to update your Python versions if possible.

Footnotes

  1. https://endoflife.date/python

@Mrswolf
Copy link
Author

Mrswolf commented Jun 6, 2024

@paquiteau found another file extras/smaps.py when I was trying to import trajectories

@paquiteau paquiteau reopened this Jun 6, 2024
@paquiteau
Copy link
Member

paquiteau commented Jun 6, 2024

More fixes in dc709aa. Thank you for using MRI-NUFFT

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

No branches or pull requests

2 participants