diff --git a/pymc/blocking.py b/pymc/blocking.py index 07cf8191bf..bd5da248cd 100644 --- a/pymc/blocking.py +++ b/pymc/blocking.py @@ -48,10 +48,10 @@ def map(var_dict: PointType) -> RaveledVars: vars_info = tuple((v, k, v.shape, v.dtype) for k, v in var_dict.items()) raveled_vars = [v[0].ravel() for v in vars_info] if raveled_vars: - res = np.concatenate(raveled_vars) + result = np.concatenate(raveled_vars) else: - res = np.array([]) - return RaveledVars(res, tuple(v[1:] for v in vars_info)) + result = np.array([]) + return RaveledVars(result, tuple(v[1:] for v in vars_info)) @staticmethod def rmap( @@ -69,9 +69,9 @@ def rmap( """ if start_point: - res = dict(start_point) + result = dict(start_point) else: - res = {} + result = {} if not isinstance(array, RaveledVars): raise TypeError("`array` must be a `RaveledVars` type") @@ -80,10 +80,10 @@ def rmap( for name, shape, dtype in array.point_map_info: arr_len = np.prod(shape, dtype=int) var = array.data[last_idx : last_idx + arr_len].reshape(shape).astype(dtype) - res[name] = var + result[name] = var last_idx += arr_len - return res + return result @classmethod def mapf(cls, f: Callable[[PointType], T], start_point: Optional[PointType] = None) -> T: diff --git a/pymc/math.py b/pymc/math.py index cd9587e66a..ab39527c1e 100644 --- a/pymc/math.py +++ b/pymc/math.py @@ -155,9 +155,9 @@ def kron_vector_op(v): m = m[:, None] # Treat 1D array as Nx1 matrix if m.ndim != 2: # Has not been tested otherwise raise ValueError(f"m must have ndim <= 2, not {m.ndim}") - res = kron_vector_op(m) - res_shape = res.shape - return at.reshape(res, (res_shape[1], res_shape[0])).T + result = kron_vector_op(m) + result_shape = result.shape + return at.reshape(result, (result_shape[1], result_shape[0])).T # Define kronecker functions that work on 1D and 2D arrays