Skip to content

Initialize from_order_func record buffers before exposing them to callbacks#860

Merged
polakowo merged 1 commit into
polakowo:masterfrom
Whning0513:fix-initialized-order-func-records-858
Jul 3, 2026
Merged

Initialize from_order_func record buffers before exposing them to callbacks#860
polakowo merged 1 commit into
polakowo:masterfrom
Whning0513:fix-initialized-order-func-records-858

Conversation

@Whning0513

Copy link
Copy Markdown
Contributor

Fixes #858.

Summary

  • initialize empty order and log record buffers with stable sentinel values
  • initialize empty last-position records with stable sentinel values before callback exposure
  • add a regression test covering Portfolio.from_order_func(..., use_numba=False) before any order is filled

Testing

  • python -m pytest tests\test_portfolio.py -k "initialized_records" -q
  • python -m pytest tests\test_portfolio.py -k "test_pre_sim_ctx or test_post_sim_ctx" -q

@polakowo polakowo merged commit 5ad780a into polakowo:master Jul 3, 2026
1 check passed
@polakowo

polakowo commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Thanks! Merged.

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.

Initialization of record entries during from_order_func() processing

2 participants