Open AllenDowney opened 2 years ago
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
)
Currently
load_video_frames
can take aVideoLoaderConfig
object as a parameter or, if it's missing, it gathers the kwargs and makes aVideoLoaderConfig
. This permissiveness complicates the implementation ifnpy_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.