Skip to content

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

Merged
mrjf merged 7 commits intomainfrom
autoloop/build-tsb-pandas-typescript-migration-42dbd9e9
Apr 24, 2026
Merged

[Autoloop] [Autoloop: build-tsb-pandas-typescript-migration]#207
mrjf merged 7 commits intomainfrom
autoloop/build-tsb-pandas-typescript-migration-42dbd9e9

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Automated optimization iteration for the build-tsb-pandas-typescript-migration program.

Iteration 264 — Add Styler (DataFrame.style API)

Ports pandas.DataFrame.style / pandas.io.formats.style.Styler to TypeScript.

Changes

  • src/stats/style.ts — New Styler class + dataFrameStyle() factory (~1250 lines)

    • Full fluent chaining API mirroring pandas Styler
    • format / formatIndex / setPrecision / setNaRep
    • apply (axis-wise) / applymap / map (element-wise)
    • highlightMax / highlightMin / highlightNull / highlightBetween
    • backgroundGradient / textGradient / barChart
    • setCaption / setTableStyles / setTableAttributes / setProperties
    • hide (index or columns)
    • toHtml / render / toLatex
    • exportStyles / clearStyles
    • Color helpers: WCAG luminance/contrast, named colormaps (RdYlGn, Blues, coolwarm, etc.)
    • Lazy CSS rebuild architecture (no mutable CSS grid state)
  • tests/stats/style.test.ts — 50+ test cases: unit + property-based (fast-check)

  • playground/style.html — Interactive tutorial with full API reference and pandas equivalence table

  • src/stats/index.ts + src/index.ts — Export wiring

  • playground/index.html — Feature card added

Metric

134 → 135 exported feature files

Related

Closes #1 (ongoing — program issue for this optimization loop)


⚠️ This PR was created by an automated agent. Review before merging.

Generated by Autoloop · ● 14.8M ·

Port pandas.DataFrame.style / pandas.io.formats.style.Styler to TypeScript.

New module src/stats/style.ts provides:
- Styler class with fluent chaining API
- dataFrameStyle(df) factory function
- format / formatIndex / setPrecision / setNaRep
- apply (axis-wise) / applymap / map (element-wise)
- highlightMax / highlightMin / highlightNull / highlightBetween
- backgroundGradient / textGradient / barChart
- setCaption / setTableStyles / setTableAttributes / setProperties
- hide (index or columns)
- toHtml / render / toLatex
- exportStyles / clearStyles

Tests: 50+ test cases including unit, property-based (fast-check).
Playground: playground/style.html with complete API reference.

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mrjf mrjf marked this pull request as ready for review April 23, 2026 15:16
Remove duplicate/partial method definition that was never closed,
causing TypeScript syntax errors in all subsequent class methods.

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

Commit pushed: 332174e

Generated by Evergreen — PR Health Keeper

@github-actions
Copy link
Copy Markdown
Contributor Author

Evergreen Fix ✅

Fixed failing Test & Lint CI check on this PR.

Root cause: src/stats/style.ts contained a duplicate, incomplete highlightMin method definition (lines 721–728) that was never closed. This opened a { without a matching }, causing TypeScript to parse all subsequent class method declarations as statements inside the unclosed function body, producing ~40 syntax errors (TS1005: ',' expected, TS1109: Expression expected, etc.).

Fix: Removed the 8-line duplicate/partial method start. The complete highlightMin implementation immediately following was unaffected.

tsc --noEmit now passes cleanly.

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • releaseassets.githubusercontent.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "releaseassets.githubusercontent.com"

See Network Configuration for more information.

Generated by Evergreen — PR Health Keeper · ● 1.2M ·

- Fix useTemplate errors in style.ts (string concat → template literals)
- Fix noUnusedTemplateLiteral errors in style.ts (template → plain strings)
- Fix useExponentiationOperator: Math.pow → ** operator
- Fix useLiteralKeys: rec["key"] → rec.key in frame.ts and series.ts
- Auto-format style.ts and style.test.ts to match biome formatter rules
- Minor formatting fixes in resample.ts and testing.test.ts

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

Commit pushed: 6218e88

Generated by Evergreen — PR Health Keeper

@github-actions
Copy link
Copy Markdown
Contributor Author

Evergreen: CI Fix Applied 🔧

Fixed the failing Test & Lint check by resolving Biome lint/format errors introduced in the Styler iteration.

Changes made:

  • src/stats/style.ts — Fixed 6 lint errors:
    • useTemplate: converted string concatenation to template literals (lines 195, 1204, 1223)
    • noUnusedTemplateLiteral: removed unnecessary template literals (lines 1187, 1232)
    • useExponentiationOperator: Math.pow(x, y)x ** y (line 272)
    • Applied formatter to match biome's lineWidth: 100 and style rules
  • tests/stats/style.test.ts — Applied biome formatter fix (format error)
  • src/core/frame.ts, src/core/series.tsrec["key"]rec.key (literal key access)
  • src/stats/resample.ts, tests/testing/testing.test.ts — Minor formatter fixes (single-line if → block form)

All fixes are safe/semantically equivalent. Biome now reports 0 errors (warnings only, which don't fail CI).

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • releaseassets.githubusercontent.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "releaseassets.githubusercontent.com"

See Network Configuration for more information.

Generated by Evergreen — PR Health Keeper · ● 4M ·

Fix TypeScript TS4111 errors in frame.ts, series.ts, and style.ts by
replacing dot notation with bracket notation for properties accessed
from index signatures.

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

Commit pushed: 8fcc913

Generated by Evergreen — PR Health Keeper

@github-actions
Copy link
Copy Markdown
Contributor Author

Evergreen fix applied

The Test & Lint CI failure was caused by 7 TypeScript TS4111 errors — properties from index signatures being accessed with dot notation instead of bracket notation. Fixed in commit e184169:

  • src/core/frame.ts:782rec.size, rec.at, rec.getLoc → bracket notation
  • src/core/series.ts:1039 — same three properties
  • src/stats/style.ts:260COLORMAPS.BluesCOLORMAPS["Blues"]

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • releaseassets.githubusercontent.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "releaseassets.githubusercontent.com"

See Network Configuration for more information.

Generated by Evergreen — PR Health Keeper · ● 764.4K ·

@mrjf
Copy link
Copy Markdown
Contributor

mrjf commented Apr 24, 2026

@copilot fix tests

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 24, 2026

@copilot fix tests

Fixed in c879b3a. The mergeCss helper was stripping trailing semicolons from CSS property strings, so tests checking for e.g. "color: red;" were failing even though the CSS was otherwise correct. Updated mergeCss to preserve trailing semicolons in non-empty output — all 59 style tests now pass.

Copilot AI requested a review from mrjf April 24, 2026 02:48
Copilot finished work on behalf of mrjf April 24, 2026 02:48
@mrjf
Copy link
Copy Markdown
Contributor

mrjf commented Apr 24, 2026

@copilot fix tests

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 24, 2026

@copilot fix tests

Fixed in 2477cb9. The CI "Test & Lint" job was failing due to Biome format errors in src/core/frame.ts and src/core/series.ts — a previous commit had switched to bracket notation (rec["getLoc"]) to satisfy TypeScript's noPropertyAccessFromIndexSignature, but that made those lines exceed the 100-char line limit. Broke the expressions across multiple lines to satisfy the formatter. Lint, typecheck, and all tests now pass.

Copilot finished work on behalf of mrjf April 24, 2026 02:57
@mrjf mrjf merged commit 7f59634 into main Apr 24, 2026
8 checks passed
@mrjf mrjf deleted the autoloop/build-tsb-pandas-typescript-migration-42dbd9e9 branch April 24, 2026 04:32
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.

Build tsb: pandas → TypeScript migration

2 participants