Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:14
    timhoffm edited #24550
  • 21:07
    timhoffm labeled #24550
  • 21:06
    timhoffm labeled #24550
  • 21:06
    timhoffm opened #24550
  • 20:29
    xapple closed #24549
  • 20:29
    xapple commented #24549
  • 20:26
    timhoffm labeled #24549
  • 20:26
    timhoffm commented #24549
  • 20:15
    Andes0113 commented #23817
  • 18:17
    xapple edited #24549
  • 18:10
    xapple opened #24549
  • 17:13
    quinnah commented #23817
  • 16:01
    ramvikrams synchronize #24548
  • 15:58
    ramvikrams opened #24548
  • 15:51
    ramvikrams closed #24547
  • 15:48
    ramvikrams opened #24547
  • 12:13
    leejjoon commented #24484
  • 12:11
    leejjoon synchronize #24484
  • 09:35

    QuLogic on main

    Add test for axis label when un… Fix unit info setting axis label Update units_rectangle baseline… and 4 more (compare)

  • 09:35
    QuLogic milestoned #23416
Thomas A Caswell
@tacaswell
unfortunately I have not had the bandwidth to push that work forward once GCOS ended, but it is still on my (semi-inifinite) queue
would not be offended if someone else worked on it though :)
matrixbot
@matrixbot
Cadair I think the GSOC approach and that approach are different, although maybe close in terms of usability
Jody Klymak
@jklymak
I didn't fully understand the GSOC approach, and it seemed rather burdensome to contributors.
matrixbot
@matrixbot
Cadair This workflow has worked well for sunpy over the last few years with some iteration. I think maybe we have a slightly easier time than mpl core would in terms of potential for subtle layout changes etc.
Thomas A Caswell
@tacaswell
the sunpy approach is to at some point generate a sha of the output and then compare against that in the future?
which means you still track all of the details about what it should be, but do not have to check the full images into the repo
matrixbot
@matrixbot
Cadair yeah, keep those hashes in the repo, and then images externally
Cadair indeed
Thomas A Caswell
@tacaswell
that still leaves you vulnerable to system-to-system changes (e.g. different freetype)
matrixbot
@matrixbot
Cadair we encode the freetype version into the hash library filename, and only do the compare if it matches
Thomas A Caswell
@tacaswell
the GSOC approach is to assume that a developer can from the current tip of the default branch generate a set of "correct" baseline images and then use those as the baseline for any changes you make
if you want to change a test image you change the file name (so it is easy to keep both old and new around)
matrixbot
@matrixbot
Cadair that sounds like it could be complementary, instead of downloading the baseline like we do, you could generate them from the default branch
Cadair with the hashes you would only need to generate ones if they didn't match
Thomas A Caswell
@tacaswell
also means you can accept small deltas because we are still using the per-pixel comparison
with vectors formats do you hash the vector file or after it has been rasterized?
matrixbot
@matrixbot
Cadair I think we have only ever done comparison to ong
Cadair *png
Cadair which is maybe another simplifying assumption that we can get away with that mpl core wouldn't be abel to
Thomas A Caswell
@tacaswell
over the summer we got through the internal changes that need to be made, but did not get to the dev-facing tools to automate the various steps
matrixbot
@matrixbot
Cadair We also haven't ever had issues with subtle changes to the images, by pinning mpl and freetype versions the hashes seem pretty stable
Thomas A Caswell
@tacaswell
or sorting out how to bend CI cache's to our will
but our goal is to un pin freetype
matrixbot
@matrixbot
Cadair that's a good goal.
Thomas A Caswell
@tacaswell
the final step is that as part of our release process we would generate a set of "blessed" baseline files for some version of freetype
matrixbot
@matrixbot
Cadair for us the bundled mpl freetype, either in wheels or downloaded at git build time has kept us snae
Thomas A Caswell
@tacaswell
so packagers can test
matrixbot
@matrixbot
Cadair *sane
Thomas A Caswell
@tacaswell
will we know if the py39 wheels work before we merge?
Elliott Sales de Andrade
@QuLogic
I haven't tested them, but the building works: https://github.com/QuLogic/matplotlib/actions/runs/335123526
Jerome Villegas
@jeromefv
Hey everyone! I looked at my notes and I'm hoping to confirm what kind of data Matplotlib manages. I have either an iterable or sequenced written down. Is there anything missing or unclear in that?
I feel like I remember having a rundown of all the containers that Matplotlib expects, but I can't remember any other details.
hannah
@story645
@jeromefv is that clear to you?
Or do you think the audience will need more details like examples of the supported containers ?
Thomas A Caswell
@tacaswell
need code to tell
Michael Waskom
@mwaskom
Here's a very quarter-baked idea I had while drinking my morning coffee ... what if matplotlib had an "opinionated API" mode (off by default) that would issue warnings when non-preferred API components (state machine interface, add_subplot(111), etc.) are used?
Jody Klymak
@jklymak
I think another approach, which we have discussed, and seems trivial, is to move plt.figure, and plt.subplots into matplotlib/__init__.py and then ask people to not do import matplotlib.pyplot as plt. That will instantly raise if they accidentally cut-and-paste some pyplot code in.
Michael Waskom
@mwaskom
so you 'd have import matplotlib as mpl; mpl.subplots()?
Thomas A Caswell
@tacaswell
The sticking point is do you want mpl to manage the figures for you or not
that is something we definitly can not pull up into the top level import
right now you can do fig = mpl.figure.Figure(); ax = fig.subplots() and get a figure fully managed by you (we hold no references to it)
but it will have the Agg canvas (not one of the GUI ones)
Jerome Villegas
@jeromefv
@story645 It's clear as someone who understands programming languages! Seeing as the survey results in most users comfortable with Python, I don't see it as an issue with the phrasing. As for examples, it'll likely be basic Python data containers and two NumPy arrays as demonstrative examples. Thanks!
Jody Klymak
@jklymak

but it will have the Agg canvas (not one of the GUI ones)

Oh, weird. I mean, why is that?

We have mpl.use so why can't we manage the backend?
Thomas A Caswell
@tacaswell
because a few versions ago @anntzer made it so that it defaults to an Agg canvas instead of None
when you do plt.figure we are creating a Figure, a canvas (of the correct GUI class), a manager, a window, a toolbar, and registering the manger with our global registry of open figures
Michael Waskom
@mwaskom
so the advantage of my original suggestion was that all of the many many snippets (e.g. on stackoverflow) of matplotlib code that is functional but uses outdated APIs will still work, while still guiding you towards the best way to accomplish the same thing