Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add from_dense and to_dense methods #382

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

Merged
merged 15 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ repos:
# These versions need updated manually
- flake8==6.0.0
- flake8-comprehensions==3.10.1
- flake8-bugbear==23.1.20
- flake8-bugbear==23.2.13
- flake8-simplify==0.19.3
- repo: https://github.com/asottile/yesqa
rev: v1.4.0
Expand All @@ -71,7 +71,7 @@ repos:
additional_dependencies: [tomli]
files: ^(graphblas|docs)/
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.241
rev: v0.0.247
hooks:
- id: ruff
- repo: https://github.com/sphinx-contrib/sphinx-lint
Expand Down
1 change: 1 addition & 0 deletions graphblas/agg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __getattr__(key):
f"`{key}` is specific to SuiteSparse:GraphBLAS. "
f"`gb.agg.{key}` will be removed in version 2023.9.0 or later.",
DeprecationWarning,
stacklevel=2,
)
rv = _deprecated[key]
globals()[key] = rv
Expand Down
1 change: 1 addition & 0 deletions graphblas/binary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __getattr__(key):
f"`{key}` is specific to SuiteSparse:GraphBLAS. "
f"`gb.binary.{key}` will be removed in version 2023.9.0 or later.",
DeprecationWarning,
stacklevel=2,
)
rv = _deprecated[key]
globals()[key] = rv
Expand Down
5 changes: 5 additions & 0 deletions graphblas/core/automethods.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ def to_dcsr(self):
return self._get_value("to_dcsr")


def to_dense(self):
return self._get_value("to_dense")


def to_dict(self):
return self._get_value("to_dict")

Expand Down Expand Up @@ -389,6 +393,7 @@ def _main():
"reposition",
"ss",
"to_coo",
"to_dense",
"to_values",
}
vector = {
Expand Down
2 changes: 2 additions & 0 deletions graphblas/core/infix.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def dup(self, dtype=None, *, clear=False, mask=None, name=None, **opts):
else:
ss = Vector.__dict__["ss"] # raise if used
to_coo = wrapdoc(Vector.to_coo)(property(automethods.to_coo))
to_dense = wrapdoc(Vector.to_dense)(property(automethods.to_dense))
to_dict = wrapdoc(Vector.to_dict)(property(automethods.to_dict))
to_values = wrapdoc(Vector.to_values)(property(automethods.to_values))
vxm = wrapdoc(Vector.vxm)(property(automethods.vxm))
Expand Down Expand Up @@ -343,6 +344,7 @@ def dup(self, dtype=None, *, clear=False, mask=None, name=None, **opts):
to_csr = wrapdoc(Matrix.to_csr)(property(automethods.to_csr))
to_dcsc = wrapdoc(Matrix.to_dcsc)(property(automethods.to_dcsc))
to_dcsr = wrapdoc(Matrix.to_dcsr)(property(automethods.to_dcsr))
to_dense = wrapdoc(Matrix.to_dense)(property(automethods.to_dense))
to_dicts = wrapdoc(Matrix.to_dicts)(property(automethods.to_dicts))
to_edgelist = wrapdoc(Matrix.to_edgelist)(property(automethods.to_edgelist))
to_values = wrapdoc(Matrix.to_values)(property(automethods.to_values))
Expand Down
Loading