Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:01
    devRD opened #25155
  • 04:26

    ksunden on v3.7.x

    Backport PR #25151: Increase ti… Merge pull request #25154 from … (compare)

  • 04:25
    ksunden closed #25154
  • 01:33
    xtiansimon commented #18292
  • 01:33
    xtiansimon commented #18292
  • 00:12
    jklymak synchronize #25144
  • 00:11
    jklymak synchronize #25144
  • Feb 04 23:31
    hasanrashid synchronize #24878
  • Feb 04 23:15
    anntzer commented #17497
  • Feb 04 23:15
    anntzer commented #17497
  • Feb 04 23:15
    anntzer ready_for_review #17497
  • Feb 04 22:03
    github-actions[bot] unlabeled #17497
  • Feb 04 22:03
    anntzer synchronize #17497
  • Feb 04 21:57
    hasanrashid synchronize #24878
  • Feb 04 21:36
    meeseeksdev[bot] labeled #25154
  • Feb 04 21:36
    meeseeksdev[bot] milestoned #25154
  • Feb 04 21:36
    meeseeksdev[bot] milestoned #25154
  • Feb 04 21:36
    meeseeksmachine opened #25154
  • Feb 04 21:36

    dstansby on main

    Increase timeout to GitHub API Merge pull request #25151 from … (compare)

  • Feb 04 21:35
    dstansby closed #25151
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
Antony Lee
@anntzer
no, it doesn't default to agg
it defaults to figurecanvasbase
however, if you decide to do a savefig with it, we know that if you want to save a png you can use agg (or if you want to save a pdf you can use the pdf backend, etc.) and we temporarily switch the backend just for the duration of the save
(I would certainly not want to make things default to agg :))
Jody Klymak
@jklymak

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

Sure, but why does that have to live in pyplot?

Thomas A Caswell
@tacaswell
because that is coupled to the global registry
Jody Klymak
@jklymak
I'm not at all familiar with the ins and outs, but it looks like it is all managed by _pylab_helper.Gcf class? Are there other hooks to pyplot in there? I'm certainly not saying get rid of pyplot, so if someone did import pyplot and do plt.gcf() that should be fine and could raise the last created figure. But if they didn't import pyplot they would protect themselves from plt.pcolormesh
Thomas A Caswell
@tacaswell
right _pylab_helper.Gcf is the implementation of the global state tracking
@anntzer sorry, I knew that
Thomas A Caswell
@tacaswell
If we are going to create GUI windows for the user then that implies we must create (or discover the existing singleton) of what ever object the toolkit uses to give you access to the main loop. At that point we are (more-or-less) a full-on GUI application (just driven 100% from the terminal!). If we are going to create new windows under the GUI framework we should keep track of them (as there are apparently ways to orphan them, we have at least 1 qt bug for this). That global state of "the currently open windows" is what can not be done at the top level of mpl. If we wanted a "figure factory and management only" module that only gives you figure, subplots, and subplots_mosaic that seems reasonable.
Antony Lee
@anntzer

If we are going to create new windows under the GUI framework we should keep track of them

I do not understand this statement

we could certainly imagine a model where the call to show is spelt plt.show([fig1, fig2, ...]) (for example) (I think I have a PR enabling that somewhere...)
and I guess even if we do keep track of them so that plt.show() magically pops up all figures, that doesn't mean that we have to have a notion of current figure
Jody Klymak
@jklymak
Whether we keep track of current figure is a bit orthogonal. I wasn’t saying we should stop doing that. I still don’t understand why this can’t be done at the top level.
Thomas A Caswell
@tacaswell
Are we sure that all of the GUI frameworks "do the right thing" when the python side gets gc'd?