Move _check_mask into core/mask.py and drop dead numpy 1.21/1.22 guards - #607
Open
eriknw wants to merge 1 commit into
Open
Move _check_mask into core/mask.py and drop dead numpy 1.21/1.22 guards#607eriknw wants to merge 1 commit into
eriknw wants to merge 1 commit into
Conversation
eriknw
marked this pull request as ready for review
August 4, 2026 16:07
eriknw
force-pushed
the
27-check-mask-move
branch
from
August 4, 2026 16:12
d0b3ed6 to
854f67a
Compare
eriknw
force-pushed
the
27-check-mask-move
branch
from
August 5, 2026 00:06
854f67a to
2cae853
Compare
eriknw
force-pushed
the
27-check-mask-move
branch
2 times, most recently
from
August 5, 2026 17:44
22e899c to
533a9a8
Compare
eriknw
force-pushed
the
27-check-mask-move
branch
from
August 5, 2026 18:03
533a9a8 to
0def607
Compare
eriknw
force-pushed
the
27-check-mask-move
branch
2 times, most recently
from
August 6, 2026 07:59
cac378d to
b7fdc67
Compare
eriknw
force-pushed
the
27-check-mask-move
branch
from
August 6, 2026 15:39
b7fdc67 to
521602f
Compare
eriknw
force-pushed
the
27-check-mask-move
branch
3 times, most recently
from
August 6, 2026 20:41
3b188f3 to
47deb54
Compare
eriknw
force-pushed
the
27-check-mask-move
branch
from
August 7, 2026 02:48
47deb54 to
3a71140
Compare
Two cleanups that share matrix.py and vector.py in disjoint regions. _check_mask lived in base.py, so mask.py had to defer-import it inside three methods (Mask.new, Mask.__and__, Mask.__or__) to dodge the import cycle. It is mask logic, so it now lives in mask.py and those three calls are direct. base.py, matrix.py, and vector.py import it from mask.py; no new cycle appears, because mask.py has no module-level import of base. expr.py still needs a function-level import (the import cycle closes through mask.py's own module-level import of graphblas.binary names), now pointed at mask.py. Matrix.from_dicts and Vector.from_dict each carried a np.__version__ fallback for subarray dtypes on numpy 1.21 and 1.22, where np.fromiter could not build them. pyproject.toml requires numpy >=1.24, so neither branch was reachable. The np.fromiter path stays. What this does not change: same function, same signature, same error messages. The wrong-kind-mask TypeError and its assignment carve-out move across intact. The suite count under the pinned config (--backend suitesparse --blocking --no-mapnumpy) is identical before and after (1073 passed, 141 skipped).
eriknw
force-pushed
the
27-check-mask-move
branch
from
August 7, 2026 05:09
3a71140 to
9bbad15
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two cleanups that share matrix.py and vector.py in disjoint regions.
_check_mask lived in base.py, so mask.py had to defer-import it inside
three methods (Mask.new, Mask.and, Mask.or) to dodge the import
cycle. It is mask logic, so it now lives in mask.py and those three
calls are direct. base.py, matrix.py, and vector.py import it from
mask.py; no new cycle appears, because mask.py has no module-level
import of base. expr.py still needs a function-level import (the import
cycle closes through mask.py's own module-level import of graphblas.binary
names), now pointed at mask.py.
Matrix.from_dicts and Vector.from_dict each carried a np.version
fallback for subarray dtypes on numpy 1.21 and 1.22, where np.fromiter
could not build them. pyproject.toml requires numpy >=1.24, so neither
branch was reachable. The np.fromiter path stays.
What this does not change: same function, same signature, same error
messages. The wrong-kind-mask TypeError and its assignment carve-out
move across intact. The suite count under the pinned config (--backend
suitesparse --blocking --no-mapnumpy) is identical before and
after (1073 passed, 141 skipped).
Stack created with GitHub Stacks CLI • Give Feedback 💬