Skip to content
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

Fix some bugs #677

Closed
wants to merge 1 commit into from
Closed

Fix some bugs #677

wants to merge 1 commit into from

Conversation

cdtn
Copy link
Contributor

@cdtn cdtn commented Nov 7, 2022

  1. Allow BaseImageBatch call with src=None (assuming that the ix itself is already a full path to image).
  2. Undo src and dst being passed by BaseImagesBatch.apply_parallel to batch actions (recent bug, introduced in 4a106c7).

@cdtn cdtn changed the title Fix some bugss Fix some bugs Nov 7, 2022
@cdtn cdtn requested a review from SergeyTsimfer November 7, 2022 10:49
@@ -634,7 +634,7 @@ def apply_parallel(self, func, init=None, post=None, src=None, dst=None, *args,
# Compute result. Unbind the method to pass self explicitly
parallel = inbatch_parallel(init=init, post=post, target=target, src=src, dst=dst)
transform = parallel(type(self)._apply_once)
result = transform(self, *args, func=func, p=p, src=src, dst=dst,
result = transform(self, *args, func=func, p=p,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope
#656 fixes the same problem by adding src/dst to the signatures of methods.

In (hopefully, not too distant) future I will rework the decorator to be a class that can use inspect to look at the method signature, see #672

Copy link
Contributor Author

@cdtn cdtn Nov 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. But why do you even need those parameters inside batch actions anyway?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way, we can use apply_parallel decorator everywhere, instead of using inbatch_parallel somewhere (like it was previously)

@cdtn cdtn marked this pull request as draft November 7, 2022 14:02
@cdtn cdtn closed this Dec 25, 2022
@SergeyTsimfer SergeyTsimfer deleted the fix branch July 18, 2023 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants