Skip to content

[Autoloop] [Autoloop: build-tsb-pandas-typescript-migration]#111

Closed
github-actions[bot] wants to merge 13 commits intomainfrom
autoloop/build-tsb-pandas-typescript-migration-531c0338e43e4af9
Closed

[Autoloop] [Autoloop: build-tsb-pandas-typescript-migration]#111
github-actions[bot] wants to merge 13 commits intomainfrom
autoloop/build-tsb-pandas-typescript-migration-531c0338e43e4af9

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This PR is maintained by Autoloop. Each accepted iteration adds a commit to this branch.

Summary

Builds tsb — a complete TypeScript port of pandas, one feature at a time.

Current best metric: 35 pandas features ported (higher is better)

Steering issue: #107

Accepted Iterations

Iteration 197 — diff / shift

Add diffSeries, diffDataFrame, shiftSeries, shiftDataFrame.
Discrete difference and value shifting for Series and DataFrame, with axis support.
35 tests (unit + fast-check properties). Playground page diff_shift.html.

Iteration 196 — where / mask

Add whereSeries, maskSeries, whereDataFrame, maskDataFrame.
33 tests. Playground page where_mask.html.

Iteration 195 — replace

Add replaceSeries, replaceDataFrame. 27 tests.

Iteration 194 — astype

Add astypeSeries, astype, castScalar. 40 tests.

Iteration 193 — idxmin / idxmax

Add idxminSeries, idxmaxSeries, idxminDataFrame, idxmaxDataFrame. 35 tests.

Generated by Autoloop · ● 4.7M ·

github-actions Bot and others added 7 commits April 11, 2026 14:03
Implements pandas missing-value utilities as standalone exported functions:
- `isna` / `notna` / `isnull` / `notnull` — detect missing values in
  scalars, Series, and DataFrames (mirrors pd.isna / pd.notna)
- `ffillSeries` / `bfillSeries` — forward/backward fill for Series with
  optional `limit` parameter
- `dataFrameFfill` / `dataFrameBfill` — column-wise or row-wise fill for
  DataFrames with optional `limit` and `axis` parameters

Metric: 28 → 29 pandas_features_ported

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implements pctChangeSeries() and pctChangeDataFrame() mirroring
pandas.Series.pct_change() / pandas.DataFrame.pct_change().

- periods: configurable lag (positive = backward, negative = forward)
- fillMethod: "pad" (default), "bfill", or null (no fill)
- limit: cap consecutive fills
- axis: column-wise (default) or row-wise for DataFrame

Full test coverage: unit tests, edge cases, and fast-check property tests.
Interactive playground page at playground/pct_change.html.

Run: https://github.com/githubnext/tsessebe/actions/runs/24266545401
…g for Series and DataFrame

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- stats/duplicated.ts: duplicatedSeries, duplicatedDataFrame, dropDuplicatesSeries,
  dropDuplicatesDataFrame with keep='first'/'last'/false and subset support
- core/sample.ts: sampleSeries, sampleDataFrame with n/frac, replace,
  weighted sampling, and seeded RNG (randomState)
- 35 tests each (unit + fast-check properties)
- Playground pages: duplicated.html, sample.html

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: 18b6385

Generated by Autoloop

@github-actions
Copy link
Copy Markdown
Contributor Author


Warning

The push_to_pull_request_branch operation failed: Pull request number is required but not found. The code changes were not applied.

🤖 Iteration 200 — ✅ Accepted

  • Change: Add stats/clip_advanced.tsclipAdvancedSeries, clipAdvancedDataFrame. Per-element clipping with scalar, per-element Series bounds, and DataFrame bounds (element-wise). Supports axis=0/1 for Series broadcasting on DataFrames. 32 tests (unit + property-based). Playground page clip_advanced.html.
  • Metric: 38 (previous best: 36, delta: +2)
  • Commit: e0f8724
  • Run: §24285870280

Generated by Autoloop · ● 5.2M ·

