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

Added equality helper and assert message for allClose #18

Merged
merged 1 commit into from Aug 18, 2016

Conversation

timj
Copy link
Member

@timj timj commented Aug 18, 2016

No description provided.

@@ -538,7 +538,8 @@ def plotImageDiff(lhs, rhs, bad=None, diff=None, plotFileName=None):

@inTestCase
def assertClose(testCase, lhs, rhs, rtol=sys.float_info.epsilon, atol=sys.float_info.epsilon, relTo=None,
printFailures=True, plotOnFailure=False, plotFileName=None, invert=False):
printFailures=True, plotOnFailure=False, plotFileName=None, invert=False,
msg=None):
Copy link
Member

Choose a reason for hiding this comment

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

Formatting just looks a little weird; why not just add this to the previous line? (Obviously not a big deal.)

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree.

Also (existing issue) lhs and rhs are documented to be scalars or np arrays, but this code also works with other kinds of sequences of numbers. Please document that fact.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've reworked the formatting to be clear with the new name, and clarified the lhs/rhs docstrings.



@inTestCase
def assertClose(*args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

sweet

Cleaned up and expanded utils.tests tests and broke split those up into
per-method tests.
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.

None yet

4 participants