Giter Club home page Giter Club logo

Comments (8)

cdeil avatar cdeil commented on July 18, 2024

This is the test_image_example I added today that uses pytest-mpl.

For some reason the image that was generated on my computer and travis-ci has shape 800 x 600, and @bsipocz, on your computer 880 x 660.

@bsipocz @astrofrog – Any idea what needs to be changed to get reproducible image size on all computers? What's the recommended pattern to do this?

from astroplan.

astrofrog avatar astrofrog commented on July 18, 2024

Differences can be due to differing matplotlibrc files. Can you both check whether you have an active matplotlibrc file?

Ideally I think we should save a JSON dictionary of the RC params with each figure to ensure reproducibility, and it's on my to-do list for pytest-mpl.

from astroplan.

bsipocz avatar bsipocz commented on July 18, 2024

Good point, indeed I have u'figure.figsize': [8.8, 6.6], set in rcParams.

from astroplan.

cdeil avatar cdeil commented on July 18, 2024

So what I have is with default setting for matplotlib 1.4.
So those tests would break when matplotlib 2.0 comes out soon with a new style.

@astrofrog – Defining our own plotting style for astroplan should be enough to keep these tests future-proof? (We plan to do this soon: #74) Or what's the recommended pattern to set this up in a robust way?

from astroplan.

cdeil avatar cdeil commented on July 18, 2024

Moving this to 0.2 ... it shouldn't block the 0.1 release which is long overdue.

from astroplan.

bmorris3 avatar bmorris3 commented on July 18, 2024

Pinging @astrofrog again to see if he has a solution to this issue.

from astroplan.

astrofrog avatar astrofrog commented on July 18, 2024

@bmorris3 - I have a solution, in my head, I just haven't had a chance to implement it yet ;)

Though actually for now, you can emulate this solution by resetting the rc parameters to the default at the start of the test:

plt.rcParams.clear()
plt.rcParams.update(plt.rcParamsDefault)

and be sure to re-generate the image.

from astroplan.

wtgee avatar wtgee commented on July 18, 2024

Marking Issue as stale and closing. Please re-open if still affected by this 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.