Skip to content
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

Check if functions need to be called instead of always doing so. #193

Open
ianhi opened this issue May 27, 2021 · 0 comments
Open

Check if functions need to be called instead of always doing so. #193

ianhi opened this issue May 27, 2021 · 0 comments
Labels
enhancement New feature or request performance

Comments

@ianhi
Copy link
Collaborator

ianhi commented May 27, 2021

Problem

Because user functions get called for all kwargs that are registered, including any kwargs that were added as scalars for things like alpha. For example:

def test_imshow_scalars():
    # and by proxy all the scalar handling
    def mask(min_distance):
        return np.random.randn(10, 10)

    fig, ax = plt.subplots()
    iplt.imshow(mask, min_distance=(1, 10), alpha=(0, 1))

changes the array for every change of alpha. I'd expect it to not do this - this is also a detriment to performance.

Proposed Solution

  1. Some sort of caching of args and checking them
  2. Multiple calls to add_kwargs that deal with the scalar kwargs

Additional context

@ianhi ianhi added enhancement New feature or request performance labels May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

No branches or pull requests

1 participant