-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
The Renderable, Render and Padding APIs #97
Merged
Merged
Conversation
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
- Add: Add new exception classes for the Renderable API. - `RenderableError` - `RenderArgsError` - `RenderDataError` - `RenderFormatError` - Change: `RenderError` is now a subclass of `RenderableError`. - Change: Generalize the description of `InvalidSizeError`.
- Add: `.renderable._enum` submodule.
- Add: `.renderable._types` submodule.
- Add: `.renderable._renderable` submodule.
- Add: Export public definitions from `.renderable`: - `FrameCount` - `FrameDuration` - `HAlign` - `VAlign` - `Renderable` - `RenderArgs` - `RenderData` - `RenderFormat` - `RenderParam` - `Frame`
- Add: `.render._iterator` submodule. - Add: `.exceptions.RenderIteratorError`. - Add: Export `RenderIterator` from `.render`.
AnonymouX47
added
new
New feature implementation
renderable
Related to the Renderable API
iterator
Related to the RenderIterator API
render
Related to the Render API (not just a sub-API of it)
labels
Jul 18, 2023
- Change: Remove use of positional-only parameters.
- Add: `tests.renderable.test_types`. - Add: Tests for `Frame`. - Add: `tests.renderable.test_types` to `test-renderable` make target.
- Change: Update NOTE about render data modification in the docstring of `RenderIterator._from_render_data_()`.
- Change: `_handle_interrupted_draw_()` is no longer called for exceptions other than `KeyboardInterrupt`. - Change: `_handle_interrupted_draw_()` is now called only when `KeyboardInterrupt` is raised while writing a frame to the output stream or flushing the stream. - Change: Update the docstring of `_handle_interrupted_draw_()`.
- Add: Test for `Renderable`'s render arguments. - Change: Simplify render argument compatibility tests for `Renderable._init_render_()`.
- Add: Tests for `RenderFormat`. - Add: Check `RenderFormat.relative` in tests for `Renderable._init_render_()`.
- Change: Remove *animation* parameter of `._init_render_()`. - It was really only there for the error message's context. - Change: Update render size validation in `.draw()`. - Change: Update the docstrings of modified methods.
- Change: Update render size validation-related tests for `Renderable._init_render_()`.
- Change: Rename `.size` -> `.render_size` - Change: Rename `.render` -> `.render_output` - Change: Update the field names in the tests and docs.
- Fix: Set frame offset to zero at initialization. Ensures iteration starts from the first frame for renderables with definite frame count and non-zero current frame number.
- Change: Separate `as_dict()` and `get_fields()` methods for `RenderArgs.Namespace` and `RenderData.Namespace`. - Move definitions from `RenderArgsData.Namespace` to `RenderArgs.Namespace` as-is. - Redefine/Re-document for `RenderData.Namespace`. - Change: Document `RenderData.Namespace.as_dict()` as raising `UninitializedDataFieldError`. - Change: Redefine `RenderData.Namespace.get_fields()` to return a tuple of field names instead of a dict, as fields no longer have default values.
- Add: `.renderable.NonAnimatedFrameDurationError`. - Change: Raise `NonAnimatedFrameDurationError`, instead of ignoring, when attempting to set `Renderable.frame_duration` on a non-animated renderable.
- Change: Update dostring of `Renderable.frame_duration`. - Change: Update docstrings of interfaces with a frame duration parameter and attributes representing frame duration. - "fixed" -> "static". - Simplify the description of "static" frame duration. - Add references to `Renderable.frame_duration` where necessary.
- Add: Call `._clear_frame_()` from `._animate_()`. - Add: `._clear_frame_()` to the Renderable Extension API docs. - Change: Fine-tune the definition and documentation of `._clear_frame_()`.
- Add: Tests for calls to `._clear_frame_()`. - Change: Move tests for the *output* parameter to the right place.
- Add: Test rendered frame number for: - `__str__()` - `render()` - `draw()` (with `animate=False`) - Add: Tests for `__str__()` default render arguments. - Change: Rewrite tests for `__str__()`. - Change: Cleanup test for `_clear_frame_()` calls in `_animate_()`. - Change: Rename some test renderable classes and their respective instance variable names: - `DrawChar` -> `RenderChar` - `draw_char` -> `render_char` - `DrawAnimChar` -> `AnimateChar`. - `draw_anim_char` -> `animate_char`. - ...
- Add: *output* parameter. - Change: Fine-tune docstring. - Change: Fine-tune usage in `draw()` and `_animate_()`.
- Add: Tests for calls to `_handle_interrupted_draw_()` in `draw()` (for non-animations) and `_animate_()`.
AnonymouX47
force-pushed
the
renderable
branch
from
September 28, 2023 00:40
0b1cb81
to
7cba874
Compare
Finally! 😩 😮💨 😃 🎉 |
Merged
AnonymouX47
added a commit
that referenced
this pull request
Oct 2, 2023
- Change: Removed `inherit` parameter of namespace metaclass. `inherit=False` was flawed because the subclasses would actually still inherit the attributes (slot entries) of the base (and could even be set on `RenderData` instances). - Change: Disallow multiple base classes. This allowed namespaces to have abitrary attributes if any base had a `__dict__` member. - Change: Unassociated namespace classes cannot be subclassed. This allowed for a subclass to be associated with render class different from that of its parent. This typing model was not so neat. Fine-tunes the work done at #97.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
iterator
Related to the RenderIterator API
new
New feature implementation
padding
Related to the Padding API
render
Related to the Render API (not just a sub-API of it)
renderable
Related to the Renderable API
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
.renderable
subpackage.Renderable
_Data_
RenderArgs
Namespace
RenderData
Namespace
Frame
FrameCount
FrameDuration
Seek
RenderableError
IndefiniteSeekError
RenderError
RenderSizeOutOfRangeError
RenderArgsDataError
RenderArgsError
RenderDataError
IncompatibleArgsNamespaceError
IncompatibleRenderArgsError
NoArgsNamespaceError
NoDataNamespaceError
NonAnimatedFrameDurationError
UninitializedDataFieldError
UnknownArgsFieldError
UnknownDataFieldError
.render
subpackage.RenderIterator
RenderIteratorError
FinalizedIteratorError
.padding
submodule.Padding
AlignedPadding
ExactPadding
HAlign
VAlign
PaddingError
RelativePaddingDimensionsError
sphinxcontrib-prettyspecialmethods
documentation dependency.