Skip to content

Fix Rectangle.is_orthant for one-sided and degenerate bounds - #425

Open
dajiaohuang wants to merge 1 commit into
alphaville:masterfrom
dajiaohuang:fix/rectangle-orthant
Open

dajiaohuang wants to merge 1 commit into
alphaville:masterfrom
dajiaohuang:fix/rectangle-orthant

Conversation

@dajiaohuang

Copy link
Copy Markdown

Fixes #424.

Normalize absent bounds to negative/positive infinity, then check each coordinate interval as a pair. This supports one-sided orthants and rejects zero-width intervals or unrestricted coordinates. Add five cases to the existing constraints unittest class.

Validation: original actual class raised TypeError on both one-sided cases and returned True for [0,0]. Six synthetic class cases pass after the fix. The original orthant unittest plus the added method (five subcases) pass against the actual revised class, extracted with AST to avoid unrelated CasADi imports. Full Python/CasADi and Rust suites were not run; no solver or hardware workloads ran. Both files parse successfully.

Submitted under the existing dual MIT/Apache terms. Git author and committer explicitly use the authorized identity.

This branch has not been deployed

No deployments
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.

Rectangle.is_orthant fails for one-sided bounds and accepts non-orthants

1 participant