Skip to content

Implement Index type system (Index<T>, RangeIndex) for tsb pandas port#4

Merged
mrjf merged 8 commits intomainfrom
copilot/autoloop-build-tsb-pandas-migration
Apr 4, 2026
Merged

Implement Index type system (Index<T>, RangeIndex) for tsb pandas port#4
mrjf merged 8 commits intomainfrom
copilot/autoloop-build-tsb-pandas-migration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

Applies the Iteration 1 foundation patch from autoloop (which couldn't be pushed due to protected file restrictions) and implements Iteration 2: the Index type system — the prerequisite for Series and DataFrame.

Foundation (Iteration 1 patch applied)

  • Package scaffold: package.json, tsconfig.json (strictest), biome.json, bunfig.toml, CI/CD workflows
  • Core types: Scalar, Label, Axis, DtypeName, etc. in src/types.ts
  • Fixed lint issues in the original patch (invalid biome config key, import restrictions, regex scope, BigInt precision)

Index (src/core/base-index.ts)

Generic immutable labeled axis mirroring pandas.Index:

  • Properties: size, shape, ndim, empty, values, isUnique, hasDuplicates, isMonotonicIncreasing/Decreasing
  • Look-up: getLoc, getIndexer, contains, isin
  • Set ops: union, intersection, difference, symmetricDifference
  • Duplicates: duplicated(keep), dropDuplicates, nunique
  • Manipulation: append, insert, delete, drop, copy, rename
  • Aggregation: min, max, argmin, argmax, argsort, sortValues
  • Missing values: isna, notna, dropna, fillna
  • Iteration: Symbol.iterator, map, toString, toArray

RangeIndex (src/core/range-index.ts)

Memory-efficient integer index storing only start/stop/step, extending Index<number>. Always unique, monotonic by construction.

import { Index, RangeIndex } from "tsb";

const labels = new Index(["a", "b", "c"], "cols");
labels.getLoc("b");              // 1
labels.union(new Index(["c", "d"])); // Index([a, b, c, d])

const range = new RangeIndex(0, 10, 2); // [0, 2, 4, 6, 8]
range.slice(1, 3);               // RangeIndex(start=2, stop=6, step=2)

Tests & coverage

117 tests, 100% function and line coverage across all source files.

Other

  • Added permissions: contents: read to CI workflow
  • Added .gitignore, playground page for Index feature

Copilot AI assigned Copilot and mrjf Apr 3, 2026
Copilot AI linked an issue Apr 3, 2026 that may be closed by this pull request
Establish complete project scaffold for the tsb TypeScript pandas port:

- package.json: tsb package, Bun runtime, Biome + fast-check devDeps
- tsconfig.json: strictest TypeScript (strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes)
- biome.json: all linting rules enabled, zero-warning policy
- bunfig.toml: test coverage enabled, setup preload
- src/index.ts: package entry point with planned export structure
- src/types.ts: core type foundation (Scalar, Label, Axis, DtypeName, etc.)
- tests/setup.ts: global test setup harness
- tests/index.test.ts: hello-world smoke tests proving pipeline works
- .github/workflows/ci.yml: CI with type-check, lint, test, build
- .github/workflows/pages.yml: GitHub Pages deployment pipeline
- playground/index.html: feature roadmap landing page
- AGENTS.md: project conventions for AI coding agents
- CLAUDE.md: Claude Code configuration

Metric: pandas_features_ported = 1 (baseline)

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mrjf mrjf marked this pull request as ready for review April 3, 2026 17:20
Copilot AI changed the title [WIP] Set up project scaffold for tsb TypeScript pandas port Implement Index type system (Index<T>, RangeIndex) for tsb pandas port Apr 3, 2026
Copilot finished work on behalf of mrjf April 3, 2026 17:25
Copilot AI requested a review from mrjf April 3, 2026 17:25
mrjf added 2 commits April 3, 2026 10:48
…flow

Fix TypeScript type check CI failure: rootDir/tests conflict
@mrjf
Copy link
Copy Markdown
Contributor

mrjf commented Apr 4, 2026

@copilot fix ci errors

@mrjf mrjf merged commit 8769d7e into main Apr 4, 2026
1 of 3 checks passed
Copilot stopped work on behalf of mrjf due to an error April 4, 2026 03:33
@mrjf mrjf deleted the copilot/autoloop-build-tsb-pandas-migration branch April 4, 2026 03:35
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.

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

2 participants