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

push_map.map deprecated Warning #80

Closed
felipeZ opened this issue Dec 10, 2018 · 3 comments
Closed

push_map.map deprecated Warning #80

felipeZ opened this issue Dec 10, 2018 · 3 comments
Assignees
Labels

Comments

@felipeZ
Copy link
Contributor

felipeZ commented Dec 10, 2018

Running a workflow using the run_parallel function from from noodles.run.threading.sqlite3 import run_parallel, results in the following warning:

python3.6/site-packages/noodles/run/scheduler.py:155: DeprecationWarning: generator 'push_map.map' raised StopIteration
  sink.send(EndOfQueue)

A minimal examples, is provided below:

from noodles import (schedule_hint, serial)
from noodles.run.threading.sqlite3 import run_parallel
from noodles.serial import (Registry)


def run(wf, n_processes=1, cache='cache.db'):
    """
    Run locally using several threads.
    Caching can be turned off by specifying cache=None
    """
    return run_parallel(
        wf, n_threads=n_processes, registry=registry,
        db_file=cache, always_cache=False, echo_log=False)


def registry():
    """
    This function pass to the noodles infrascture all the information
    related to the Structure of the Package object that is schedule.
    This *Registry* class contains hints that help Noodles to encode
    and decode this Package object.
    """
    return Registry(parent=serial.base())


@schedule_hint()
def fun(x, y):
    return x ** 2 + y


@schedule_hint()
def fun2(x):
    return 2 * x + 3


def test():
    a = fun(3, 5)
    b = fun(2, a)

    c = fun2(b)

    return run(c)
@felipeZ
Copy link
Contributor Author

felipeZ commented Mar 21, 2019

The previous Warning is now an error in python 3.7. The following error is reported:

Traceback (most recent call last):
  File "miniconda3/envs/py37/lib/python3.7/site-packages/noodles/lib/streams.py", line 163, in map
    sink.send(self.f(x))
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "test.py", line 46, in <module>
    test()
  File "test.py", line 42, in test
    return run(c)
  File "test.py", line 13, in run
    db_file=cache, always_cache=False, echo_log=False)
  File "/home/felipe/miniconda3/envs/py37/lib/python3.7/site-packages/noodles/run/threading/sqlite3.py", line 108, in run_parallel
    result = scheduler.run(parallel_sqlite_worker, get_workflow(workflow))
  File "/home/felipe/miniconda3/envs/py37/lib/python3.7/site-packages/noodles/run/scheduler.py", line 155, in run
    sink.send(EndOfQueue)
RuntimeError: generator raised StopIteration

@jhidding
Copy link
Member

This is fixed in master

@felipeZ
Copy link
Contributor Author

felipeZ commented Mar 21, 2019

fixed by 8444d16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants