docs: improve NumPy-style docstrings in video module#457
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #457 +/- ##
==========================================
+ Coverage 89.43% 89.45% +0.02%
==========================================
Files 27 27
Lines 1287 1290 +3
==========================================
+ Hits 1151 1154 +3
Misses 136 136 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| name: str, | ||
| fmt: str = "mp4", | ||
| size: str = "1620x1050", | ||
| make_frame_func: Callable[..., None] | None = None, |
There was a problem hiding this comment.
I don't think this type communicates exactly what the function requires.
Based on the code below it will always be passed a Scene, int, int, bool, followed by optional arguments. This is not communicated well with this type.
We could create a custom type using Protocol as a base type that strictly defines the function parameters. Not sure if the added complexity is worth it here though, do you have any thoughts to add @alessandrofelder?
There was a problem hiding this comment.
Following discussion in our meeting, let's make this a FrameGenerator deriving from Protocol.
IgorTatarnikov
left a comment
There was a problem hiding this comment.
This looks good to me, I just have a slight comment regarding how the Callable types are described.
I think we should be more specific, as the code expects a certain number and position of arguments.
| camera: dict | None = None, | ||
| zoom: float | None = None, | ||
| interpol: str = "sigma", | ||
| callback: Callable[..., dict | None] | None = None, |
There was a problem hiding this comment.
Similar to above, I think this function could be typed better, especially as there are 3 required arguments.
Description
What is this PR
Why is this PR needed?
What does this PR do?
video.py.References
How has this PR been tested?
Is this a breaking change?
Does this PR require an update to the documentation?
Checklist: