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

Remove strong dependency on matplotlib #872

Merged
merged 4 commits into from Mar 5, 2018

Conversation

Projects
None yet
4 participants
@tammoippen
Contributor

tammoippen commented Dec 13, 2017

PyNEST only uses pylab (matplotlib.pylab) in raster_plot and voltage_trace. In
tests, this matplotlib is mostly optional - except for test_sp/test_growth_curves.py.
This PR makes matplotlib completely optional for test.

Making matplotlib optional will greatly simplify maintaining the nest homebrew formula in homebrew-core, as homebrew-science will be deprecated.

@jakobj

This comment has been minimized.

Show comment
Hide comment
@jakobj

jakobj Dec 20, 2017

Contributor

Nice! How about using the full try,except,else construct:

try:
    import pylab
except ImportError:
    pass
else:
    <plot stuff>

This isolated the exception a bit better ;)
Otherwise 👍 from me

Contributor

jakobj commented Dec 20, 2017

Nice! How about using the full try,except,else construct:

try:
    import pylab
except ImportError:
    pass
else:
    <plot stuff>

This isolated the exception a bit better ;)
Otherwise 👍 from me

@jakobj

jakobj approved these changes Dec 21, 2017

Beautiful :)

@heplesser

@tammoippen Thanks for this nice fix! But I am seriously wondering about why we have this plot in the test at all!? The code does, as far as I can see, nothing except check that plotting works. So I would remove it completely. I suppose the plot is here because we converted an example into a test at some point.

@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen Feb 5, 2018

Contributor

@heplesser Please can you clearify that for me:

@heplesser

   to move the definition of the plot() method to right before

Which version are you referring to? The complete _plot code in the try: block?

Contributor

tammoippen commented Feb 5, 2018

@heplesser Please can you clearify that for me:

@heplesser

   to move the definition of the plot() method to right before

Which version are you referring to? The complete _plot code in the try: block?

tammoippen added some commits Dec 12, 2017

Remove strong dependency on matplotlib
PyNEST only uses pylab (matplotlib.pylab) in `raster_plot` and `voltage_trace`. In
tests, this matplotlib is mostly optional. This makes matplotlib completely optional
for test.
@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen Feb 19, 2018

Contributor

I applied the changed I suggest @heplesser asked me to do. This PR is hindering nest to be accepted in homebrew core since Dec 13, 2017. I get no replies since Jan 15. Can somebody please have a look?

Contributor

tammoippen commented Feb 19, 2018

I applied the changed I suggest @heplesser asked me to do. This PR is hindering nest to be accepted in homebrew core since Dec 13, 2017. I get no replies since Jan 15. Can somebody please have a look?

@heplesser

@tammoippen We discussed this during our ongoing hackathon and concluded that test should not contain any plotting, and that "try import except pass" can be dangerous in tests. Could you explicitly remove all plotting-related code?

@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen Mar 5, 2018

Contributor

@heplesser Done as requested.

Contributor

tammoippen commented Mar 5, 2018

@heplesser Done as requested.

@heplesser heplesser merged commit 71f2f1f into nest:master Mar 5, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen Mar 5, 2018

Contributor

Thanks! 🎉 🍰

Contributor

tammoippen commented Mar 5, 2018

Thanks! 🎉 🍰

@tammoippen tammoippen deleted the tammoippen:rm-matplotlib branch Mar 5, 2018

@tammoippen tammoippen referenced this pull request Mar 6, 2018

Closed

nest: migrate to homebrew/core #24908

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment