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

Make the signature of load_video_frames stricter #203

Open
AllenDowney opened this issue Aug 10, 2022 · 1 comment
Open

Make the signature of load_video_frames stricter #203

AllenDowney opened this issue Aug 10, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@AllenDowney
Copy link
Contributor

Currently load_video_frames can take a VideoLoaderConfig object as a parameter or, if it's missing, it gathers the kwargs and makes a VideoLoaderConfig. This permissiveness complicates the implementation if npy_cache and wastes a few cycles validating the configuration over and over. It would be better to require a validated (once and for all) VideoLoaderConfig.

To make this change, we might have to add a deprecation warning now, fix some tests that rely on the current signature, and then enforce the stricter signature in the future.

@AllenDowney
Copy link
Contributor Author

Stashing this snippet:

warnings.warn(
            "Calling load_video_frames with keyword arguments is deprecated. "
            "Pass a VideoLoaderConfig as the second parameter instead.",
            DeprecationWarning,
            stacklevel=2
        )

@klwetstone klwetstone added the enhancement New feature or request label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants