Compare 424520d ... +0 ... a060bd6

Coverage Reach
randvars/_random_variable.py randvars/_normal.py randvars/_arithmetic.py randvars/_scipy_stats.py randvars/_constant.py randvars/_categorical.py randvars/__init__.py randvars/_utils.py linops/_linear_operator.py linops/_kronecker.py linops/_arithmetic.py linops/_scaling.py linops/__init__.py linops/_utils.py statespace/integrator.py statespace/sde.py statespace/discrete_transition.py statespace/diffusions.py statespace/transition.py statespace/preconditioner.py statespace/__init__.py statespace/generate_samples.py statespace/sde_utils.py statespace/discrete_transition_utils.py filtsmooth/_gaussfiltsmooth/_kalmanposterior.py filtsmooth/_gaussfiltsmooth/_extendedkalman.py filtsmooth/_gaussfiltsmooth/_kalman.py filtsmooth/_gaussfiltsmooth/_unscentedkalman.py filtsmooth/_gaussfiltsmooth/_unscentedtransform.py filtsmooth/_gaussfiltsmooth/_iterated_component.py filtsmooth/_gaussfiltsmooth/_stoppingcriterion.py filtsmooth/_gaussfiltsmooth/__init__.py filtsmooth/_particlefiltsmooth/_particle_filter.py filtsmooth/_particlefiltsmooth/_importance_distributions.py filtsmooth/_particlefiltsmooth/_particle_filter_posterior.py filtsmooth/_particlefiltsmooth/__init__.py filtsmooth/_timeseriesposterior.py filtsmooth/_utils.py filtsmooth/__init__.py filtsmooth/_bayesfiltsmooth.py diffeq/odefiltsmooth/ivpfiltsmooth.py diffeq/odefiltsmooth/initialize.py diffeq/odefiltsmooth/kalman_odesolution.py diffeq/odefiltsmooth/odefiltsmooth.py diffeq/odefiltsmooth/__init__.py diffeq/ode/ivp_examples.py diffeq/ode/ode.py diffeq/ode/ivp.py diffeq/ode/__init__.py diffeq/perturbedsolvers/_perturbedstepsolver.py diffeq/perturbedsolvers/_perturbedstepsolution.py diffeq/perturbedsolvers/_perturbation_functions.py diffeq/perturbedsolvers/__init__.py diffeq/steprule.py diffeq/wrappedscipysolver.py diffeq/odesolver.py diffeq/odesolution.py diffeq/wrappedscipyodesolution.py diffeq/__init__.py linalg/linearsolvers/matrixbased.py linalg/linearsolvers/linearsolvers.py linalg/linearsolvers/solutionbased.py linalg/linearsolvers/__init__.py linalg/__init__.py problems/zoo/linalg/_suitesparse_matrix.py problems/zoo/linalg/_random_spd_matrix.py problems/zoo/linalg/__init__.py problems/zoo/filtsmooth/_filtsmooth_problems.py problems/zoo/filtsmooth/__init__.py problems/zoo/diffeq/_ivp_examples_jax.py problems/zoo/diffeq/_ivp_examples.py problems/zoo/diffeq/__init__.py problems/_problems.py problems/__init__.py quad/_integration_measures.py quad/kernel_embeddings/_kernel_embedding.py quad/kernel_embeddings/_expquad_gauss.py quad/kernel_embeddings/_expquad_lebesgue.py quad/kernel_embeddings/__init__.py quad/bq_methods/bayesian_quadrature.py quad/bq_methods/__init__.py quad/_bayesquad.py quad/__init__.py quad/policies/sample_measure.py quad/policies/__init__.py kernels/_kernel.py kernels/_matern.py kernels/_rational_quadratic.py kernels/_exponentiated_quadratic.py kernels/_polynomial.py kernels/_linear.py kernels/_white_noise.py kernels/__init__.py randprocs/_random_process.py randprocs/_gaussian_process.py randprocs/_markov_process.py randprocs/__init__.py utils/argutils.py utils/arrayutils.py utils/linalg/_cholesky_updates.py utils/linalg/__init__.py utils/randomutils.py utils/__init__.py _randomvariablelist.py typing.py __init__.py _probabilistic_numerical_method.py

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -97,16 +97,16 @@
Loading
97 97
    density: float,
98 98
    chol_entry_min: float = 0.1,
99 99
    chol_entry_max: float = 1.0,
100 -
    format="csr",
100 +
    format="csr",  # pylint: disable="redefined-builtin"
101 101
    random_state: Optional[RandomStateArgType] = None,
102 102
) -> np.ndarray:
103 -
    """Random sparse symmetric positive definite matrix.
103 +
    r"""Random sparse symmetric positive definite matrix.
104 104
105 105
    Constructs a random sparse symmetric positive definite matrix for a given degree
106 106
    of sparsity. The matrix is constructed from its Cholesky factor :math:`L`. Its
107 -
    diagonal is set to one and all other entries of the lower triangle are sampled
108 -
    from a uniform distribution with bounds :code:`[chol_entry_min, chol_entry_max]`.
109 -
    The resulting sparse matrix is then given by :math:`A=LL^\\top`.
107 +
    diagonal is set to one and all other nonzero entries of the lower triangle are
108 +
    sampled from a uniform distribution with bounds :code:`[chol_entry_min,
109 +
    chol_entry_max]`. The resulting sparse matrix is then given by :math:`A=LL^\top`.
110 110
111 111
    Parameters
112 112
    ----------
@@ -136,34 +136,35 @@
Loading
136 136
    >>> sparsemat = random_sparse_spd_matrix(dim=5, density=0.1, random_state=42)
137 137
    >>> sparsemat.todense()
138 138
    matrix([[1.        , 0.        , 0.        , 0.        , 0.        ],
139 -
            [0.        , 1.        , 0.        , 0.30424224, 0.        ],
139 +
            [0.        , 1.        , 0.        , 0.37381802, 0.        ],
140 140
            [0.        , 0.        , 1.        , 0.        , 0.        ],
141 -
            [0.        , 0.30424224, 0.        , 1.09256334, 0.        ],
141 +
            [0.        , 0.37381802, 0.        , 1.13973991, 0.        ],
142 142
            [0.        , 0.        , 0.        , 0.        , 1.        ]])
143 143
    """
144 144
145 145
    # Initialization
146 146
    random_state = _utils.as_random_state(random_state)
147 147
    if not 0 <= density <= 1:
148 148
        raise ValueError(f"Density must be between 0 and 1, but is {density}.")
149 -
    chol = scipy.sparse.eye(dim, format=format)
149 +
    chol = scipy.sparse.eye(dim, format="csr")
150 150
    num_off_diag_cholesky = int(0.5 * dim * (dim - 1))
151 151
    num_nonzero_entries = int(num_off_diag_cholesky * density)
152 152
153 153
    if num_nonzero_entries > 0:
154 -
        # Samples sparse (non-symmetric) (n, n) matrix
154 +
155 155
        sparse_matrix = scipy.sparse.rand(
156 156
            m=dim,
157 157
            n=dim,
158 -
            format=format,
159 -
            density=0.5 * density,
158 +
            format="csr",
159 +
            density=density,
160 160
            random_state=random_state,
161 161
        )
162 162
163 -
        # Symmetrize sparse matrix
164 -
        sparse_matrix += sparse_matrix.T
163 +
        # Rescale entries
164 +
        sparse_matrix.data *= chol_entry_max - chol_entry_min
165 +
        sparse_matrix.data += chol_entry_min
165 166
166 167
        # Extract lower triangle
167 168
        chol += scipy.sparse.tril(A=sparse_matrix, k=-1, format=format)
168 169
169 -
    return chol @ chol.T
170 +
    return (chol @ chol.T).asformat(format=format)

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
src/probnum +<.01% 84.40%
Project Totals (107 files) 84.40%
Loading