Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fixed #24617 bug - Added subplot params and figsize getter setter methods to Figure.__init__ with tests#29116

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Thanushri16 wants to merge5 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromThanushri16:bugfix_24617_25091

Conversation

Thanushri16
Copy link

PR summary
This is the first PR I am proposing and this PRfixes#24617 - [ENH]: Add setter/getter methods for all keyword parameters to Figure.init
Few of the arguments passed to Figure.init did not have matching get_{kwarg}/set_{kwarg} methods on Figure (Bug #24617).
This PR focuses on adding getter/setter methods and test coverage for the following:

  • figsize (which wraps around get_size_inches and set_size_inches)
  • subplotparams

What problem does this PR solve?
Two of the properties/parameters of Figure class didn't have getter/setter methods implemented - figsize, subplotparams. Without these getter/setter methods, use of the properties in the Figure class is inconsistent and neither does the class provide a way to set properties for these two attributes without the getter/setter methods.

Relevant PRs (Both of these PRs have failing tests and failing checks for PR reviews):

  1. PR #25901 - This PR focuses on getter/setter methods to resolve Bug[ENH]: Add setter/getter methods for all keyword parameters to Figure.__init__ #24617 . The PR encounters AttributeError: 'Figure' object has no attribute 'get_subplotpars' that is not resolved and also has failing PR checks.
  2. PR #28936 - This PR resolves the AttributeError issues inPR #25901. However, the PR still had some failing test cases in pytest and has some failing PR checks.

PR checklist:

##Review
Since, this is my first contribution in the open source, I would like to know the feedback and tips to improve my contributions.

…n getter setter for subplot param and figsize
Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

self.set_subplotparams(self.get_subplotparams())
self.subplots_adjust(**kwargs)

def get_subplotparams(self):
Copy link
Member

Choose a reason for hiding this comment

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

This method is not run by the tests because you replaced it in theFigure subclass, so only the subclass one gets run by your new test. I'm not too familiar with subplotparams but, as far as I can see, they only exist on aFigure and not on aSubFigure so both these methods could go directly on theFigure class.

Copy link
Author

Choose a reason for hiding this comment

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

@rcomer Fixed the above inheritance issue. Thanks for pointing it out. I've moved the definitions to Figure and all the pytest cases passed locally. Could you please review my failing pytest macOS tests?

Copy link
Member

Choose a reason for hiding this comment

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

Those MacOS ones are often flakey. I’ve re-started them to see if they do better this time 🤞

Copy link
Member

Choose a reason for hiding this comment

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

For the documentation failure Ithink you just need to add your new methods to an appropriate section here, to make them show up in the docs:
https://github.com/matplotlib/matplotlib/blob/main/doc/api/figure_api.rst

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@rcomerrcomerrcomer left review comments

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
Status: Needs review
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[ENH]: Add setter/getter methods for all keyword parameters to Figure.__init__
2 participants
@Thanushri16@rcomer

[8]ページ先頭

©2009-2025 Movatter.jp