Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
climix
climix
Commits
6faa668f
Commit
6faa668f
authored
Jul 22, 2021
by
Klaus Zimmermann
Browse files
Fix (dask) meta handling in spell functions (closes #242)
parent
c3e5c17a
Changes
1
Hide whitespace changes
Inline
Side-by-side
climix/index_functions/spell_functions.py
View file @
6faa668f
...
...
@@ -36,6 +36,7 @@ class SpellLength(ThresholdMixin, ReducerMixin, IndexFunction):
axis
=-
1
,
dtype
=
int
,
concatenate
=
False
,
meta
=
np
.
array
((),
dtype
=
int
),
)
res
=
da
.
ma
.
masked_array
(
da
.
ma
.
getdata
(
res
),
np
.
broadcast_to
(
mask
[...,
np
.
newaxis
],
res
.
shape
)
...
...
@@ -44,7 +45,7 @@ class SpellLength(ThresholdMixin, ReducerMixin, IndexFunction):
def
chunk
(
self
,
raw_data
,
axis
,
keepdims
,
computing_meta
=
False
):
if
computing_meta
:
return
np
.
array
((
0
,),
ndim
=
1
,
dtype
=
int
)
return
np
.
array
((
)
,
dtype
=
int
)
data
=
self
.
condition
(
raw_data
,
self
.
threshold
.
points
)
chunk_res
=
self
.
kernels
.
chunk
(
data
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment