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

Figure select function selector #2844

Merged
merged 7 commits into from
Oct 20, 2020

Conversation

nicholas-esterer
Copy link
Contributor

Closes #2629 and more.
Any function calling BaseFigure._selector_matches can now pass a function for the selector argument. This function is called on each object and if it returns True, then that object is included in the selection.

Any function that calls BaseFigure._selector_matches can use a function
as the selector. This includes the "Figure.for_each_*" functions, the
"Figure.update_*" functions, and the "Figure.select_*" functions.

See test_selector_matches.py for the behaviour of the selector argument.
@nicolaskruchten
Copy link
Contributor

Superseded by #2844 I imagine? Can close?

@nicolaskruchten
Copy link
Contributor

I meant: supersedes #2836 therefore we can close that one!

else:
raise TypeError(
"selector must be dict or a function "
"accepting a trace returning a boolean."
Copy link
Contributor

Choose a reason for hiding this comment

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

this is now more than just "a trace" right? maybe "a graph object" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yes, copy paste error! good catch 👍

@nicolaskruchten
Copy link
Contributor

Nicely done!

💃 when you address my comment about trace above and you add a changelog entry :)

@nicolaskruchten
Copy link
Contributor

Looks great, please merge!

@nicholas-esterer nicholas-esterer merged commit 31179ae into master Oct 20, 2020
@nicholas-esterer nicholas-esterer deleted the figure-select-function-selector branch October 20, 2020 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

select traces doesn't do partial matches on meta
2 participants