Skip to content

Remove NotImplementedError pass on the out unit tests for the algorithm class  #1861

@MargaretDuff

Description

@MargaretDuff

Description

Instead of allowing tests to pass with a not implemented error e.g.

except (InPlaceError, NotImplementedError):

except (InPlaceError, NotImplementedError):

except NotImplementedError:

We should add to the list of functions to test, which tests we want to run e.g. instead of (function, geometry) we should have (function, geometry, bool, bool, bool) with the three booleans corresponding to test proximal_conjugate, test_proximal and test_gradient True/False:

self.func_geom_test_list = [
(IndicatorBox(), ag),
(KullbackLeibler(b=b, backend='numba'), ag),
(KullbackLeibler(b=b, backend='numpy'), ag),
(L1Norm(), ag),
(L1Norm(), ig),
(L1Norm(b=b), ag),
(L1Norm(b=b, weight=b), ag),
(TranslateFunction(L1Norm(), b), ag),
(TranslateFunction(L2NormSquared(), b), ag),
(L2NormSquared(), ag),
(scalar * L2NormSquared(), ag),
(SumFunction(L2NormSquared(), scalar * L2NormSquared()), ag),
(SumScalarFunction(L2NormSquared(), 3), ag),
(ConstantFunction(3), ag),
(ZeroFunction(), ag),
(L2NormSquared(b=b), ag),
(L2NormSquared(), ag),
(LeastSquares(A, b_ig, c, weight_ls), ig),
(LeastSquares(A, b_ig, c), ig),
(WeightedL2NormSquared(weight=b_ig), ig),
(TotalVariation(backend='c', warm_start=False, max_iteration=100), ig),
(TotalVariation(backend='numpy', warm_start=False, max_iteration=100), ig),
(OperatorCompositionFunction(L2NormSquared(), A), ig),
(MixedL21Norm(), bg),
(SmoothMixedL21Norm(epsilon=0.3), bg),
(MixedL11Norm(), bg),
(BlockFunction(L1Norm(),L2NormSquared()), bg),
(L1Sparsity(WaveletOperator(ig)), ig)

The danger of the NotImplementedError was highlighted by #1854.

Similarly, for the operator tests and

except NotImplementedError:

except (InPlaceError, NotImplementedError):

except (InPlaceError, NotImplementedError):

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions