-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add_warning' of github.com:AxFoundation/strax into add_…
…warning
- Loading branch information
Showing
8 changed files
with
317 additions
and
122 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import strax | ||
from .plugin import Plugin | ||
|
||
export, __all__ = strax.exporter() | ||
|
||
|
||
## | ||
# Plugin which allows to use yield in plugins compute method. | ||
# Allows to chunk down output before storing to disk. | ||
# Only works if multiprocessing is omitted. | ||
## | ||
|
||
|
||
@export | ||
class DownChunkingPlugin(Plugin): | ||
"""Plugin that merges data from its dependencies.""" | ||
|
||
parallel = False | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
if self.parallel: | ||
raise NotImplementedError( | ||
f'Plugin "{self.__class__.__name__}" is a DownChunkingPlugin which ' | ||
"currently does not support parallel processing." | ||
) | ||
|
||
if self.multi_output: | ||
raise NotImplementedError( | ||
f'Plugin "{self.__class__.__name__}" is a DownChunkingPlugin which ' | ||
"currently does not support multiple outputs. Please only provide " | ||
"a single data-type." | ||
) | ||
|
||
def iter(self, iters, executor=None): | ||
return super().iter(iters, executor) | ||
|
||
def _iter_compute(self, chunk_i, **inputs_merged): | ||
return self.do_compute(chunk_i=chunk_i, **inputs_merged) | ||
|
||
def _fix_output(self, result, start, end, _dtype=None): | ||
"""Wrapper around _fix_output to support the return of iterators.""" | ||
return result |
This file contains 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
This file contains 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
Oops, something went wrong.