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

run tests in ci #59

Merged
merged 11 commits into from
Apr 11, 2018
Merged

run tests in ci #59

merged 11 commits into from
Apr 11, 2018

Conversation

cancan101
Copy link
Collaborator

@cancan101 cancan101 commented Nov 14, 2017

Depends on #58 (cleanup build matrix)
Depends on #60 (python 3)

@cancan101 cancan101 changed the base branch from master to cancan101-patch-1 November 14, 2017 04:14
@loli
Copy link
Owner

loli commented Nov 14, 2017

Yes... the tests are still an issue... :/

@cancan101
Copy link
Collaborator Author

Subset of tests actually do pass on 2.7 and I think the same subset should also pass on 3.5+ once the python3 PR is merged.

@cancan101 cancan101 changed the base branch from cancan101-patch-1 to master December 23, 2017 00:41
@cancan101
Copy link
Collaborator Author

@loli tests now passing. I had to add an eps to some code for python3 compat in round calls.

@cancan101
Copy link
Collaborator Author

ping

@cancan101 cancan101 requested a review from loli April 3, 2018 22:54
Copy link
Owner

@loli loli left a comment

Choose a reason for hiding this comment

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

Beside the single comment all looks perfect. Thanks again! And sorry I am responding with such delays - currently I do not have much free time at my hand.

But would love to see an official P3 release!

@@ -192,7 +193,8 @@ def template_ellipsoid (shape):
A boolean array containing an ellipsoid.
"""
# prepare template array
template = numpy.zeros([int(round(x / 2.)) for x in shape], dtype=numpy.bool) # in odd shape cases, this will include the ellipses middle line, otherwise not
# we add eps to keep old rounding up behavior
template = numpy.zeros([int(round(x / 2. + 1e-9)) for x in shape], dtype=numpy.bool) # in odd shape cases, this will include the ellipses middle line, otherwise not
Copy link
Owner

Choose a reason for hiding this comment

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

This feels a little bit hackish to me. I assume you added the eps to account for the differences in P2 and P3 round() behaviour (banker's rounding vs. to nearest even)?

I think a more elegant solution to the P2 rounding behaviour in P3 would be:

import decimal
decimal.Decimal(x / 2.).quantize(decimal.Decimal('1'), rounding=decimal.ROUND_HALF_UP)

What do you think?

@loli loli merged commit d06f33e into loli:master Apr 11, 2018
@cancan101 cancan101 deleted the enable_tests branch April 23, 2018 17:59
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