@github-actions
Copy link
Copy Markdown
Contributor Author


Warning

The push_to_pull_request_branch operation failed: Pull request number is required but not found. The code changes were not applied.

🤖 Iteration 201✅ Accepted

  • Change: Add stats/apply.tsapplySeries, applyDataFrame, applyExpandDataFrame, mapDataFrame. Implements pandas-equivalent function application: element-wise (Series), reducing per column/row (→ Series), transforming per column/row (→ DataFrame), and element-wise applymap (→ DataFrame). 35 tests (unit + fast-check). Playground page apply.html.
  • Metric: 38 (previous best: 37, delta: +1)
  • Commit: 2cc43c3
  • Result: All four pandas apply/map variants added as standalone exported functions in stats/apply.ts.

Generated by Autoloop · ● 6.9M ·

@github-actions
Copy link
Copy Markdown
Contributor Author


Warning

The push_to_pull_request_branch operation failed: Failed to apply patch. The code changes were not applied.

🤖 Iteration 202✅ Accepted

  • Change: Add stats/clip_advanced.tsclipAdvancedSeries, clipAdvancedDataFrame. Per-element clipping with scalar, array, Series (positional/broadcast), or DataFrame (element-wise) bounds; axis=0/1 for Series broadcasting. Also fixed missing index exports for 9 modules from iters 172–199.
  • Metric: 38 (previous: 37, delta: +1)
  • Commit: cead131
  • Result: Canonical autoloop branch established from main. clip_advanced implemented with 27 tests passing. Biome clean.

Generated by Autoloop · ● 10.6M ·

- stats/clip_advanced.ts: clipAdvancedSeries, clipAdvancedDataFrame with per-element
  bounds from scalar, array, Series (positional), or DataFrame (element-wise).
  DataFrame bounds support axis=0/1 for Series broadcasting.
- stats/apply.ts: applySeries, mapSeries (function/dict/Map), applyDataFrame (reduce
  per col/row), applyExpandDataFrame (transform per col/row → DataFrame), mapDataFrame
  (element-wise). Helper decomposition satisfies Biome complexity rules.
- 25+ unit + property-based tests each (fast-check)
- Playground pages: clip_advanced.html, apply.html
- Creates canonical branch autoloop/build-tsb-pandas-typescript-migration from iter 199

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: 8d34cad

Generated by Autoloop

@github-actions
Copy link
Copy Markdown
Contributor Author

🤖 Autoloop Iteration 203

This iteration implements two stats modules previously missing from the coverage metric.

Changes

  • stats/clip_advanced.ts — Re-implemented clipAdvancedSeries and clipAdvancedDataFrame with full type-safe clipping using lower/upper bounds, including NaN/null handling and array-per-column clipping for DataFrames.
  • stats/apply.ts — Re-implemented applySeries, mapSeries, applyDataFrame, applyExpandDataFrame, and mapDataFrame with element-wise and row/column-wise application of user-supplied functions.

Metrics

Previous metric 37 (actual on branch before commit)
New metric 39
Commit 073d74b
Run #24287426738

Generated by Autoloop — an AI agent iteratively building tsb.

Generated by Autoloop · ● 11.5M ·

- stats/cut.ts: cut() for equal-width or user-defined bins, qcut() for quantile bins
- cutCodes() returns integer bin codes; cutCategories() returns label arrays
- CutOptions: right, labels, retbins, precision, includeLowest, ordered
- QcutOptions: labels, retbins, precision, duplicates (raise/drop)
- 30+ unit tests + fast-check property tests
- Playground page: cut.html (8 interactive demos)
- Export from stats/index.ts and src/index.ts

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: e5a8f5e

Generated by Autoloop

@github-actions
Copy link
Copy Markdown
Contributor Author

🤖 Iteration 204 — ✅ Accepted — Run

