Skip to content

Update _VideoArray base class to np.ndarray rather than npt.NDArray#66

Open
danielpmorton wants to merge 1 commit into
google:mainfrom
danielpmorton:main
Open

Update _VideoArray base class to np.ndarray rather than npt.NDArray#66
danielpmorton wants to merge 1 commit into
google:mainfrom
danielpmorton:main

Conversation

@danielpmorton

Copy link
Copy Markdown

npt.NDArray as a base class seems to cause issues with numpy 2.5 and prevents importing of mediapy.

For instance, when I import mediapy with numpy 2.5 installed in my environment, I get

Traceback (most recent call last):
  File "mediapy/test.py", line 1, in <module>
    import mediapy
  File "mediapy/mediapy/__init__.py", line 1815, in <module>
    class _VideoArray(npt.NDArray[Any]):
TypeError: typealias() takes exactly 2 positional arguments (3 given)

Switching the base class to a standard array (rather than a type hint) fixes this problem. All test cases in mediapy_test still pass!

npt.NDArray as a base class seems to cause issues with numpy 2.5 and prevents importing of mediapy.
Switching the base class to a standard array (rather than a type hint) fixes this problem
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 this pull request may close these issues.

1 participant