Skip to content

More general checkbounds and blockcheckbounds #469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mtfishman
Copy link
Collaborator

This adds support for more bounds checking, such as checkbounds(A, Block.(2:3), Block.(2:3)), checkbounds(A, Block(2, 2)[1:3, 1:3]), etc.

It also fixes #458.

@@ -164,6 +164,7 @@ end

block(b::BlockIndex) = Block(b.I...)
blockindex(b::BlockIndex{1}) = b.α[1]
blockindex(b::BlockIndex) = CartesianIndex(b.α)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be slightly controversial. I think it is nice to be able to use blockindex on general BlockIndex, and this is the only definition I can think of that is consistent with the 1-dimensional case.

Copy link

codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.66%. Comparing base (4059149) to head (593e7f3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #469      +/-   ##
==========================================
+ Coverage   93.64%   93.66%   +0.02%     
==========================================
  Files          19       19              
  Lines        1667     1689      +22     
==========================================
+ Hits         1561     1582      +21     
- Misses        106      107       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Should blockcheckbounds(A, K) be called from checkbounds(A, Block(K))?
2 participants