Skip to content

fix: empty for linear expressions with terms#424

Merged
FabianHofmann merged 2 commits intomasterfrom
fix/empty-for-existing-terms
Mar 11, 2025
Merged

fix: empty for linear expressions with terms#424
FabianHofmann merged 2 commits intomasterfrom
fix/empty-for-existing-terms

Conversation

@coroa
Copy link
Copy Markdown
Member

@coroa coroa commented Mar 11, 2025

Changes proposed in this Pull Request

The .empty() method was testing for .shape == (0,) which is incorrect, when there
are any other dimensions. Instead here we rely on not .size which is equivalent to np.prod(.shape).

The first commit adds a failing test. The second commit fixes it.

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@coroa coroa requested a review from FabianHofmann March 11, 2025 17:39
@FabianHofmann FabianHofmann merged commit 792d158 into master Mar 11, 2025
21 checks passed
@FabianHofmann FabianHofmann deleted the fix/empty-for-existing-terms branch March 11, 2025 19:35
@coroa coroa mentioned this pull request Mar 12, 2025
4 tasks
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