Skip to content

v0.61.0 - Time-Series Resampling (2026-04-03)

What Changed?

This release adds comprehensive time-series resampling support to gaslamp. The new resampleDate() utility function and resampleBy() method enable bucketing timestamps and aggregating data across time periods. This is a pure TypeScript implementation that works with both Node.js and Google Apps Script environments.


What's New

Main Feature: Time-Series Resampling

What it does: Groups time-series data into time buckets (seconds, minutes, hours, days, weeks) for period-based aggregation. Perfect for analyzing metrics like hourly averages, daily totals, or weekly summaries from timestamp data.

How to use it: Call resampleBy() on a DataFrame with a time column, specify the frequency, then chain aggregation methods like .sum() or .agg().

Code example:

TypeScript
const df = BareFrame.fromColumns({
  timestamp: [new Date("2026-04-03T10:30:00Z"), new Date("2026-04-03T11:15:00Z")],
  value: [100, 150],
});

// Group by 1-hour buckets and sum values
df.resampleBy("timestamp", "1h").sum(["value"]);
// Returns: timestamp=1743811200000 (10:00 UTC), value=250

Added

  • resampleDate() utility function in convert.ts
  • Flexible frequency format: "Ns", "Nm", "Nh", "Nd", "Nw" (e.g., "1s", "60s", "15m", "1h", "2h")
  • Rounding methods: "floor" (default), "ceil", "round"
  • Returns numeric Unix timestamps (milliseconds)
  • resampleBy() method in BareFrame
  • Pure TypeScript function compatible with GAS
  • Returns GroupedFrame for standard aggregation methods
  • ResampleOptions type for method parameters
  • 51 unit tests for resampleDate() covering all frequencies and rounding methods
  • 7 integration tests for resampleBy() with aggregation examples

Changed

  • package.json: Build script changed from tsc to tsc --noEmit (type-checking only)
  • tsconfig.json: Configured outDir: "dist" and rootDir: "src" as build guardrails
  • .gitignore: Added dist/ to prevent accidental commits of generated files

Fixed

  • Build configuration now properly isolates generated files from source

Is It Safe to Upgrade?

  • Breaking Changes: No
  • Backward Compatible: Yes

All existing code continues to work. New functionality is additive only. The resampleDate() function and resampleBy() method are new APIs with no impact on existing code.


Release Details

  • Date: 2026-04-03
  • Version: v0.61.0
  • gaslamp: 120
  • pilotlamp: 78
  • Files Changed: 9 (convert.ts, frame.ts, frame.test.ts, index.ts, torch/index.ts, package.json, tsconfig.json, .gitignore, Taskfile.yml)
  • Test Coverage: 484 tests passing, 51 new tests for resampleDate, 7 new tests for resampleBy

Known Issues

None


Next Steps

Future enhancements could include:

  • Additional time-series transformations (rolling windows, exponential smoothing)
  • Performance optimizations for large datasets
  • Additional aggregation helpers for common metrics (median, percentiles)