Change: Add stats/cut.tscut(), qcut(), cutCodes(), cutCategories()

  • cut(x, bins) — equal-width or user-defined bin edges → (lo, hi] intervals
  • qcut(x, q) — quantile-based equal-frequency bins
  • Options: right, labels (custom/false), retbins, precision, includeLowest, duplicates
  • cutCodes() — integer bin indices; cutCategories() — category label arrays
  • 30+ unit tests + fast-check property tests
  • Playground page: cut.html (8 interactive demos)

Metric: 40 (previous: 39, delta: +1)
Commit: 7dac470

Generated by Autoloop · ● 7.4M ·

…range

Add `stats/interval.ts` with:
- `Interval` class — single bounded interval with all four closed types (left/right/both/neither)
- `IntervalIndex` — ordered array of intervals with fromBreaks, fromArrays, fromIntervals factories
- `intervalRange()` — equal-length interval ranges by period count or step size
- Lookup: indexOf, overlapping, append, isMonotonic
- 60+ unit tests + fast-check property tests
- Playground page interval.html (8 interactive demos)

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: d9b653c

Generated by Autoloop

@github-actions
Copy link
Copy Markdown
Contributor Author

🤖 Iteration 205 — ✅ Accepted (Run)

  • Change: Add stats/interval.tsInterval, IntervalIndex, intervalRange. Interval supports all four closed types (left/right/both/neither) with contains, overlaps, equals, length, mid. IntervalIndex has fromBreaks, fromArrays, fromIntervals factories plus indexOf, overlapping, append, isMonotonic. intervalRange builds equal-length ranges by period count or step size.
  • Metric: 41 (previous best: 40, delta: +1)
  • Commit: e58b620
  • Tests: 60+ unit tests + fast-check property tests. Playground page interval.html (8 interactive demos).

Generated by Autoloop · ● 6.6M ·

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

Add `stats/get_dummies.ts` with:
- `getDummies(data, options?)` — one-hot encode a Series or DataFrame (unified API)
- `getDummiesSeries` — encode a single Series into binary indicator columns
- `getDummiesDataFrame` — encode categorical columns in a DataFrame
- `fromDummies(df, options?)` — reverse one-hot encoding back to a categorical Series
Options: prefix, prefixSep, dummyNa, columns (DataFrame), dropFirst, dtype
45+ unit + fast-check tests. Playground page get_dummies.html (8 interactive demos).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: 486277b

Generated by Autoloop

@github-actions
Copy link
Copy Markdown
Contributor Author


Warning

The push_to_pull_request_branch operation failed: Pull request number is required but not found. The code changes were not applied.

🤖 Iteration 207 — ✅ Accepted

  • Change: Add stats/crosstab.tscrosstab and crosstabSeries. Cross-tabulation of two factor arrays with count aggregation, custom aggfunc + values, normalization ("all", "index", "columns"), margins with custom name, and dropna support.
  • Metric: 43 (best: 43, delta: +1)
  • Commit: dacdb21
  • Tests: 30 tests pass (unit + property-based)
  • Run: https://github.com/githubnext/tsessebe/actions/runs/24289641935

Generated by Autoloop · ● 7.4M ·

@mrjf mrjf marked this pull request as ready for review April 12, 2026 11:58
@mrjf
Copy link
Copy Markdown
Contributor

mrjf commented Apr 14, 2026

@copilot resolve merge conflcits

…nd playground

Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

@copilot resolve merge conflcits

Merge conflicts resolved in commit 3705c17. The conflicts were in 7 files:

  • src/stats/where_mask.ts, tests/stats/where_mask.test.ts, playground/where_mask.html — accepted main's implementation (uses seriesWhere/seriesMask/dataFrameWhere/dataFrameMask)
  • src/core/index.ts, src/stats/index.ts, src/index.ts — merged all exports from both branches, aliasing conflicting type names where needed (StrGetDummiesOptions)
  • playground/index.html — kept all feature cards from both branches

@mrjf
Copy link
Copy Markdown
Contributor

mrjf commented Apr 17, 2026

Closing — superseded by #120 (the most complete migration PR).

@mrjf mrjf closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants