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

test_subclass_conversion fails with Numpy 2.x #10295

Closed
1 task done
FliegendeWurst opened this issue Jan 6, 2025 · 4 comments · Fixed by #10297
Closed
1 task done

test_subclass_conversion fails with Numpy 2.x #10295

FliegendeWurst opened this issue Jan 6, 2025 · 4 comments · Fixed by #10297
Labels
bug Something isn't working

Comments

@FliegendeWurst
Copy link

Describe the bug

Test fails with

=================================== FAILURES ===================================
_______________ TestOutputPreprocessing.test_subclass_conversion _______________

self = <test.test_processing_utils.TestOutputPreprocessing object at 0x7ffcc651b110>

    def test_subclass_conversion(self):
        """Check subclass conversion behavior"""
        x = np.array([-1, 1])
        for dtype in TestOutputPreprocessing.float_dtype_list:
            x = x.astype(dtype)
            y = processing_utils._convert(x, np.floating)
>           assert y.dtype == x.dtype
E           AssertionError: assert dtype('float64') == dtype('float32')
E            +  where dtype('float64') = array([-1.,  1.]).dtype
E            +  and   dtype('float32') = array([-1.,  1.], dtype=float32).dtype

test/test_processing_utils.py:260: AssertionError

It seems the _convert function no longer sets the correct dtype.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

Run the test suite.

I ran the test suite using the nixpkgs package. You can see the full log here: https://hydra.nixos.org/build/283956666/nixlog/1

Screenshot

No response

Logs

No response

System Info

I can't build gradio, so I cannot run gradio environment.
If you need the version of specific dependencies you can check https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=python312Packages

Severity

I can work around it

@FliegendeWurst FliegendeWurst added the bug Something isn't working label Jan 6, 2025
@FliegendeWurst
Copy link
Author

Oh, it seems I wasn't using the latest version. I will check again with 5.9.1.

@FliegendeWurst

This comment was marked as off-topic.

@FliegendeWurst
Copy link
Author

Hmm.. just checked again and I still see the failure, even with 5.9.1. Not to mention that the linked PR was included in much earlier versions too.

@FliegendeWurst FliegendeWurst reopened this Jan 6, 2025
@abidlabs
Copy link
Member

abidlabs commented Jan 6, 2025

Can reproduce, taking a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants