sofima icon indicating copy to clipboard operation
sofima copied to clipboard

Fix type annotations in render_tiles in warp.py

Open KyleLuther opened this issue 3 years ago • 3 comments

In higher versions of python (>=3.8), you cannot import the `warp.py' module

sofima-typing

This error is caused by tuple[int,int] which is not allowed in the function definition, as this is subscripting the type `tuple'

So we replace tuple -> Tuple and dict -> Dict

KyleLuther avatar Jan 12 '23 19:01 KyleLuther

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Jan 12 '23 19:01 google-cla[bot]

Actually this should be supported in py-3.9+ per https://peps.python.org/pep-0585. Which specific version of Python are you using? Does adding "from future import annotations" at the top of the file fix the problem?

mjanusz avatar Jan 12 '23 21:01 mjanusz

Oh interesting. It looks like it must just be python 3.8. I was trying to run the colab example electron microscopy section alignment and getting the error I posted above

KyleLuther avatar Jan 13 '23 02:01 KyleLuther