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
placed context stack inside thread-local data space #1555
placed context stack inside thread-local data space #1555
Conversation
|
Oh. I'll look into it. |
Indeed, there was a stupid mistake in my implementation, and I should have tested it before uploading. Now I added a regression test and it does work. However, on my local machine, |
Can't help much in the next few days, but tests are run using
This is equivalent to
If you have Docker running on your machine, you could also I'm not sure why, but most scientific python projects use |
I'd say that it's a historical legacy using nose rather than pytest. If
this project were starting now we'd probably use pytest.
…On Mon, Nov 28, 2016 at 4:20 PM, Colin ***@***.***> wrote:
Can't help much in the next few days, but tests are run using nose on
travis -- you can launch them by hand with something like
THEANO_FLAGS='gcc.cxxflags="-march=core2"' nosetests -vv tests/this_is_optional.py
This is equivalent to
./scripts/test.sh -vv tests/this_is_optional.py
If you have Docker running on your machine, you could also
./scripts/start_container.sh to start a pymc3 container, then run the
tests inside there (more details are in the CONTRIBUTING.md).
I'm not sure why, but most scientific python projects use nose instead of
pytest.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1555 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA8DiGF9BRFFhOgoDSgakjFnBjb_jht5ks5rCv8ygaJpZM4K85ij>
.
--
Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com
|
I merged my PR #1560 into this. According to Travis, solving the pickle problem indeed fixes this PR here too. |
@@ -10,10 +10,14 @@ | |||
__all__ = ['DensityDist', 'Distribution', 'Continuous', | |||
'Discrete', 'NoDistribution', 'TensorType', 'draw_values'] | |||
|
|||
class _Unpickling(object): |
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.
Probably want to rebase.
LGTM. @ColCarroll think we should merge this into master or 3.1? |
17683f2
to
9d5b1a1
Compare
Seems like a bugfix, not a feature, so I'd go with master. |
Thanks @burnpanck! |
* placed context stack inside thread-local data space * fixed thread-local context manager, and added a regression test * fixed docstring of pymc-devs#1552 regression test
* placed context stack inside thread-local data space * fixed thread-local context manager, and added a regression test * fixed docstring of pymc-devs#1552 regression test
Currently, PyMC3's model-context suggests that the effect is scoped to the body of the context manager. However, this is not the case: Since it changes global state (the class attribute
contexts
is shared globally within the interpreter), it affects any other PyMC3 code that could be running in a different thread. By making the context stack thread-local, the effect of the changes are properly confined to the code inside the context manager.Fixes #1552