Skip to content

Commit

Permalink
Merge branch 'fix-index-error-160656307' into rel-5.2.355
Browse files Browse the repository at this point in the history
  • Loading branch information
Crunch.io Jenkins Account committed Sep 21, 2018
2 parents 9173a8e + 34db6a9 commit 1931eb4
Show file tree
Hide file tree
Showing 8 changed files with 1,247 additions and 26 deletions.
61 changes: 37 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,46 +96,59 @@ The detailed description can be found

## Changes

1.0 Initial release
### 1.0 Initial release

1.1 *Fix stray ipdb.
### 1.1 Fix stray ipdb.

1.2 Support exporter
### 1.2 Support exporter

1.3 Implement Headers & Subtotals
### 1.3 Implement Headers & Subtotals

1.4 Update based on tabbook tests from `cr.lib`
### 1.4 Update based on tabbook tests from `cr.lib`

1.4.1 Update based on deck tests from `cr.server`
#### 1.4.1 Update based on deck tests from `cr.server`

1.4.2 Fix bugs discovered by first `cr.exporter` deploy to alpha
#### 1.4.2 Fix bugs discovered by first `cr.exporter` deploy to alpha

1.4.3 Fix bug (exporting 2D crtab with H&S on row only)
#### 1.4.3 Fix bug (exporting 2D crtab with H&S on row only)

1.4.4 Implement obtaining labels with category ids (useful for H&S in exporter)
#### 1.4.4 Implement obtaining labels with category ids (useful for H&S in exporter)

1.4.5 Fix MR x MR proportions calculation
#### 1.4.5 Fix MR x MR proportions calculation

1.5.0 Start implementing index table functionality
### 1.5.0 Start implementing index table functionality

1.5.1 Implement index for MR x MR
#### 1.5.1 Implement index for MR x MR

1.5.2 Fix bugs with `anchor: 0` for H&S
#### 1.5.2 Fix bugs with `anchor: 0` for H&S

1.5.3 Fix bugs with invalid input data for H&S
#### 1.5.3 Fix bugs with invalid input data for H&S

1.6.0 Z-Score and bug fixes.
### 1.6.0 Z-Score and bug fixes.

1.6.1 standardized_residuals are now included.
#### 1.6.1 `standardized_residuals` are now included.

1.6.2 support "Before" and "After" in variable transformations since they exist in zz9 data.
#### 1.6.2 support "Before" and "After" in variable transformations since they exist in zz9 data.

1.6.4 Fixes for 3d Pruning.
#### 1.6.4 Fixes for 3d Pruning.

1.6.5 Fixes for Pruning and Headers and subtotals.
Population size support.
Fx various calculations in 3d cubes.
#### 1.6.5 Fixes for Pruning and Headers and subtotals.
- Population size support.
- Fx various calculations in 3d cubes.

1.6.6 Added support for CubeSlice, which always represents a
2D cube (even if they're the slices of a 3D cube).
Various fixes for support of wide-export
#### 1.6.6 Added support for CubeSlice, which always represents a
- 2D cube (even if they're the slices of a 3D cube).
- Various fixes for support of wide-export

#### 1.6.7 Population fraction
- Various bugfixes and optimizations.
- Add property `population_fraction`. This is needed for the exporter to be able to calculate the correct population counts, based on weighted/unweighted and filtered/unfiltered states of the cube.
- Apply newly added `population_fraction` to the calculation of `population_counts`.
- Modify API for `scale_means`. It now accepts additional parameters `hs_dims` (defaults to `None`) and `prune` (defaults to `False`). Also, the format of the return value is slightly different in nature. It is a list of lists of numpy arrrays. It functions like this:
- The outermost list corresponds to cube slices. If cube.ndim < 3, then it's a single-element list
- Inner lists have either 1 or 2 elements (if they're a 1D cube slice, or a 2D cube slice, respectively).
- If there are scale means defined on the corresponding dimension of the cube slice, then the inner list element is a numpy array with scale means. If it doesn't have scale means defined (numeric values), then the element is `None`.
- Add property `ca_dim_ind` to `CubeSlice`.
- Add property `is_double_mr` to `CubeSlice` (which is needed since it differs from the interpretation of the cube. E.g. MR x CA x MR will render slices which are *not* double MRs).
- Add `shape`, `ndim`, and `scale_means` to `CubeSlice`, for accessibility.
- `index` now also operates on slices (no api change).
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import setup, find_packages

version = '1.6.6'
version = '1.6.7'


def get_long_desc():
Expand Down
3 changes: 2 additions & 1 deletion src/cr/cube/crunch_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ def _transform(self, res, include_transforms_for_dims,
i - dim_offset in include_transforms_for_dims)
if dim.type == 'multiple_response':
dim_offset += 1
if not transform or dim.type in ITEM_DIMENSION_TYPES:
if (not transform or
dim.type in ITEM_DIMENSION_TYPES or dim.is_selections):
continue
# Perform transformations
insertions = self._insertions(res, dim, i)
Expand Down
3 changes: 3 additions & 0 deletions src/cr/cube/dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ def elements_by_id(self):
@lazyproperty
def hs_indices(self):
'''Headers and Subtotals indices.'''
if self.is_selections:
return []

eid = self.elements_by_id

indices = []
Expand Down
1 change: 1 addition & 0 deletions tests/integration/fixtures/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,4 @@ def _load(cube_file):
CA_ITEMS_X_CA_CAT_X_CAT = _load('ca-items-x-ca-cat-x-cat.json')
CAT_X_MR_X_CAT = _load('cat-x-mr-x-cat.json')
CAT_X_CAT_FILTERED_POP = _load('cat-x-cat-filtered-population.json')
UNIV_MR_WITH_HS = _load('univ-mr-with-hs.json')
Loading

0 comments on commit 1931eb4

Please sign in to comment.