-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Support selections across all dimensions in element.dataset #3924
Conversation
When select is performed on a Histogram element that has .dataset and ._operation_kwargs properties, regenerate the histogram using the selected data.
47b54db
to
7083f6b
Compare
@jonmmease I really like this functionality but I have some issues about the semantics of selecting on dimensions on an element that aren't declared as kdims and vdims...especially if the If a Is there a reason a |
Thanks for taking a look @jlstevens. The goal is for If we rewrite how |
@philippjfr before I make any other changes here, how do you feel about the |
The warning is raised only when accessing .dataset, right? If so, what are the cases when that attribute would be accessed on a Histogram? |
It would only be when a user is checking the value of the property manually. The only reason to do this, that I have in mind, is to check to see which variables are available for use with |
@jlstevens in 0a917a7 I made sure that But this wasn't the only case.
I don't see a workaround for this. Do you? |
I think that's fine and see no need for a warning. |
I'm not sure what you mean by this. It definitely is compatible with certain Dataset interfaces, specifically the GridInterface. |
This avoids problems with building Dataset from partially constructed object. And now .dataset is never None
Yeah, never mind. I was running into problems with trying to construct a With this change, |
Closing in favor of the new pipeline approach implemented in #3967 |
Overview
This PR builds on top of following PRs:
It updates the
Dataset.select
method to support down selecting an element using all of the dimensions in the element's.dataset
property. Without this, it's only possible to down select elements using the key and value dimensions.Example 1: Points
Create a sample 3-dimensional dataset.
x
andy
are independently drawn from the standard normal distribution andr
is calculated to be the radius of each point from the origin.Then create a
Points
element from this dataset withx
andy
as key dimensions.Prior to #3919, the
points
object would not have dimension information aboutr
, so it would not be possible to perform a selection onpoints
usingr
. But, with the addition of the.dataset
property (and the changes in this PR), it's now possible to perform a selection usingr
as well.Perform selection using
x
(a key dimension) andr
(neither a key nor value dimension):Example 2: Histogram
This PR uses #3921 to support rebinning the histogram samples in response to selections.
Here's an example of performing a selection directly on the histogram element that uses both
x
(the histogram's key dimension) andr
(neither a key nor value dimension):This example also demonstrates the dim expression support that was added to
select
in #3920.