Skip to content

fixes in smc backend refactoring, added test #2286

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

Merged
merged 2 commits into from
Jun 8, 2017

Conversation

hvasbath
Copy link
Contributor

@hvasbath hvasbath commented Jun 8, 2017

Fixes to refactoring from @ColCarrol , added test that tests stage_handler features.

Copy link
Member

@ColCarroll ColCarroll left a comment

Choose a reason for hiding this comment

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

LGTM, will merge when tests pass

@@ -13,15 +14,13 @@
@pytest.mark.xfail(condition=(theano.config.floatX == "float32"), reason="Fails on float32")
class TestSMC(SeededTest):

def setup_method(self):
super(TestSMC, self).setup_method()
def setup_class(self):
Copy link
Member

Choose a reason for hiding this comment

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

just want to make sure this is intentional -- you'll now reuse the same test folder for every test in the class

Copy link
Contributor Author

@hvasbath hvasbath Jun 8, 2017

Choose a reason for hiding this comment

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

ah good point! will fix that!
edit: no fix needed, as we set the rm_flag=True it removes the previous results

with open(self.atmip_path(prev), 'rb') as buff:
return pickle.load(buff)

with model:
Copy link
Member

Choose a reason for hiding this comment

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

I like that this nesting is explicit, but just for interest's sake:

starting with python 2.7 you can use multiple context managers in one line

with open(...) as buff, model:
    step = pickle.load(buff)

Copy link
Contributor Author

@hvasbath hvasbath Jun 8, 2017

Choose a reason for hiding this comment

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

cool! didnt know that! but here I think it is indeed better to have them nested for clarity

@ColCarroll ColCarroll merged commit c6b786b into pymc-devs:master Jun 8, 2017
@ColCarroll
Copy link
Member

thanks!

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