Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7de77a3
invented DOnion
ParticularMiner Feb 14, 2022
df03363
introduced "DOnion": a dask array whose inner value is also a dask array
ParticularMiner Feb 15, 2022
087d0a0
ran black .
ParticularMiner Feb 15, 2022
eaf3dd8
Merge branch 'da_index' into DOnion
ParticularMiner Feb 17, 2022
865aa7d
ran flake8 and black again
ParticularMiner Feb 17, 2022
2d8faea
added flexible_partial()
ParticularMiner Feb 19, 2022
d1ef311
added tests for flexible_partial()
ParticularMiner Feb 19, 2022
f8d4951
ran `black .` and `flake8 .`
ParticularMiner Feb 19, 2022
ef40cd1
cleaned-up flexible_partial
ParticularMiner Feb 21, 2022
cba8ee8
fixed bug in flexible_partial()
ParticularMiner Feb 21, 2022
8b259f8
cleaned-up .from_values() and .to_values() from which DOnions sprout
ParticularMiner Feb 25, 2022
120b8f2
more DOnion support
ParticularMiner Mar 5, 2022
d5336d8
simplified dOnion technology
ParticularMiner Mar 9, 2022
9bf42cd
further simplified dOnion technology
ParticularMiner Mar 10, 2022
89216cb
further simplified dOnion technology:
ParticularMiner Mar 11, 2022
1662dd1
covered more tests from `from_grblas2`
ParticularMiner Mar 11, 2022
80ba866
fixed infix/auto methods; all related tests passing for Matrix
ParticularMiner Mar 16, 2022
b0f8cac
implemented `kronecker`and optimized `rechunk`
ParticularMiner Mar 17, 2022
20e542e
fixed argmin/argmax Aggregators & caught up with grblas version 2022.3.0
ParticularMiner Mar 20, 2022
3cf54e3
fixed `matmul` for transposed matrices and positional semirings
ParticularMiner Mar 22, 2022
34f525c
fixed first/last/first_index/last_index Aggregators
ParticularMiner Mar 23, 2022
f962b34
improved performance of Matrix/Vector.resize()
ParticularMiner Mar 30, 2022
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
21 changes: 21 additions & 0 deletions dask_grblas/_automethods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from grblas import config


def _get_value(self, attr=None, default=None):
if config.get("autocompute"):
if self._value is None:
self._value = self.new()
if getattr(self, "is_dOnion", False):
self._value = self._value.strip()
if attr is None:
return self._value
else:
return getattr(self._value, attr)
if default is not None:
return default.__get__(self)
raise TypeError(
f"{attr} not enabled for objects of type {type(self)}. "
f"Use `.new()` to create a new {self.output_type.__name__}.\n\n"
"Hint: use `grblas.config.set(autocompute=True)` to enable "
"automatic computation of expressions."
)
24 changes: 24 additions & 0 deletions dask_grblas/_ss/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,27 @@ def diag(self, vector, k=0, chunks="auto", dtype=None):
vector = self._parent._expect_type(vector, dgb.Vector, within="ss.diag", argname="vector")
rv = vector._diag(k, chunks=chunks, dtype=dtype)
self._parent.__init__(rv._delayed, nvals=rv._nvals)

def build_scalar(
self,
rows,
columns,
values,
*,
dup_op=None,
clear=False,
nrows=None,
ncols=None,
chunks=None,
in_dOnion=False, # not part of the API
):
self._parent.build(
rows,
columns,
values,
dup_op=dup_op,
clear=clear,
nrows=nrows,
ncols=ncols,
chunks=chunks,
)
Loading