Giter Club home page Giter Club logo

Comments (5)

cdeil avatar cdeil commented on August 17, 2024

This is not an astroplan-specific issue.
The tests for other Astropy-affiliated packages fail or even crash if DISPLAY isn't configured correctly and a matplotlib plot is made.

The solution is to set DISPLAY e.g. like this
https://github.com/astrofrog/wcsaxes/blob/master/.travis.yml#L75

    # Make sure that interactive matplotlib backends work
    - export DISPLAY=:99.0
    - sh -e /etc/init.d/xvfb start
    # Make sure matplotlib uses PyQT not PySide
    - export QT_API=pyqt

Maybe @mdboom or @astrofrog can comment if there is something in the Astropy test runner that can automatically handle this?
Or maybe this is just something that should be documented for users / contributors, e.g. here?
http://astropy.readthedocs.org/en/latest/known_issues.html#build-installation-test-issues

from astroplan.

astrofrog avatar astrofrog commented on August 17, 2024

The fix @cdeil points out is the correct one. The issue is that really matplotlib should default to non-interactive Agg, but not quite sure why it doesn't when we run tests.

from astroplan.

cdeil avatar cdeil commented on August 17, 2024

@astrofrog I just thought of something ... can't we just add

import matplotlib
matplotlib.use('agg')

in the pytest setup (e.g. here: https://github.com/astropy/astroplan/blob/master/astroplan/conftest.py#L34) so that matplotlib tests for all users run with a non-interactive matplotlib backend?
No more fiddling with DISPLAY or pop-up windows when running the tests.

from astroplan.

astrofrog avatar astrofrog commented on August 17, 2024

@cdeil - I tried that before, but had issues with it related to the fact pytest imports the module before running its setup. In other words, astroplan has to be imported before conftest.py is. If importing astroplan causes matplotlib to be imported, then it won't work. But otherwise it's worth the try.

from astroplan.

bmorris3 avatar bmorris3 commented on August 17, 2024

No longer an issue, and as @cdeil points out, probably not an astroplan issue.

from astroplan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.