Skip to content

Commit 017a4f9

Browse files
committed
persistent_block - collect func
1 parent aeee808 commit 017a4f9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/dataclay/contrib/persistent_block.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
from pycompss.api.parameter import IN
1212
except ImportError:
1313
from dataclay.contrib.pycompss_dummy.dummy_pycompss import task, IN
14-
14+
import logging
15+
logger = logging.getLogger(__name__)
1516

1617
class PersistentBlock(DataClayObject):
1718
block_data: np.ndarray
@@ -77,6 +78,11 @@ def partial_histogram(self, n_bins: int, n_dimensions: int) -> np.ndarray:
7778
values, _ = np.histogramdd(self.block_data, n_bins, [(0, 1)] * n_dimensions)
7879
return values
7980

81+
@activemethod
82+
def collect(self, squeeze=True):
83+
return self.block_data
84+
8085
@activemethod
8186
def block_apply(self, func, *args, **kwargs):
82-
return func(self.block_data, *args, **kwargs)
87+
self.block_data=func(self.block_data,*args, **kwargs)
88+
return self.block_data

0 commit comments

Comments
 (0)