Skip to content

feat: Add temporal support#1475

Draft
hoxbro wants to merge 3 commits into
mainfrom
feat_temporal_support
Draft

feat: Add temporal support#1475
hoxbro wants to merge 3 commits into
mainfrom
feat_temporal_support

Conversation

@hoxbro

@hoxbro hoxbro commented Jan 14, 2026

Copy link
Copy Markdown
Member

Still very much WIP... needs to be cleaned up.

Playground code used:

import numpy as np
import pandas as pd

import datashader as ds

# TODO: NaT support, unit check, bounds check (already set), tz support, verify it is 64
n = 1000
dts = pd.date_range("2026-01-01", periods=n, freq="h")  # .astype(int) works
dts = pd.date_range("2026-01-01", periods=n, freq="h", tz="UTC")  # .astype(int) works

#dts = dts.astype("datetime64[ms]")
a = pd.timedelta_range(start='1s', periods=n)

# Create a DataFrame with some values
df = pd.DataFrame(
    {
        "x": np.random.choice(dts, size=n),
        "y": np.random.choice(a, size=n),
        "value": np.random.randn(n),
    }
)
df.iloc[0, 0] = pd.NaT

# Create canvas
canvas = ds.Canvas(
    plot_width=800,
    plot_height=400,
    x_range=(dts[1], dts[-1]),
   # x_axis_type = "datetime",
   # y_axis_type = "datetime",
)

# Aggregate the data by summing the 'value' column
agg = canvas.points(df, "x", "y", agg=ds.mean("value"))

# Convert to image
import datashader.transfer_functions as tf

tf.shade(agg)

@codspeed-hq

codspeed-hq Bot commented Jan 15, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 28.07%

⚡ 1 improved benchmark
✅ 42 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation test_layout[forceatlas2_layout] 58.5 ms 45.6 ms +28.07%

Comparing feat_temporal_support (4b21c4b) with main (77d4174)

Open in CodSpeed

@codecov

codecov Bot commented Jan 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.10843% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.37%. Comparing base (77d4174) to head (4b21c4b).

Files with missing lines Patch % Lines
datashader/core.py 66.66% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1475      +/-   ##
==========================================
- Coverage   88.42%   88.37%   -0.06%     
==========================================
  Files          96       96              
  Lines       19226    19289      +63     
==========================================
+ Hits        17001    17046      +45     
- Misses       2225     2243      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hoxbro hoxbro marked this pull request as draft January 15, 2026 17:04
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.

1 participant