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

Enable changing dtypes for decimate #5790

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

chrisbotica
Copy link

This fixes the issues uncovered in #5789 : Select_mask & decimate fail when dtype changes from numeric to date time. Note that without the workaround in #5789, the two bugs are first hidden by the issue in #5405..

This PR:

  • updates the element interface mask to allow for np.nan
    • The mask initialization fails to catch changing dtype (e.g., np.nans from datetime objects). "None" types will not account for these
  • changes the decimate xy lims to current element ranges
    • For decimate, the plot range updates slower than the element range (e.g., whenever the x, y dtypes change from a dynamic map). The element range reflect the current ranges in the new dtype, whereas the self.p.range reflects the previous dtype

The mask initialization fails to catch changing dtype (e.g., np.nans from datetime objects). "None" types will not account for these
For decimate, the plot range updates slower than the element range (e.g., whenever the x, y dtypes change from a dynamic map). The element range reflect the current ranges in the new dtype, whereas the self.p.range reflects the previous dtype
@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2023

Codecov Report

Merging #5790 (09456e3) into main (3f97338) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #5790   +/-   ##
=======================================
  Coverage   88.14%   88.14%           
=======================================
  Files         307      307           
  Lines       62850    62850           
=======================================
  Hits        55401    55401           
  Misses       7449     7449           
Flag Coverage Δ
ui-tests 22.41% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
holoviews/core/data/interface.py 90.61% <100.00%> (ø)
holoviews/operation/element.py 71.79% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -899,8 +899,8 @@ def _process_layer(self, element, key=None):
if element.interface not in column_interfaces:
element = element.clone(tuple(element.columns().values()))

xstart, xend = self.p.x_range if self.p.x_range else element.range(0)
ystart, yend = self.p.y_range if self.p.y_range else element.range(1)
xstart, xend = element.range(0)
Copy link
Member

@philippjfr philippjfr Jul 24, 2023

Choose a reason for hiding this comment

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

This doesn't seem correct, it is important that you can pass in the requested x_range and y_range

Copy link
Member

@philippjfr philippjfr 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 @chrisbotica! The changes for the nan handling seem good but passing in the x_range and y_range to select on is essential to the operation.

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.

3 participants