Skip to content

Commit

Permalink
update docstrings to remove outdated np.int references
Browse files Browse the repository at this point in the history
  • Loading branch information
gergness committed Mar 3, 2021
1 parent 2ecae53 commit f9e0b2a
Show file tree
Hide file tree
Showing 9 changed files with 220 additions and 241 deletions.
45 changes: 23 additions & 22 deletions src/cr/cube/cubepart.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def column_std_err(self):

@lazyproperty
def column_unweighted_bases(self):
"""2D np.int64 ndarray of unweighted column-proportion denominator per cell."""
"""2D np.float64 ndarray of unweighted column-proportion denominator per cell."""
return self._assembler.column_unweighted_bases

@lazyproperty
Expand All @@ -324,7 +324,7 @@ def column_weighted_bases(self):

@lazyproperty
def columns_base(self):
"""1D/2D np.int64 ndarray of unweighted-N for each column/cell of slice.
"""1D/2D np.float64 ndarray of unweighted-N for each column/cell of slice.
This array is 2D (a distinct base for each cell) when the rows dimension is MR,
because each MR-subvariable has its own unweighted N. This is because not every
Expand All @@ -349,7 +349,7 @@ def columns_dimension_type(self):

@lazyproperty
def columns_margin(self):
"""1D or 2D np.float/int64 ndarray of weighted-N for each column of slice.
"""1D or 2D np.float64 ndarray of weighted-N for each column of slice.
This array is 2D (a distinct margin value for each cell) when the rows dimension
is MR, because each MR-subvariable has its own weighted N. This is because not
Expand Down Expand Up @@ -474,7 +474,7 @@ def columns_scale_mean_stderr(self):

@lazyproperty
def columns_scale_median(self):
"""Optional 1D np.int/float64 ndarray of scale median for each column.
"""Optional 1D np.float64 ndarray of scale median for each column.
The returned vector is to be interpreted as a summary *row*. Also note that the
underlying scale values are based on the numeric values of the opposing
Expand All @@ -494,7 +494,7 @@ def columns_scale_median(self):
for i in range(counts.shape[1])
]
)

assert scale_median.dtype == np.float64
return scale_median

@lazyproperty
Expand Down Expand Up @@ -712,7 +712,7 @@ def row_std_err(self):

@lazyproperty
def row_unweighted_bases(self):
"""2D np.int64 ndarray of unweighted row-proportion denominator per cell."""
"""2D np.float64 ndarray of unweighted row-proportion denominator per cell."""
return self._assembler.row_unweighted_bases

@lazyproperty
Expand All @@ -722,7 +722,7 @@ def row_weighted_bases(self):

@lazyproperty
def rows_base(self):
"""1D/2D np.int64 ndarray of unweighted-N for each row/cell of slice.
"""1D/2D np.float64 ndarray of unweighted-N for each row/cell of slice.
This array is 2D (a distinct base for each cell) when the columns dimension is
MR, because each MR-subvariable has its own unweighted N. This is because not
Expand Down Expand Up @@ -766,7 +766,7 @@ def rows_dimension_type(self):

@lazyproperty
def rows_margin(self):
"""1D or 2D np.float/int64 ndarray of weighted-N for each column of slice.
"""1D or 2D np.float64 ndarray of weighted-N for each column of slice.
This array is 2D (a distinct margin value for each cell) when the columns
dimension is MR, because each MR-subvariable has its own weighted N. This is
Expand Down Expand Up @@ -858,7 +858,7 @@ def rows_scale_mean_stderr(self):

@lazyproperty
def rows_scale_median(self):
"""Optional 1D np.int/float64 ndarray of scale median for each row.
"""Optional 1D np.float64 ndarray of scale median for each row.
The returned vector is to be interpreted as a summary *column*. Also note that
the underlying scale values are based on the numeric values of the opposing
Expand All @@ -878,6 +878,7 @@ def rows_scale_median(self):
for i in range(counts.shape[0])
]
)
assert scale_median.dtype == np.float64
return scale_median

@lazyproperty
Expand Down Expand Up @@ -932,7 +933,7 @@ def summary_pairwise_indices(self):

@lazyproperty
def table_base(self):
"""Scalar or 1D/2D np.int64 ndarray of unweighted-N for table.
"""Scalar or 1D/2D np.float64 ndarray of unweighted-N for table.
This value is scalar when the slice has no MR dimensions, 1D when the slice has
one MR dimension (either MR_X or X_MR), and 2D for an MR_X_MR slice.
Expand All @@ -944,7 +945,7 @@ def table_base(self):

