Commit 59addca9 authored by Klaus Zimmermann's avatar Klaus Zimmermann
Browse files

Fix multi variable indices (fixes #208)

parent c153e78e
[flake8]
max-line-length = 88
extend-ignore = E203
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment