-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
update docstring and eval with overrides #6241
Conversation
Signed-off-by: Wenqi Li <[email protected]>
e518132
to
304eb05
Compare
Signed-off-by: Wenqi Li <[email protected]>
@atbenmurray is planning on making some changes to a number of aspects this PR touches so perhaps we wait on this one a bit. |
Still need a pause on this one for the moment |
@@ -345,8 +345,7 @@ def _post_transform(self, item_transformed): | |||
first_random = self.transform.get_index_of_first( | |||
lambda t: isinstance(t, RandomizableTrait) or not isinstance(t, Transform) | |||
) | |||
if first_random is not None: | |||
item_transformed = self.transform(item_transformed, start=first_random) | |||
item_transformed = self.transform(item_transformed, start=first_random) |
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.
execute shouldn't have to handle start is None I think
""" | ||
end_ = len(transforms) if end is None else end | ||
if start is None: | ||
raise ValueError(f"'start' ({start}) cannot be None") | ||
input_ = evaluate_with_overrides( |
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.
I am not sure this is the correct way to handle this issue. I know you are trying to isolate dataset from changes, but I don't understand why evaluate_with_overrides needs to be called
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.
In any case, please hold off on this for now until I have assembled the PR that refactors some of this code for simplicity.
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.
mainly to replicate this line on the dev branch:
Line 355 in be3d138
item_transformed = self.transform.evaluate_with_overrides(item_transformed, None) |
so that the final transform always gets the pending operations evaluated
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.
If first_random
is None, that means your entire compose was run before the item was cached, which would include the final evaluation. When the item is loaded from the cache, it has no pending transforms, so you have no way for pending transforms to be added that would then need to be evaluated
As per the review on #6244, if we agree that we aren't supporting caching of pending transforms, we can close this PR without a merge. |
Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests --disttests
.make html
command in thedocs/
folder.