Skip to content

fix: validate DiscreteAllocation prices and reject empty weights on allocate - #4

Merged
Geochelone666 merged 1 commit into
mainfrom
fix-discrete-allocation-price-validation
Oct 28, 2026
Merged

Geochelone666 merged 1 commit into
mainfrom
fix-discrete-allocation-price-validation

Conversation

@Geochelone666

Copy link
Copy Markdown
Owner

Validate prices for weighted tickers in DiscreteAllocation: missing tickers, zero, negative, or infinite prices now raise ValueError instead of producing bad allocations. Prices of tickers without weights are ignored. An empty weights dict is still accepted at construction (for utility methods) but greedy_portfolio and lp_portfolio raise ValueError.

Adds regression tests for missing prices, bad prices, unweighted-asset prices, and empty weights. Local run on this branch: 330 passed, 4 skipped. Own fork only, no upstream PR.

@Geochelone666
Geochelone666 merged commit 004d3a8 into main Oct 28, 2026
40 checks passed
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