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

fix set_pickradius and set_picker conflict#26682

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
fernandaitoda wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromfernandaitoda:fix-setpickradius

Conversation

fernandaitoda
Copy link

@fernandaitodafernandaitoda commentedSep 2, 2023
edited
Loading

PR summary

Fix conflict with _pickradius "losing" its value when set_picker was used after set_pickradius for 2D Lines.
Set_picker now setting value as described in documentation (float type for _pickradius)

PR

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.

@ksunden
Copy link
Member

Artist.set_pickerexplicitly accepts bothNone and bool inputs.

However,Line2D.set_pickeris not documented to accept these types.

My instinct is to be in favor of supporting them, as they are supported by the superclass, however, I think that we should also update the docstring (and type hints, for that matter).

@fernandaitoda
Copy link
Author

should I update this in this PR? Or maybe start a feature type issue with this?

@ksunden
Copy link
Member

I would lean toward it being done together, but yeah, some care to be taken in making it behave as expected (with some weight towards existing behavior, at least for the case offloat input)

Also consider integer input (e.g.5 in the original report),isinstance(5, float) is false...

But further beware ofisinstance(True, int), which is true.

We may have to explicitly handle the None/boolean cases here instead.

@fernandaitoda
Copy link
Author

actually, when I set a integer value,isinstance(x, float) returns true, so it fixes the original report (I tested it). I don't know exactly why this happens but I found some people trying to check if a input wereint orfloat andisinstance wasn't working for them.
I could do something like:

if float(i).is_integer():        // int values    else:        // float values

but I don't know if it's necessary. What do you think?

@ksunden
Copy link
Member

isinstance(3, float) certainly returnsFalse, so not sure what you mean?

certainly you can pass the otherwise equivalent3.0 which will returnTrue, but it is possible to pass an int which does not pass theisinstance check. and also it is certain that if we want special handling for bools we have to be careful ofisinstance checks for ints still too.

It is not the case that integers need to be handled differently than floats, other than that bools count as integers.

@fernandaitoda
Copy link
Author

hello, I'm having a problem with matplotlib installation in my ve, i think it's a problem with my operational system and I'll have to format my computer, but I'm waiting till the end of semester for it. To get this PR accepted I should change this details you mentioned, right?

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

@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: Waiting for author
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[Bug]: <artist>.set_picker(True) destroys value of <artist>.pickradius(5)
3 participants
@fernandaitoda@ksunden@melissawm

[8]ページ先頭

©2009-2025 Movatter.jp