Skip to content

[Autoloop: build-tsb-pandas-typescript-migration]Β #242

@github-actions

Description

@github-actions

tsb: pandas β†’ TypeScript migration

πŸ€– This PR is maintained by Autoloop. Each accepted iteration adds a commit to this branch.

Program goal: Build tsb, a complete TypeScript port of pandas, one feature at a time.
Program issue: #1
Current best metric: 137 pandas_features_ported


Iteration 295 β€” add Grouper class (pd.Grouper)

Adds src/groupby/grouper.ts implementing the Grouper helper class β€” the TypeScript equivalent of pandas.Grouper.

What's included:

  • Grouper class with key, level, freq, sort, closed, label, base options
  • parseFreq(freq) β€” parses frequency strings like "2h", "30min", "7D"
  • binFloor(tsMs, freq, closed) β€” floors a timestamp to a bin boundary for constant-ms frequencies
  • Grouper.binDate(date) β€” bins a Date value using the configured freq/closed/label/base
  • Full exports from src/groupby/index.ts and src/index.ts
  • Comprehensive test suite (tests/groupby/grouper.test.ts) with unit + property-based (fast-check) tests
  • Interactive playground page (playground/grouper.html)

Metric: 136 β†’ 137 (pandas_features_ported, +1)

Generated by Autoloop Β· ● 3.9M Β· β—·


Note

This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available in the agent artifact in the workflow run linked above.

To create a pull request with the changes:

# Download the artifact from the workflow run
gh run download 25117554579 -n agent -D /tmp/agent-25117554579

# Create a new branch
git checkout -b autoloop/build-tsb-pandas-typescript-migration

# Apply the patch (--3way handles cross-repo patches where files may already exist)
git am --3way /tmp/agent-25117554579/aw-autoloop-build-tsb-pandas-typescript-migration.patch

# Push the branch to origin
git push origin autoloop/build-tsb-pandas-typescript-migration

# Create the pull request
gh pr create --title '[Autoloop: build-tsb-pandas-typescript-migration]' --base main --head autoloop/build-tsb-pandas-typescript-migration --repo githubnext/tsessebe
Show patch preview (500 of 839 lines)
From 1e210b03c1d9573afbea7561c5fd4fad718e7808 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Wed, 29 Apr 2026 15:28:58 +0000
Subject: [PATCH] [Autoloop: build-tsb-pandas-typescript-migration] Iteration
 295: add Grouper class (pd.Grouper)

Run: https://github.com/githubnext/tsessebe/actions/runs/25117554579

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 playground/grouper.html       | 182 ++++++++++++++++++++
 playground/index.html         |   5 +
 src/groupby/grouper.ts        | 262 ++++++++++++++++++++++++++++
 src/groupby/index.ts          |   2 +
 src/index.ts                  |   2 +
 tests/groupby/grouper.test.ts | 313 ++++++++++++++++++++++++++++++++++
 6 files changed, 766 insertions(+)
 create mode 100644 playground/grouper.html
 create mode 100644 src/groupby/grouper.ts
 create mode 100644 tests/groupby/grouper.test.ts

diff --git a/playground/grouper.html b/playground/grouper.html
new file mode 100644
index 0000000..b288a6d
--- /dev/null
+++ b/playground/grouper.html
@@ -0,0 +1,182 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <title>tsb β€” Grouper</title>
+  <style>
+    body { font-family: system-ui, sans-serif; max-width: 860px; margin: 2rem auto; padding: 0 1rem; line-height: 1.6; }
+    h1 { color: #1a1a2e; }
+    h2 { color: #16213e; border-bottom: 2px solid #e2e8f0; padding-bottom: 0.3rem; }
+    pre { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 1rem; overflow-x: auto; }
+    code { font-family: "Fira Code", monospace; font-size: 0.9rem; }
+    .note { background: #eff6ff; border-left: 4px solid #3b82f6; padding: 0.5rem 1rem; margin: 1rem 0; border-radius: 0 6px 6px 0; }
+    .output { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; padding: 1rem; margin-top: 0.5rem; }
+    textarea { width: 100%; font-fami
... (truncated)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions