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

New pillow release has broken array coercion #5455

Closed
jni opened this issue Jul 4, 2021 · 2 comments · Fixed by #5456
Closed

New pillow release has broken array coercion #5455

jni opened this issue Jul 4, 2021 · 2 comments · Fixed by #5456

Comments

@jni
Copy link
Member

jni commented Jul 4, 2021

Description

Probably an issue for Pillow, but not sure yet so noting it down here. Example failure here:

>               frame_paletted = np.array(im, np.uint8)
E               TypeError: __array__() takes 1 positional argument but 2 were given

C:\hostedtoolcache\windows\Python\3.9.5\x64\lib\site-packages\imageio\plugins\pillow.py:745: TypeError

I'm pretty sure that __array__ methods should take in dtype=, but I don't know 100%.

@hmaarrfk
Copy link
Member

hmaarrfk commented Jul 4, 2021

______________ TestImageCollection.test_custom_load_func_w_kwarg ______________

self = <skimage.io.tests.test_collection.TestImageCollection testMethod=test_custom_load_func_w_kwarg>

    def test_custom_load_func_w_kwarg(self):
        load_pattern = os.path.join(data_dir, 'no_time_for_that_tiny.gif')
    
        def load_fn(f, step):
            vid = imageio.get_reader(f)
            seq = [v for v in vid.iter_data()]
            return seq[::step]
    
        ic = ImageCollection(load_pattern, load_func=load_fn, step=3)
        # Each file should map to one image (array).
        assert len(ic) == 1
        # GIF file has 24 frames, so 24 / 3 equals 8.
>       assert len(ic[0]) == 8

C:\hostedtoolcache\windows\Python\3.9.5\x64\lib\site-packages\skimage\io\tests\test_collection.py:110: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\hostedtoolcache\windows\Python\3.9.5\x64\lib\site-packages\skimage\io\collection.py:294: in __getitem__
>               frame_paletted = np.array(im, np.uint8)
E               TypeError: __array__() takes 1 positional argument but 2 were given

C:\hostedtoolcache\windows\Python\3.9.5\x64\lib\site-packages\imageio\plugins\pillow.py:745: TypeError

@jni
Copy link
Member Author

jni commented Jul 4, 2021

Looks like there's a fix on the way:

python-pillow/Pillow#5572

so let's just pin on pillow!=8.3.0.

jni added a commit to jni/scikit-image that referenced this issue Jul 4, 2021
grlee77 pushed a commit that referenced this issue Jul 5, 2021
* Pin pillow to !=8.3.0

Fixes #5455

* Explain why 8.3.0 was blocked from dependencies

Co-authored-by: Mark Harfouche <mark.harfouche@gmail.com>
jni added a commit to regro-cf-autotick-bot/scikit-image-feedstock that referenced this issue Jul 7, 2021
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.

2 participants