Skip to content

Add EUPHEMIA-compatible bid objects module#4

Merged
tommed merged 2 commits into
mainfrom
feat/add-bids-module
Mar 13, 2026
Merged

Add EUPHEMIA-compatible bid objects module#4
tommed merged 2 commits into
mainfrom
feat/add-bids-module

Conversation

@tommed

@tommed tommed commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the bids.py module containing Pydantic v2 models for the four EUPHEMIA-compatible bid types used in European power market auctions:

  • SimpleBid: Price-quantity curve bid for a single MTU
  • BlockBid: Fixed price/volume across contiguous MTUs with configurable min acceptance ratio
  • LinkedBlockBid: Block bid with parent dependency for operational constraints
  • ExclusiveGroupBid: Container for mutually exclusive block bids (max one accepted)

Also includes 8 helper functions for ergonomic bid construction (block_bid, linked_block_bid, exclusive_group, etc.) and validation utilities.

Implementation Details

  • Frozen Pydantic models: All bids are immutable with comprehensive field/model validators
  • Type safety: Decimal for prices/volumes, timezone-aware datetimes only
  • Validation: Enforces EUPHEMIA constraints (e.g., min_acceptance_ratio ∈ [0.0, 1.0], zone/direction consistency in exclusive groups)
  • Graph-based validation: Detects circular dependencies in linked bid collections
  • Property-based testing: Uses hypothesis for robust validation coverage

Test Coverage

  • 54 new tests in tests/test_bids.py
  • 96% coverage of bids.py module (exceeds 80% target)
  • 97% overall project coverage
  • All tests pass: make test
  • Type checking passes: mypy
  • Linting passes: ruff

Documentation

  • Updated README.md with comprehensive bid construction examples
  • Added workflow documentation to CLAUDE.md
  • Google-style docstrings on all public API functions

Test Plan

  • All existing tests pass
  • New bid tests pass (unit, validation, property-based)
  • Type checking with mypy passes
  • Linting with ruff passes
  • Code coverage ≥80% (achieved 96%)
  • README examples are accurate and runnable
  • Manual verification of bid creation in Python REPL

🤖 Generated with Claude Code

tommed and others added 2 commits March 13, 2026 17:55
Implements SimpleBid, BlockBid, LinkedBlockBid, and ExclusiveGroupBid
models with comprehensive validation and helper functions to support
day-ahead and intraday bidding workflows. Includes 54 tests achieving
96% coverage of the bids module.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Configure CI to run on pushes to main and pull requests
- Run ruff linting and format checks
- Run mypy type checking on src/
- Run pytest with coverage reporting
- Enforce 80% coverage threshold per DoD requirements
- Test on Python 3.11 and 3.12
- Cache Poetry dependencies for faster builds
- Add coverage package to dev dependencies

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@tommed tommed merged commit 7e94faa into main Mar 13, 2026
1 of 3 checks passed
@tommed tommed deleted the feat/add-bids-module branch March 13, 2026 18:00
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