-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some fixes, re-wording, better testing. (#28)
* Check whether get_y is passed a yuv-clip * Update vsutil.py * Fix some docstring formatting, grammar, capitalization * Re-organize imports according to PEP 8 Since I expect most users to be importing `*` from this module, we should be using absolute imports for the few standard library functions we need. The alternative to this would be putting the os/mimetypes imports within the `is_image` function, as this would prevent the `from vsutil import *` user from having these modules' namespaces reserved, but this is not the proper location for imports according to PEP 8. * Fix missing f-strings in tests, remove default values in function calls Additionally, change `_format` to `format` in BlankClip params as this is how it is documented. * Cleanup get_subsampling, check for YUV, add RaisesRegex tests * Re-word error message in get_y, add RaisesRegex test * Formatting get_w No need to int(round(width)) as round() with no second argument will always return an int. Also no need to re-round width after rounding to nearest even int, as interger multiplication will also result in a int. * Update LICENSE, fix VapourSynth capitalization in README.rst * Add __all__ list for the `from vsutil import *` wild card user This allows cleaner looking scripts, and might as well be the recommended way of import from vsutil _in scripts_ not other modules. With `core` and `vs` being defined in __all__, a VS script will not need both of the standard VS lines if using the wild card import. * Change remaining double quotes to single quotes * get_subsampling: return None instead of an empty str for non-YUV formats * Fix join `planes` list to grab all three clips' first plane It is documented being a list [0, 0, 0]: http://www.vapoursynth.com/doc/functions/shuffleplanes.html * Use Python 3.8's positional-only parameters syntax and Literals https://www.python.org/dev/peps/pep-0570/ for more information on positional-only parameters. https://www.python.org/dev/peps/pep-0586/ for more information on typing.Literal. * Fix weird Literal implementation spec warning with vs.RGB etc. According to https://www.python.org/dev/peps/pep-0586/ , Literals can be parameterized with enums, but `vs.RGB` isn't *actually* an enum in Python's eyes (even though it's technically exposed as one). `vs.ColorFamily.RGB` is the correct way of handling this enum and both refer to the same object (i.e. `vs.ColorFamily.RGB is vs.RGB`). * make it possible to pass height as kwarg to get_w Co-authored-by: Roland Netzsch <[email protected]> Co-authored-by: kageru <[email protected]>
- Loading branch information
1 parent
c0206e2
commit dc3ed6a
Showing
4 changed files
with
88 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters