Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Addgb.MAX_SIZE, which isGrB_INDEX_MAX + 1#519

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
eriknw merged 4 commits intopython-graphblas:mainfromeriknw:gb_index_max
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletionsgraphblas/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,6 +39,7 @@ def get_config():
backend = None
_init_params = None
_SPECIAL_ATTRS = {
"MAX_SIZE", # The maximum size of Vector and Matrix dimensions (GrB_INDEX_MAX + 1)
"Matrix",
"Recorder",
"Scalar",
Expand DownExpand Up@@ -205,6 +206,10 @@ def _load(name):
if name in {"Matrix", "Vector", "Scalar", "Recorder"}:
module = _import_module(f".core.{name.lower()}", __name__)
globals()[name] = getattr(module, name)
elif name == "MAX_SIZE":
from .core import lib

globals()[name] = lib.GrB_INDEX_MAX + 1
else:
# Everything else is a module
globals()[name] = _import_module(f".{name}", __name__)
Expand Down
4 changes: 4 additions & 0 deletionsgraphblas/tests/test_core.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,3 +90,7 @@ def test_packages():
assert (
pkgs == pkgs2
), "If there are extra items on the left, add them to pyproject.toml:tool.setuptools.packages"


def test_index_max():
assert gb.MAX_SIZE == 2**60 # True for all current backends
2 changes: 1 addition & 1 deletionscripts/test_imports.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ if ! python -c "from graphblas.select import tril" ; then exit 1 ; fi
if ! python -c "from graphblas.semiring import plus_times" ; then exit 1 ; fi
if ! python -c "from graphblas.unary import exp" ; then exit 1 ; fi
if ! (for attr in Matrix Scalar Vector Recorder agg binary dtypes exceptions \
init io monoid op select semiring tests unary ss viz
init io monoid op select semiring tests unary ss viz MAX_SIZE
do echo python -c \"from graphblas import $attr\"
if ! python -c "from graphblas import $attr"
then exit 1
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp