-
-
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
Redesign Render Arguments & Data Namespace APIs #101
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: Export some new classes from `.renderable`: - `ArgsNamespace` - `DataNamespace` - `RenderableData` - Change: `Renderable._Data_` -> `RenderableData`. - Change: Simplify the collection of render argument/data namespaces of parent render classes in `RenderableMeta`. - Change: Delegate association of render args/data namespace classes to the namespace metaclasses; No longer handled by `RenderableMeta`. In `.renderable._types`: - Add: Export `ArgsNamespace` and `DataNamespace`. - Add: `DataNamespaceMeta`. - Change: `RenderArgsData._NamespaceMeta` -> `ArgsDataNamespaceMeta`. - Change: `RenderArgsData.Namespace` -> `ArgsDataNamespace`. - Change: `RenderArg._NamespaceMeta` -> `ArgsNamespaceMeta`. - Change: `RenderArgs.Namespace` -> `ArgsNamespace`. - Change: `RenderData.Namespace` -> `DataNamespace`.
- Fix: Rename local variable variable *name* -> *field_name* in `ArgsDataNamespaceMeta.__new__()`.
- Change: Update docs related to render argument and data namespaces.
- Change: Update render args/data namespace class definitions. - Change: Update tests for render args/data namespace classes.
- Change: Update render args/data namespace class definitions. - Change: Update render args/data namespace-related tests for `RenderableMeta`.
- Change: Update render args/data namespace class definitions.
AnonymouX47
added
fix
Fixes a bug
improvement
Implementation of improvement to an existing feature
renderable
Related to the Renderable API
labels
Nov 22, 2023
- Change: "*defines* render args/data" -> "*has* render args/data".
- Change: Update warnings about render argument/data field number and order.
- Change: Use namespace class name instead of that of the associated render class in the error message when too many field values are given. The namespace class is actually the one that defines the fields. - Change: Update the affected test.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
fix
Fixes a bug
improvement
Implementation of improvement to an existing feature
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.
Fixes render argument/data namespace class names.
Redesigns namespaces classes.
Delegates association of namespace classes to their metaclasses instead of
RenderableMeta
.Simplifies the collection of render argument/data namespaces of parent render classes in
RenderableMeta
.Drops the use of inner class definitions.
Renderable._Data_
->RenderableData
.RenderArgs.Namespace
->ArgsNamespace
.RenderData.Namespace
->DataNamespace
.In
.renderable._types
:RenderArgsData._NamespaceMeta
->ArgsDataNamespaceMeta
.RenderArgsData.Namespace
->ArgsDataNamespace
.RenderArgs._NamespaceMeta
->ArgsNamespaceMeta
.Adds
.renderable._types.DataNamespaceMeta
.Updates documentation for render argument and data namespaces.
Updates tests related to render argument and data namespaces.
Updates definitions of render argument and data namespaces across the tests.
Required for the advancement of #100.
From a dynamic typing perspective, both the current and new APIs are equally good but the current will not work with static typing.
The new API happens to have a couple minor downsides though:
RenderArgs(render_cls)
is created before an argument namespace class is associated withrender_cls
, thatRenderArgs
instance will lack a namespace forrender_cls
, unlike those created afterwards.render_cls
is subclassed before an argument namespace class is associated withrender_cls
, everyRenderArgs
instance associated with that subclass will lack a namespace forrender_cls
.The same applies to render data... but looking on the bright side, this typically shouldn't occur and there's an admonition in the docs concerning this.