Skip to content

What to do about manager number ? #4

Closed
@tacaswell

Description

@tacaswell

At creation time each manager is assigned a number (which is either 1 or 1 higher than the currently existing number) and there is some API in pyplot to get the list of current numbers etc. Currently in mpl-gui, this number is set in the promote_figure method and is a process-globally incremented number. I think the options are:

  1. no change, the number of the manager is a vestige of an old API, it is harmless, but 🤷🏻 . Using an always incrementing counter means that we never have currently-live duplicates (because we never have duplicates)
  2. allow promote_figure to take an optional num as input (but probably still increment the counter for cases where it is not given. We can then have the registries re-implement the pyplot scheme. One wrinkle in this is if you ask for the number before all of the figures are promoted, they do not have numbers yet so either we need to pre-assign them numbers (not great, where to store that), drop them on the floor (not great, the list of figures can depend on if you called show?!), or promote but not show (probably the least-bad).
  3. make num required to promote
  4. add the notion of num to creating Figure objects.

Having written this out i'm going to go with option 2. It is not too hard to let registries maintain the old pyplot behavior and I would rather have all registries behave the same than have a custom one just for getting as close to pyplot compatibility as possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions