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
Klaus Zimmermann
climix
Commits
59addca9
Commit
59addca9
authored
Apr 16, 2021
by
Klaus Zimmermann
Browse files
Fix multi variable indices (fixes
#208
)
parent
c153e78e
Changes
3
Hide whitespace changes
Inline
Side-by-side
.flake8
0 → 100644
View file @
59addca9
[flake8]
max-line-length = 88
extend-ignore = E203
CHANGELOG.md
View file @
59addca9
...
...
@@ -22,20 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.13.1] - 2020-10-21
### Added
### Changed
### Deprecated
### Removed
### Fixed
-
Rename percentile_occurrence index function (fixes #202)
### Security
## [0.13.0] - 2020-10-19
...
...
climix/iris.py
View file @
59addca9
...
...
@@ -107,6 +107,12 @@ def multicube_aggregated_by(cubes, coords, aggregator, **kwargs):
lambda
groupby_slice
:
ref_cube
[
front_slice
+
(
groupby_slice
,)
+
back_slice
],
groupby
.
group
(),)
def
agg
(
cube
):
data
=
data_getter
(
cube
)
result
=
aggregate
(
data
,
axis
=
dimension_to_groupby
,
cube
=
cube
,
**
kwargs
)
return
result
else
:
groupby_subcubes
=
map
(
lambda
groupby_slice
:
{
...
...
@@ -116,11 +122,12 @@ def multicube_aggregated_by(cubes, coords, aggregator, **kwargs):
groupby
.
group
(),
)
def
agg
(
cube
):
data
=
data_getter
(
cube
)
result
=
aggregate
(
data
,
axis
=
dimension_to_groupby
,
cube
=
cube
,
**
kwargs
)
return
result
def
agg
(
cubes
):
data
=
{
argname
:
data_getter
(
cube
)
for
argname
,
cube
in
cubes
.
items
()}
result
=
aggregate
(
data
,
axis
=
dimension_to_groupby
,
cube
=
cubes
,
**
kwargs
)
return
result
result
=
list
(
map
(
agg
,
groupby_subcubes
))
aggregateby_data
=
stack
(
result
,
axis
=
dimension_to_groupby
)
...
...
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