Skip to content

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

Draft
github-actions[bot] wants to merge 7 commits into
mainfrom
autoloop/build-tsb-pandas-typescript-migration
Draft

github-actions[bot] wants to merge 7 commits into
mainfrom
autoloop/build-tsb-pandas-typescript-migration

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Iteration 508: Add Period/PeriodIndex ⇄ DatetimeIndex conversions

Pandas feature: pandas.DatetimeIndex.to_period(), pandas.PeriodIndex.to_timestamp(), pandas.Period.to_timestamp()

Adds bidirectional conversion between fixed-frequency Period/PeriodIndex and calendar-based DatetimeIndex:

  • to_period(idx, freq) — maps each date in a DatetimeIndex to the Period that contains it (pandas.DatetimeIndex.to_period(freq))
  • PeriodIndex.to_timestamp(how) — converts a PeriodIndex back to a DatetimeIndex, how="start" (default) or "end" (pandas.PeriodIndex.to_timestamp())
  • Period.to_timestamp(how) — single-period equivalent (pandas.Period.to_timestamp())

Verification

  • Differential tests in tests/core/period.test.ts compare against pandas 2.2.3 reference values (generated by running the equivalent pandas calls), covering monthly/quarterly conversion, index name propagation, the empty-index edge case, and start/end timestamp semantics at millisecond precision.
  • A property-based round-trip test (fast-check) verifies to_period(to_timestamp(idx)) recovers the original periods across M/Q/A/D frequencies.
  • bun run typecheck passes with no errors.
  • bun test — 9336/9337 pass (1 pre-existing flaky property test in tests/stats/quantile.test.ts, unrelated to this change and confirmed passing in isolation).
  • New playground section added to playground/period.html demonstrating the conversions.

Metric

pandas_features_ported (exported .ts files under src/, excluding index.ts/.d.ts) is unchanged at 210 — the new functions were added to the existing src/core/period.ts file (consistent with how other single-purpose converters like to_datetime.ts/to_numeric.ts are structured) rather than a new file, per the guard against padding file counts for a metric that doesn't reflect real progress.

Note: the repo-memory state file's previously recorded best_metric (23499) reflects large batches of non-functional placeholder "scientific domain" files added in prior iterations and later removed from main (confirmed via git log/git show — e.g. commit bbce42f2 added ~10,500 such files that are no longer present in the current tree). The verified, current baseline on main is 210.

🤖 Generated by Autoloop.

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

Generated by Autoloop · copilot · auto · 412.1 AIC · ⌖ 2.59 AIC · ⊞ 27.8K ·
Comment /autoloop to run again

…mestamp)

Mirrors pandas.DatetimeIndex.to_period(), pandas.PeriodIndex.to_timestamp(),
and pandas.Period.to_timestamp(). Adds:
- to_period(idx, freq): DatetimeIndex -> PeriodIndex
- PeriodIndex.to_timestamp(how): PeriodIndex -> DatetimeIndex
- Period.to_timestamp(how): Period -> Date

Differential tests compare against pandas 2.2.3 reference values (labels,
dtype/freq, empty-index edge case) plus a round-trip property test. Adds a
playground section demonstrating the conversions.

Run: https://github.com/githubnext/tsb/actions/runs/35294423502

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

Copy link
Copy Markdown
Contributor Author

🤖 Iteration 508 accepted

  • Change: Added to_period() (DatetimeIndex → PeriodIndex), PeriodIndex.to_timestamp(), and Period.to_timestamp(), mirroring pandas.DatetimeIndex.to_period() / pandas.PeriodIndex.to_timestamp() / pandas.Period.to_timestamp(), with differential tests against pandas 2.2.3 and a new playground section.
  • Metric: pandas_features_ported = 210 (unchanged — the functions were added to the existing src/core/period.ts file rather than a new file, consistent with this codebase's convention for single-purpose converters; see the state file's Lessons Learned for the metric/goal-mismatch note).
  • Verification: Head SHA 4285819e — CI run §35295842225 completed successfully (Test & Lint, Playground E2E, Build, Validate Python Examples all passed). PR-level status-check rollup confirmed all 8 required-name checks (across both duplicate CI-trigger runs for this SHA) succeeded.
  • Run: https://github.com/githubnext/tsb/actions/runs/35317390917

Accepted and recorded in the state file (build-tsb-pandas-typescript-migration.md) on the memory/autoloop branch.

Generated by Autoloop · copilot · auto · 217.6 AIC · ⌖ 7.83 AIC · ⊞ 27.8K ·
Comment /autoloop to run again

Adds atTimeSeries, atTimeDataFrame, betweenTimeSeries, and
betweenTimeDataFrame, mirroring pandas.Series.at_time /
pandas.Series.between_time and their DataFrame equivalents. Supports
exact time-of-day matching, inclusive/left/right/neither window
bounds, and overnight wraparound windows (e.g. 18:00-03:00), matching
pandas semantics. Throws TypeError("Index must be DatetimeIndex") on
non-datetime indexes, matching pandas' error text.

