Skip to content

Rename mosaic layout #20150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 6, 2021
Merged

Conversation

tacaswell
Copy link
Member

PR Summary

This gives us the option to in the future combine tight_layout and constrained_layout into a single layout kwarg.

Even though this is provisional so I do not think we need to do a deprecation cycle, we may want to hold adding the layout kwarg until 3.6?

I took this opportunity to update the tutorial to use fig.subfigures() as well!

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@tacaswell tacaswell added this to the v3.5.0 milestone May 4, 2021
@tacaswell tacaswell requested review from jklymak and timhoffm May 4, 2021 02:28
tacaswell added 3 commits May 4, 2021 10:40
This gives us the option to in the future combine *tight_layout*
and *constrained_layout* into a single *layout* kwarg.
@tacaswell tacaswell force-pushed the rename_mosaic_layout branch from 66e51af to 5d25e1f Compare May 4, 2021 14:50
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Even though we may not decide to use "layout" for the other kwarg, changing this name to something less generic seems helpful.

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% happy with the name mosaic. In particular when this is picked up as a variable name

mosaic = """AA
            BC"""

it feels a little vague. But I don't have a bette name.

Side remark: The short-hand "AA;BC" should be mentioned in the tutorial as well.

@timhoffm
Copy link
Member

timhoffm commented May 4, 2021

I'm unclear if we should introduce or pre-announce this in 3.4.2. The faster we make the change the better.

Similarly, we may still consider pushing for layout in 3.5. The sooner we change away from constrained_layout=True the less people have to re-learn. I assume constrained_layout is still in the phase of picking up. That faster change would come at the cost of the (likely) one person who uses subplots_mosaic by kwarg only. I'd take the risk of that very unlikely break to move the majority to a better layout parameter API earlier.

@tacaswell
Copy link
Member Author

I am 👍 on backporting this for 3.4.2, contrary to my normally conservative position on these sorts of things. My reasoning is that given that we labeled this as provisional, then we should have the courage of our convictions and treat it as provisional! Setting that precedent is probably a good thing and this seems like a low-stakes case to try that in.

I did consider leaving the variable as mosaic as the variable the tutorial, but went with changing it everywhere. Would going with variables like

AABC = "AA;BC"

be better?

I agree we should show of the short hand, I'll add that section once we agree on the variable names.


I would also propose that with this name change we make mosaic non-provisional for 3.5, but I'll do that after this is in.

@timhoffm
Copy link
Member

timhoffm commented May 5, 2021

Would going with variables like

AABC = "AA;BC"

be better?

Um, no. That's rather cryptic and it's not a pattern that scales. FWIW the single-line pattern should be inlined most of the time: subplot_mosaic('AA;BC').

What about alternative names:

  • arrangement
  • formation
  • structure
  • placement
  • zones

@WeatherGod
Copy link
Member

WeatherGod commented May 5, 2021 via email

@timhoffm
Copy link
Member

timhoffm commented May 6, 2021

@WeatherGod not sure you got the context right. The function name will stay. It's only the name of the first argument.

Up to now:
subplot_mosaic(layout, ...).

Future:
subplot_mosaic(mosaic, ...) or
subplot_mosaic(arrangement, ...) or ...

@anntzer
Copy link
Contributor

anntzer commented May 6, 2021

fwiw I think using mosaic as param name is just fine.

@jklymak jklymak merged commit 40862a3 into matplotlib:master May 6, 2021
@jklymak
Copy link
Member

jklymak commented May 6, 2021

Not sure if this should be backported to 3.4.2?

@tacaswell tacaswell deleted the rename_mosaic_layout branch May 6, 2021 23:03
@tacaswell
Copy link
Member Author

oh, we should have talked about this on the call!

@jklymak
Copy link
Member

jklymak commented May 6, 2021

I'd backport it?

@brunobeltran
Copy link
Contributor

+1 for backporting

@tacaswell
Copy link
Member Author

@meeseeksdev backport to v3.4.x

This will need a bit of extra work from @QuLogic to merge the api change note in.

@lumberbot-app
Copy link

lumberbot-app bot commented May 7, 2021

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v3.4.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 40862a32e86ed3a9a67790dc249da13971f1a37d
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #20150: Rename mosaic layout'
  1. Push to a named branch :
git push YOURFORK v3.4.x:auto-backport-of-pr-20150-on-v3.4.x
  1. Create a PR against branch v3.4.x, I would have named this PR:

"Backport PR #20150 on branch v3.4.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

tacaswell pushed a commit to tacaswell/matplotlib that referenced this pull request May 7, 2021
Merge pull request matplotlib#20150 from tacaswell/rename_mosaic_layout

Rename mosaic layout
@tacaswell
Copy link
Member Author

sigh, doing the manual backport.

tacaswell pushed a commit to tacaswell/matplotlib that referenced this pull request May 7, 2021
Merge pull request matplotlib#20150 from tacaswell/rename_mosaic_layout

Rename mosaic layout
tacaswell pushed a commit to tacaswell/matplotlib that referenced this pull request May 7, 2021
Merge pull request matplotlib#20150 from tacaswell/rename_mosaic_layout

Rename mosaic layout
QuLogic added a commit that referenced this pull request May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants