Skip to content

Move PIT scaffolding from nowcast-data to alphaforge - #10

Merged
steveya merged 3 commits into
mainfrom
feature/pit-scaffolding-migration
Mar 22, 2026
Merged

steveya merged 3 commits into
mainfrom
feature/pit-scaffolding-migration

Conversation

@steveya

@steveya steveya commented Mar 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Phases 0-4: Migrate general-purpose PIT abstractions (PITAdapter ABC, PITObservation, SeriesMetadata, SeriesCatalog, exceptions, timestamp utilities, concrete adapters, VintageView/VintageResolver reconciliation) from nowcast-data to alphaforge
  • Phase 5: Move TargetPolicy dataclass and all release-resolution functions (resolve_target_from_releases, quarter calendar helpers, adapter-dependent resolution pipelines) to alphaforge
  • Quarter calendar helpers use inline regex logic, eliminating the nowcast_calendar dependency

These modules have zero nowcasting-specific coupling and can now be reused by other alphaforge-dependent packages (e.g., positioning).

Test plan

  • ruff check . — zero lint errors
  • pytest tests/ — 312 passed, 7 skipped
  • mkdocs build --strict — docs build clean
  • 46 new tests in test_pit_target.py covering all 10 exported symbols
  • Companion nowcast-data PR to convert source files to re-export shims

🤖 Generated with Claude Code

steveya and others added 3 commits March 22, 2026 10:47
Migrate general-purpose PIT abstractions so other alphaforge-dependent
packages can reuse them:

- Phase 0: Reconcile vintage view layer (FrozenResolver lookahead guard)
- Phase 1: Exceptions (PITAdapterError hierarchy) + timestamp utilities
- Phase 2: Core models (PITObservation, SeriesMetadata, PITMode)
- Phase 3: PITAdapter ABC + SeriesCatalog
- Phase 4: Concrete adapters (AlphaForgePITAdapter, FREDALFREDAdapter, stubs)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move TargetPolicy dataclass and all release-resolution functions from
nowcast-data to alphaforge so other dependent packages can reuse them.
Quarter calendar helpers use inline regex logic (no nowcast_calendar dep).

New exports: TargetPolicy, resolve_target_from_releases,
quarter_end_date, quarter_start_date, quarter_obs_date,
resolve_target_obs_date_anchor, list_quarterly_target_releases_asof,
list_quarterly_target_releases_asof_multi, resolve_quarterly_final_target,
get_quarterly_release_observation_stream.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Widen regex to accept any digit for the quarter field and validate
separately, so the error message says "Invalid quarter: 5" instead
of a generic format mismatch. Matches the original nowcast-data
error semantics that downstream tests rely on.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19d6e433e0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread alphaforge/pit/target.py
if not refs:
return {}

if hasattr(adapter, "list_pit_observations_asof_multi"):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fall back to single-query path when batch lookup is unsupported

In list_quarterly_target_releases_asof_multi, the hasattr(adapter, "list_pit_observations_asof_multi") check is always true for PITAdapter subclasses because the base class defines this method, even when it only raises NotImplementedError. In that common case, the except NotImplementedError branch currently returns empty frames for all requested quarters instead of calling list_quarterly_target_releases_asof per quarter, which silently drops valid releases for adapters that implement only the single-query API.

Useful? React with 👍 / 👎.

@steveya
steveya merged commit 1c38d1a into main Mar 22, 2026
3 of 7 checks passed
@steveya
steveya deleted the feature/pit-scaffolding-migration branch April 2, 2026 04:31
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.

1 participant