-
Notifications
You must be signed in to change notification settings - Fork 128
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
world.plates->numpy, some optimizations #201
Conversation
Added world.plates to the serialization-tests. Reworked center_land().
This actually looks like it should be included, because it falls under the mandate of 'use numpy, everywhere!'. @ftomassetti wouldn't you agree? |
@@ -16,19 +16,6 @@ def test_get_and_set_verbose(self): | |||
set_verbose(False) | |||
self.assertEqual(False, get_verbose()) | |||
|
|||
def test_matrix_min_and_max(self): |
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.
Why we cancel the test but not the tested function?
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.
I may have forgotten, will check that later.
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.
Code removed.
@psi29a I have nothing against it and the code seems ok to me, feel free to merge it! |
@@ -40,25 +26,6 @@ def test_counter(self): | |||
c.count("a") | |||
self.assertEqual("a : 1\nb : 3\n", c.to_str()) | |||
|
|||
def test_rescale_value(self): |
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.
We can use numpy.interp()
if something like rescale_value()
is needed. As with other functions in common.py
, it wasn't used anywhere anyway.
Comments taken care of. I also removed another test + function since it wasn't used anywhere (and, like |
Let's merge #198 and then this one before changing release number and tagging the new release |
world.plates->numpy, some optimizations
It seems I overlooked an array when making the other arrays numpy-arrays.
I stumbled over this after noticing that
center_world()
, for some reason, returned different results for Python 2 and 3 when I generated the following test-world. That is fixed with this, too.Short summary of the changes in here:
PS: Sorry for still doing stuff that is not related to an immediate release!