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

Bump scipy and matplotlib dependencies #757

Merged
merged 2 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions neurom/tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
these tests are only sanity checks.
'''

import sys
from neurom import stats as st
from nose import tools as nt
import numpy as np
Expand Down Expand Up @@ -166,11 +167,17 @@ def test_compare_two():

results2 = st.compare_two(data, data_close, test=st.StatTests.ks)
nt.assert_almost_equal(results2.dist, 0.5)
nt.assert_almost_equal(results2.pvalue, 0.5344157, places=5)
if sys.version_info[0] == 2:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this is not scary, I don't know what is

Copy link
Collaborator

Choose a reason for hiding this comment

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

something is wrong, it's too much of a divergence; I'd be surprised if it is on scipy's side, so I think we should find the root cause before implementing a version test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given that scipy is the only thing that changed wrt previous commit I think it is on scipy's side. But yes, I'll investigate more.

Copy link
Collaborator

Choose a reason for hiding this comment

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

do the different python versions get different scipy versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, 1.3.0 has not been released for python2

Copy link
Collaborator

Choose a reason for hiding this comment

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

@lidakanari Do you have any idea how much the stats functionality is used?

It seems to mostly be a wrapper around scipy, and since scipy is augmenting their api, I wonder how much we should mirror it as opposed to letting the user directly call scipy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I am running these tests independently, but I had a few questions from users taking advantage of our scipy wrappers. However, the validation suite uses scipy and ks_2samp so I think it is worth investigating what is the impact of this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we could add a deprecation notice and remove it in a few months ?

Copy link
Contributor

@lidakanari lidakanari May 22, 2019

Choose a reason for hiding this comment

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

Is this used in the validations? If so, we need to replace it otherwise it will break the pipeline for circuit validations. Yes, the deprecation warning will definitely be useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the validation pipeline ? Is it a repo ?

nt.assert_almost_equal(results2.pvalue, 0.5344157192165071, places=5)
else:
nt.assert_almost_equal(results2.pvalue, 0.7714285714285716, places=5)

results3 = st.compare_two(data, data_far, test=st.StatTests.ks)
nt.assert_almost_equal(results3.dist, 1.0)
nt.assert_almost_equal(results3.pvalue, 0.0205039, places=5)
if sys.version_info[0] == 2:
nt.assert_almost_equal(results3.pvalue, 0.020503981704794276, places=5)
else:
nt.assert_almost_equal(results3.pvalue, 0.05714285714285727, places=5)

distr1 = np.ones(100)
distr2 = 2*np.ones(100)
Expand Down Expand Up @@ -226,5 +233,3 @@ def test_total_score():

score = st.total_score(testList3, p=2)
nt.assert_almost_equal(score, np.sqrt(2.))


3 changes: 2 additions & 1 deletion neurom/view/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ def plot_style(fig, ax, # pylint: disable=too-many-arguments, too-many-locals
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)

ax.set_aspect(aspect_ratio)
if ax.name != '3d':
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without the if, matplotlib says:

NotImplementedError: It is not currently possible to manually set the aspect on 3D axes

ax.set_aspect(aspect_ratio)

if tight:
fig.set_tight_layout(True)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
'numpy>=1.8.0',
'pylru>=1.0',
'pyyaml>=3.10',
'scipy>=0.17.0',
'scipy>=1.2.0',
'tqdm>=4.8.4',
'future>=0.16.0',
]
Expand Down