Skip to content

Improve Dtype + Series: widened signatures, lint fixes, and removed unsafe casts#14

Merged
mrjf merged 5 commits intomainfrom
copilot/aw-manual-apply
Apr 4, 2026
Merged

Improve Dtype + Series: widened signatures, lint fixes, and removed unsafe casts#14
mrjf merged 5 commits intomainfrom
copilot/aw-manual-apply

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

The Dtype + Series code from Autoloop Iteration 3 was already merged to main via PR #15. This PR adds improvements on top of that merge.

Lint/type fixes

  • Routed exports through barrel (src/core/index.ts) to satisfy useImportRestrictions
  • Added exhaustive default clause to Dtype.build() switch
  • Extracted compareScalars() helper to bring sortValues under cognitive complexity limit
  • Widened arithmetic/comparison/isin signatures from T | Series<T> to number | Series<Scalar> / Scalar | Series<Scalar>, eliminating all as never casts in tests:
// Before: literal type narrowing forced unsafe casts
const s = new Series({ data: [1, 2, 3] }); // Series<1 | 2 | 3>
s.add(10 as never); // required cast

// After: widened signatures accept any number
s.add(10); // works directly

Conflict resolution

  • Merged origin/main into branch to resolve conflicts, keeping our improved versions

Copilot AI assigned Copilot and mrjf Apr 4, 2026
Copilot AI linked an issue Apr 4, 2026 that may be closed by this pull request
github-actions Bot and others added 3 commits April 4, 2026 04:01
Add Dtype immutable singleton system (16 pandas dtypes with kind, itemsize,
casting rules, and inferFrom), implement Series<T> (1-D labeled array with
dtype inference, element access, arithmetic, comparison, boolean masking,
statistical aggregation, sorting, and manipulation), plus comprehensive
tests. Fix pre-existing noUncheckedIndexedAccess errors in base-index.ts.

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
…nt issues

Cherry-pick the Dtype system and Series implementation from the autoloop
branch (autoloop/build-tsb-pandas-typescript-migration-bdf4100e5aade1f0).
Resolve merge conflicts by keeping main's base-index.ts fixes (wider Label
types, no as-casts). Fix new lint warnings: use barrel exports, add default
switch clause, extract sort comparator to reduce cognitive complexity.

Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/8871403f-f41c-4311-a8fd-19f148d98d2d

Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Widen arithmetic methods to accept number | Series<Scalar> instead of
T | Series<T>, comparison methods to accept Scalar | Series<Scalar>,
and isin to accept readonly Scalar[]. This avoids literal type narrowing
issues that previously required as-never casts in tests.

Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/8871403f-f41c-4311-a8fd-19f148d98d2d

Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix autoloop patch application failure Apply Autoloop Iteration 3: Dtype system + Series implementation Apr 4, 2026
Copilot AI requested a review from mrjf April 4, 2026 04:12
Copilot finished work on behalf of mrjf April 4, 2026 04:12
@mrjf
Copy link
Copy Markdown
Contributor

mrjf commented Apr 4, 2026

@copilot was this already merged? if not resolve conflicts

@mrjf mrjf marked this pull request as ready for review April 4, 2026 04:27
# Conflicts:
#	src/core/dtype.ts
#	src/core/series.ts
#	src/index.ts
#	tests/core/dtype.test.ts
#	tests/core/series.test.ts

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

Copilot AI commented Apr 4, 2026

@copilot was this already merged? if not resolve conflicts

PR #15 already merged the Dtype + Series to main. I've now merged origin/main back into this branch to resolve the conflicts (commit 9cc05c8). The remaining diff contains only improvements on top of what landed: widened method signatures, barrel exports, exhaustive switch default, extracted sort comparator, and removed as never casts from tests. All 218 tests pass.

Copilot AI changed the title Apply Autoloop Iteration 3: Dtype system + Series implementation Improve Dtype + Series: widened signatures, lint fixes, and removed unsafe casts Apr 4, 2026
Copilot finished work on behalf of mrjf April 4, 2026 04:30
@mrjf mrjf merged commit 045cdb3 into main Apr 4, 2026
9 checks passed
@mrjf mrjf deleted the copilot/aw-manual-apply branch April 4, 2026 04:44
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.

[aw] Autoloop failed

2 participants