Add OrderBook module for managing bid portfolios#6
Merged
Conversation
Implement immutable order book container with comprehensive bid management capabilities. Enables traders to organise, query, and analyse collections of SimpleBid, BlockBid, LinkedBlockBid, and ExclusiveGroupBid instances for submission to EUPHEMIA auctions. Key features: - Immutable operations with copy-on-write pattern - Automatic validation of bid collections (duplicates, parent refs) - Rich querying: by zone, direction, status, type, time period - Aggregation: volume totals, bid counts, comprehensive summaries - Status management: single and bulk updates - pandas DataFrame export for analysis All functions include Google-style docstrings, full type hints, and 100% test coverage (49 tests, 254 lines of implementation). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the
orders.pymodule - an immutable order book/portfolio container for managing collections of bids for European power market auctions.New functionality:
Key design decisions:
validate_bid_collection()from bids module for consistencyFiles changed:
src/nexa_bidkit/orders.py- 254 lines of implementationtests/test_orders.py- 49 tests with 100% coveragesrc/nexa_bidkit/__init__.py- Exports for OrderBook and all functionsREADME.md- Usage examples addedTest plan
orders.py(overall 98%)poetry run mypy src- zero errorspoetry run ruff check src tests- all checks passedpoetry run ruff format src tests- code formatted🤖 Generated with Claude Code