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

Make the filternorm prop of Images a boolean rather than a {0,1} scalar.#10442

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

Merged
QuLogic merged 1 commit intomatplotlib:masterfromanntzer:filternorm
Apr 11, 2018

Conversation

anntzer
Copy link
Contributor

This seems a bit more pythonic and the C-API handles bools just as well.
Also filternorm and filterrad are always defined (as bool and float,
respectively, so no need to add... or 0.0 when passing them to the
C-API.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzeranntzer added this to thev3.0 milestoneFeb 13, 2018
@QuLogic
Copy link
Member

A little bit of this is part of#10383.

@anntzer
Copy link
ContributorAuthor

seems easy to rebase in either direction

This seems a bit more pythonic and the C-API handles bools just as well.Also filternorm and filterrad are always defined (as bool and float,respectively, so no need to add `... or 0.0` when passing them to theC-API.
filternorm : scalar, optional, default: 1
A parameter for the antigrain image resize filter. From the
antigrain documentation, if `filternorm` = 1, the filter
filternorm : bool, optional, default: True
Copy link
Member

Choose a reason for hiding this comment

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

OK, sofilternorm was either 1 or zero?

The rest of this docstring doesn't make a lick of sense to me. I think they are trying to say the sum of the filter should be one, but???

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Feel free to propose a better wording :-) (it doesn't make sense to me either)
At least since#10383matplotlib._image.resample also documentsnorm as a bool.

@timhoffm
Copy link
Member

timhoffm commentedApr 8, 2018
edited
Loading

Concerning removal of... or 0.0:

What if users have usedfilterrad=False orfilterrad=0? Until now, theor has silently cast them to float. Do it still work? At least the second one should.

@anntzer
Copy link
ContributorAuthor

set_filterrad has a check:

    def set_filterrad(self, filterrad)        """```        Set the resize filter radius only applicable to some        interpolation schemes -- see help for imshow        ACCEPTS: positive float        """        r = float(filterrad)        if r <= 0:            raise ValueError("The filter radius must be a positive number")        self._filterrad = r        self.stale = True

so the proposed case cannot occur.

@QuLogicQuLogic merged commite18af55 intomatplotlib:masterApr 11, 2018
@anntzeranntzer deleted the filternorm branchApril 11, 2018 02:24
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak left review comments

@QuLogicQuLogicQuLogic approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.0.0
Development

Successfully merging this pull request may close these issues.

4 participants
@anntzer@QuLogic@timhoffm@jklymak

[8]ページ先頭

©2009-2025 Movatter.jp