Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
climix
climix
Commits
f43f715d
Commit
f43f715d
authored
Aug 05, 2019
by
Klaus Zimmermann
Browse files
Add post processing hook for index functions (closes
#100
)
parent
66028efe
Changes
2
Show whitespace changes
Inline
Side-by-side
climix/aggregators.py
View file @
f43f715d
...
...
@@ -27,6 +27,13 @@ class PointLocalAggregator(Aggregator):
def
post_process
(
self
,
collapsed_cube
,
data_result
,
coords
,
**
kwargs
):
cube
=
super
().
post_process
(
collapsed_cube
,
data_result
,
coords
,
**
kwargs
)
try
:
post_processor
=
self
.
index_function
.
post_process
except
AttributeError
:
# this index function does not require post processing
pass
else
:
cube
=
post_processor
(
cube
,
data_result
,
coords
,
**
kwargs
)
standard_name
=
self
.
output_metadata
[
'standard_name'
]
unit_standard_name
=
standard_name
proposed_standard_name
=
self
.
output_metadata
.
get
(
...
...
climix/index.py
View file @
f43f715d
...
...
@@ -19,7 +19,8 @@ class Index:
coord_name
=
self
.
period
.
add_coord_categorisation
(
cube
)
sub_cube
=
cube
.
extract
(
self
.
period
.
constraint
)
self
.
index_function
.
prepare
(
sub_cube
)
aggregated
=
sub_cube
.
aggregated_by
(
coord_name
,
self
.
aggregator
)
aggregated
=
sub_cube
.
aggregated_by
(
coord_name
,
self
.
aggregator
,
period
=
self
.
period
)
if
sliced_mode
:
results
=
[]
for
r
in
aggregated
.
slices_over
(
coord_name
):
...
...
Write
Preview
Supports
Markdown
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