-
Notifications
You must be signed in to change notification settings - Fork 108
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
second but now tested Tasks generator with/without threads #291
Conversation
@@ -73,7 +73,7 @@ def reader(asset: str, *args, **kwargs) -> Tuple[numpy.ndarray, numpy.ndarray]: | |||
) | |||
|
|||
if not chunk_size: | |||
chunk_size = threads or len(assets) | |||
chunk_size = threads if threads > 1 else len(assets) |
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.
this explains why it was fine with threads=1
, because we were processing chunks of one element.
@@ -222,18 +221,64 @@ def test_mosaic_tiler_Stdev(): | |||
|
|||
def test_threads(): | |||
"""Test mosaic tiler.""" | |||
assets = [asset1, asset2, asset1, asset2, asset1, asset2] | |||
assets = [asset2, asset1, asset1, asset2, asset1, asset2] |
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.
Simple but important changes, before we were just lucky because the tiler was first yielding result for asset1. This change was made during testing to validate the new implementation
@@ -44,15 +47,9 @@ def filter_tasks( | |||
if not allowed_exceptions: | |||
allowed_exceptions = () | |||
|
|||
while True: | |||
for (future, asset) in tasks: |
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.
because we don't need generators anymore we can switch back to simple Sequence
re-do of #281
1 thread
because of abug
cc @kylebarron @geospatial-jeff