Skip to content

fix: format execution engine#18

Merged
stefan-jansen merged 1 commit into
mainfrom
fix/main-ci-format
Apr 15, 2026
Merged

fix: format execution engine#18
stefan-jansen merged 1 commit into
mainfrom
fix/main-ci-format

Conversation

@stefan-jansen

Copy link
Copy Markdown
Contributor

Summary

  • apply the missing formatter change for execution_engine.py from the previous main-CI repair

Validation

  • uv run ruff format --check src tests
  • uv run ruff check src tests
  • uv run ty check

Copilot AI review requested due to automatic review settings April 15, 2026 08:34
@stefan-jansen stefan-jansen merged commit de2f3b0 into main Apr 15, 2026
8 checks passed
@stefan-jansen stefan-jansen deleted the fix/main-ci-format branch April 15, 2026 08:35

Copilot AI 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.

Pull request overview

Applies the previously-missed formatting update to execution_engine.py, aligning it with the formatter output from the earlier main-CI repair.

Changes:

  • Reformats the partial-fill eligibility elif block in _process_single_order for readability.
  • Tightens the rebalance/integer partial-fill path to also require an “insufficient” rejection reason.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +499 to +506
elif (
broker.partial_fills_allowed
and "insufficient" in rejection_reason.lower()
or (
order.rebalance_id is not None
and broker.share_type.value == "integer"
and "insufficient" in rejection_reason.lower()
)

Copilot AI Apr 15, 2026

Copy link

Choose a reason for hiding this comment

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

The mixed and/or condition here is hard to read and repeats "insufficient" in rejection_reason.lower() (and calls .lower() multiple times in this function). Consider computing a single insufficient_cash = "insufficient" in rejection_reason.lower() once and then expressing the condition as insufficient_cash AND (partial fills allowed OR (rebalance_id set AND share_type is integer)) to make precedence unambiguous and avoid duplicated work.

Copilot uses AI. Check for mistakes.
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.

2 participants