@lazyproperty
def table_base_unpruned(self):
"""np.int64 scalar or a 1D or 2D ndarray of np.int64 representing table base.
"""np.float64 scalar or a 1D or 2D ndarray of np.float64 representing table base.
This value includes hidden vectors, those with either a hide transform on
their element or that have been pruned (because their base (N) is zero). This
Expand All @@ -961,7 +962,7 @@ def table_base_unpruned(self):

@lazyproperty
def table_margin(self):
"""Scalar or 1D/2D np.float/int64 ndarray of weighted-N table.
"""Scalar or 1D/2D np.float64 ndarray of weighted-N table.
This value is scalar when the slice has no MR dimensions, 1D when the slice has
one MR dimension (either MR_X or X_MR), and 2D for an MR_X_MR slice.
Expand All @@ -973,7 +974,7 @@ def table_margin(self):

@lazyproperty
def table_margin_unpruned(self):
"""np.float/int64 scalar or a 1D or 2D ndarray of np.float/int64 table margin.
"""np.float64 scalar or a 1D or 2D ndarray of np.float64 table margin.
This value includes hidden vectors, those with either a hide transform on
their element or that have been pruned (because their base (N) is zero). Also,
Expand Down Expand Up @@ -1043,7 +1044,7 @@ def table_std_err(self):

@lazyproperty
def table_unweighted_bases(self):
"""2D np.int64 ndarray of unweighted table-proportion denominator per cell."""
"""2D np.float64 ndarray of unweighted table-proportion denominator per cell."""
return self._assembler.table_unweighted_bases

@lazyproperty
Expand All @@ -1053,7 +1054,7 @@ def table_weighted_bases(self):

@lazyproperty
def unweighted_counts(self):
"""2D np.int64 ndarray of unweighted count for each slice matrix cell."""
"""2D np.float64 ndarray of unweighted count for each slice matrix cell."""
return self._assembler.unweighted_counts

