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

BUG: Prevent negative lookup in history. #2164

Merged
merged 2 commits into from May 2, 2018
Merged

Conversation

@ehebert
Copy link
Contributor

@ehebert ehebert commented May 1, 2018

Raise a value error on negative bar counts to prevent lookups ahead of
simulation time.

@ehebert ehebert requested a review from ssanderson May 1, 2018
"""
Negative bar counts leak future information.
"""
with self.assertRaises(ValueError):

This comment has been minimized.

@ssanderson

ssanderson May 1, 2018
Contributor

Should we assert that this raises the ValueError we expect? I could imagine messing up the test setup here in a way that would cause a different ValueError to be raised.

This comment has been minimized.

@ehebert

ehebert May 1, 2018
Author Contributor

Good point. I'll change over to use a assertRaisesRegexp.

This comment has been minimized.

@ehebert

ehebert May 1, 2018
Author Contributor

@ssanderson, here is the change you requested, a1ae9a3

@coveralls
Copy link

@coveralls coveralls commented May 2, 2018

Coverage Status

Coverage increased (+0.002%) to 87.165% when pulling 643bf40 on prevent-negative-history-lookup into 7a6b14b on master.

ehebert added 2 commits May 1, 2018
Raise a value error on negative bar counts to prevent lookups ahead of
simulation time.
To make sure the ValueError is not being occluded by another error.
@ehebert ehebert force-pushed the prevent-negative-history-lookup branch from a1ae9a3 to 643bf40 May 2, 2018
@ehebert ehebert merged commit 7f56deb into master May 2, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ehebert ehebert deleted the prevent-negative-history-lookup branch May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.