fix: format execution engine#18
Conversation
There was a problem hiding this comment.
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
elifblock in_process_single_orderfor 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.
| 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() | ||
| ) |
There was a problem hiding this comment.
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.
Summary
Validation