@lazyproperty
Expand Down Expand Up @@ -1227,7 +1228,7 @@ def __init__(self, cube, transforms, population, ca_as_0th, slice_idx, mask_size

@lazyproperty
def counts(self):
"""1D np.float/int64 ndarray of (weighted) count for each row of strand.
"""1D np.float64 ndarray of (weighted) count for each row of strand.
The values are int when the underlying cube-result has no weighting.
"""
Expand Down Expand Up @@ -1315,7 +1316,7 @@ def row_labels(self):

@lazyproperty
def rows_base(self):
"""1D np.int64 ndarray of unweighted-N for each row of slice."""
"""1D np.float64 ndarray of unweighted-N for each row of slice."""
# --- for a strand, this is the same as unweighted-counts, but needs this
# --- alternate property so it can be accessed uniformly between a slice and a
# --- strand.
Expand Down Expand Up @@ -1348,7 +1349,7 @@ def rows_dimension_type(self):

@lazyproperty
def rows_margin(self):
"""1D np.float/int64 ndarray of weighted-N for each row of slice."""
"""1D np.float64 ndarray of weighted-N for each row of slice."""
# --- for a strand, this is the same as (weighted) counts, but needs this
# --- alternate name so it can be accessed uniformly between a slice and strand.
return self.counts
Expand Down Expand Up @@ -1411,7 +1412,7 @@ def smoothed_dimension_dict(self):

@lazyproperty
def table_base_range(self):
"""[min, max] np.int64 ndarray range of unweighted-N for this stripe.
"""[min, max] np.float64 ndarray range of unweighted-N for this stripe.
A non-MR stripe will have a single base, represented by min and max being the
same value. Each row of an MR stripe has a distinct base, which is reduced to a
Expand Down Expand Up @@ -1486,7 +1487,7 @@ def title(self):

@lazyproperty
def unweighted_bases(self):
"""1D np.int64 ndarray of base count for each row, before weighting.
"""1D np.float64 ndarray of base count for each row, before weighting.
When the rows dimension is multiple-response (MR), each value is different,
reflecting the base for that individual subvariable. In all other cases, the
Expand All @@ -1496,12 +1497,12 @@ def unweighted_bases(self):

@lazyproperty
def unweighted_counts(self):
"""1D np.int64 ndarray of unweighted count for each row of stripe."""
"""1D np.float64 ndarray of unweighted count for each row of stripe."""
return self._assembler.unweighted_counts

@lazyproperty
def weighted_bases(self):
"""1D np.float/int64 ndarray of table-proportion denominator for each row.
"""1D np.float64 ndarray of table-proportion denominator for each row.
For a non-MR strand, all values in the array are the same. For an MR strand,
each value may be different, reflecting the fact that not all response options
Expand Down
20 changes: 10 additions & 10 deletions src/cr/cube/matrix/assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def column_proportions(self):

@lazyproperty
def column_unweighted_bases(self):
"""2D np.int64 ndarray of unweighted col-proportions denominator per cell."""
"""2D np.float64 ndarray of unweighted col-proportions denominator per cell."""
return self._assemble_matrix(self._measures.column_unweighted_bases.blocks)

@lazyproperty
Expand All @@ -99,7 +99,7 @@ def column_weighted_bases(self):

@lazyproperty
def columns_base(self):
"""1D/2D np.int64 ndarray of unweighted-N for each slice column/cell."""
"""1D/2D np.float64 ndarray of unweighted-N for each slice column/cell."""
# --- an MR_X slice produces a 2D column-base (each cell has its own N) ---
columns_base = self._cube_result_matrix.columns_base
rows_dim_type = self._rows_dimension.dimension_type
Expand Down Expand Up @@ -199,7 +199,7 @@ def row_proportions(self):

@lazyproperty
def row_unweighted_bases(self):
"""2D np.int64 ndarray of unweighted row-proportions denominator per cell."""
"""2D np.float64 ndarray of unweighted row-proportions denominator per cell."""
return self._assemble_matrix(self._measures.row_unweighted_bases.blocks)

@lazyproperty
Expand All @@ -209,7 +209,7 @@ def row_weighted_bases(self):

@lazyproperty
def rows_base(self):
"""1D/2D np.int64 ndarray of unweighted-N for each slice row/cell."""
"""1D/2D np.float64 ndarray of unweighted-N for each slice row/cell."""
# --- an X_MR slice produces a 2D row-base (each cell has its own N) ---
if self._columns_dimension.dimension_type == DT.MR_SUBVAR:
return self._assemble_matrix(
Expand Down Expand Up @@ -268,7 +268,7 @@ def rows_margin(self):

@lazyproperty
def table_base(self):
"""Scalar, 1D, or 2D ndarray of np.int64 unweighted-N for this slice.
"""Scalar, 1D, or 2D ndarray of np.float64 unweighted-N for this slice.
This value has four distinct forms, depending on the slice dimensions:
Expand Down Expand Up @@ -305,7 +305,7 @@ def table_base(self):

@lazyproperty
def table_base_unpruned(self):
"""np.int64 scalar or a 1D or 2D ndarray of np.int64 representing table base.
"""np.float64 scalar or a 1D or 2D ndarray of np.float64 representing table base.
This value includes hidden vectors, those with either a hide transform on
their element or that have been pruned (because their base (N) is zero). Also,
Expand Down Expand Up @@ -371,7 +371,7 @@ def table_margin(self):

@lazyproperty
def table_margin_unpruned(self):
"""np.float/int64 scalar or a 1D or 2D ndarray of np.float/int64 table margin.
"""np.float64 scalar or a 1D or 2D ndarray of np.float64 table margin.
This value includes hidden vectors, those with either a hide transform on
their element or that have been pruned (because their base (N) is zero). Also,
Expand Down Expand Up @@ -401,7 +401,7 @@ def table_stderrs(self):

@lazyproperty
def table_unweighted_bases(self):
"""2D np.int64 ndarray of unweighted table-proportion denominator per cell."""
"""2D np.float64 ndarray of unweighted table-proportion denominator per cell."""
return self._assemble_matrix(self._measures.table_unweighted_bases.blocks)

@lazyproperty
Expand All @@ -411,12 +411,12 @@ def table_weighted_bases(self):

@lazyproperty
def unweighted_counts(self):
"""2D np.int64 ndarray of unweighted-count for each cell."""
"""2D np.float64 ndarray of unweighted-count for each cell."""
return self._assemble_matrix(self._measures.unweighted_counts.blocks)

@lazyproperty
def weighted_counts(self):
"""2D np.float/int64 ndarray of weighted-count for each cell."""
"""2D np.float64 ndarray of weighted-count for each cell."""
return self._assemble_matrix(self._measures.weighted_counts.blocks)

@lazyproperty
Expand Down
Loading

0 comments on commit f9e0b2a

Please sign in to comment.