Verified against pandas 2.2.3 reference values for at_time, all four
inclusive modes of between_time, and the wraparound case. Includes a
property-based test asserting every returned row's time-of-day
satisfies the window predicate. Added a playground page
(at_time.html) and linked it from the roadmap index.

Run: https://github.com/githubnext/tsb/actions/runs/35347254872

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

Copy link
Copy Markdown
Contributor Author

Commit pushed: fba00f1

Generated by Autoloop · copilot · auto · 391.5 AIC · ⌖ 1.55 AIC · ⊞ 27.8K

The at_time.html playground page's Python reference code blocks (cells
1, 3, 5, 7) were never added to tests-e2e/known-failures.json, causing
the Playground E2E CI job to fail. Following the same convention as
between.html and at_iat.html (whose Python-syntax reference cells are
expected to fail the TypeScript transpile/execute check), allowlist
these four cells for at_time.html.

Run: https://github.com/githubnext/tsb/actions/runs/35382819279

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

Copy link
Copy Markdown
Contributor Author

Commit pushed: ec4c249

Generated by Autoloop · copilot · auto · 264.2 AIC · ⌖ 11.4 AIC · ⊞ 27.8K

@github-actions

Copy link
Copy Markdown
Contributor Author

🤖 Iteration 509 accepted — verified via authenticated MCP reads.

  • Verified HEAD^{tree} (27260a2d) matched the recorded Pending Tree.
  • CI run 35384309688 at exact head SHA 27260a2d completed with all 4 required jobs successful (Test & Lint, Playground E2E, Build, Validate Python Examples).
  • PR head confirmed open and matching.
  • Local re-verification: tsc --noEmit clean, bun test 9360/9361 pass (1 pre-existing sandbox-only Playwright/Chromium failure, unrelated to this change).
  • Metric correction: previously recorded pending metric of 223 was unverified; re-running the evaluator's exact command gives 211 (210 baseline + 1 new file: src/stats/at_time.ts). Best Metric updated to 211.
  • CI fix attempts: 1 (added missing at_time.html entry to tests-e2e/known-failures.json).

Generated by Autoloop · copilot · auto · 147.9 AIC · ⌖ 6.47 AIC · ⊞ 27.8K ·
Comment /autoloop to run again

Implements pandas.Series.asfreq / pandas.DataFrame.asfreq: reindex a
datetime-indexed Series or DataFrame onto a regular date_range grid at a
new frequency. Supports method (ffill/bfill/nearest) and fillValue for
gaps introduced by upsampling, and normalize to reset timestamps to
midnight. Downsampling drops rows that don't land on the new grid,
matching pandas semantics exactly (verified against pandas 2.2.3).

- New src/stats/asfreq.ts: asfreqSeries, asfreqDataFrame
- tests/stats/asfreq.test.ts: differential tests against pandas 2.2.3
  reference values plus property-based grid-alignment tests
- New playground page playground/asfreq.html, linked from index.html
- tests-e2e/known-failures.json: allowlist the page's Python-reference
  cells (not executable in the sandboxed TS runtime), following the
  at_time.html convention

Metric: pandas_features_ported 211 -> 212 (new file src/stats/asfreq.ts).

Verification: tsc --noEmit clean; bun test 9382/9384 pass (2 failures
are the pre-existing sandbox-only missing-Chromium Playwright issue,
unrelated to this change); all 4 new TS playground cells manually
executed via `bun run` and confirmed to match pandas 2.2.3 reference
output (Playwright/Chromium unavailable in this sandbox).

🤖 Generated by Autoloop.

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

Copy link
Copy Markdown
Contributor Author

Commit pushed: 75a8405

Generated by Autoloop · copilot · auto · 750.7 AIC · ⌖ 2.18 AIC · ⊞ 27.8K

@github-actions

Copy link
Copy Markdown
Contributor Author

🤖 Autoloop status update — iteration 510 still pending CI (blocked, not this agent's fault)

Re-checked reconciliation for the pending asfreq candidate (tree 56ae39e8, commit 75a8405c):

  • The tree at PR head still exactly matches the recorded Pending Tree — no drift.
  • The only CI workflow run recorded for this exact head SHA is run 35429091647, which is completed/action_required with zero jobs — the workflow never actually started at this commit; it appears stuck awaiting manual approval (e.g. a first-time-contributor/fork approval gate) rather than having failed.
  • mergeable_state is blocked, consistent with no successful required checks.

This agent cannot approve or re-dispatch a workflow run and has no repair to make (there is no failure to fix — the run simply hasn't executed). A maintainer needs to manually approve/re-run the workflow at commit 75a8405c on this branch to unblock reconciliation of iteration 510 (asfreq support, metric 212).

No new work was started this run to avoid stacking another candidate on top of an unresolved pending one. State file updated with this finding; Pending Tree/Pending Metric/Pending Iteration left unchanged.

Generated by Autoloop · copilot · auto · 59.5 AIC · ⌖ 13.6 AIC · ⊞ 27.8K ·
Comment /autoloop to run again

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.

1 participant