-
Notifications
You must be signed in to change notification settings - Fork 4
[WIP] ops refactor #454
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
base: main
Are you sure you want to change the base?
[WIP] ops refactor #454
Conversation
|
@adrn, this is a start towards the refactor we discussed. |
72d50c7 to
e985e5f
Compare
| @AbstractOperator.__call__.dispatch # type: ignore[misc] | ||
| def call(self: AbstractOperator, x: Coordinate, /) -> Coordinate: | ||
| @dispatch | ||
| def operate(self: AbstractOperator, obj: Coordinate, /) -> Coordinate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I think we discussed having the "root" operate implementation be:
def operate(cls, params, tau, obj):where tau is the "proper time" and it's implemented in class method form. But maybe it's possible to implement as a method / replacement of the current __call__ mechanism? Either way, I think the default should take (tau, obj) and there should be a dispatch when only obj is passed like:
def operate(cls, params, obj):
return operate(cls, params, None, obj)Thoughts?
b357925 to
1cf96f6
Compare
Signed-off-by: nstarman <[email protected]>
Signed-off-by: nstarman <[email protected]>
No description provided.