Skip to content

Commit 9306b39

Browse files
committed
📝 remove debug print statement and enhance type handling for hf_x
1 parent 6e14efa commit 9306b39

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

plotly_resampler/figure_resampler/figure_resampler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,6 @@ def show_dash(
625625

626626
# function signatures are slightly different for the (Jupyter)Dash and the
627627
# JupyterDashInlinePersistent implementations
628-
print("kwargs", kwargs)
629628
if mode == "inline_persistent":
630629
jpi = JupyterDashPersistentInlineOutput(self)
631630
jpi.run_app(app=app, **kwargs)

plotly_resampler/figure_resampler/figure_resampler_interface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ def _parse_get_trace_props(
576576
A namedtuple which serves as a datacontainer.
577577
578578
"""
579-
hf_x: np.ndarray = (
579+
hf_x: np.ndarray | pd.Index = (
580580
# fmt: off
581581
(np.asarray(trace["x"]) if trace["x"] is not None else None)
582582
if hasattr(trace, "x") and hf_x is None
@@ -591,6 +591,8 @@ def _parse_get_trace_props(
591591
else np.asarray(hf_x)
592592
# fmt: on
593593
)
594+
if pd.core.dtypes.common.is_datetime64_any_dtype(hf_x):
595+
hf_x = pd.Index(hf_x)
594596

595597
hf_y = (
596598
trace["y"]

tests/test_aggregators.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,6 @@ def test_MinMaxLTTB_size():
365365
mmltb = MinMaxLTTB()
366366
for n_out in np.random.randint(500, 1_000, size=3):
367367
assert n_out == mmltb._arg_downsample(x, y, n_out).shape[0]
368+
369+
370+
# TODO: add tests for all the supported data types?

0 commit comments

Comments
 (0)