lanl / scico

Scientific Computational Imaging COde
BSD 3-Clause "New" or "Revised" License
90 stars 17 forks source link

Reduce code duplication in LinOp tests #503

Open Michael-T-McCann opened 4 months ago

Michael-T-McCann commented 4 months ago

Many LinOps have tests for scalar multiplication, i.e., that a (H @ x) = (a H) @ x. Right now, this involves code duplication, e.g., https://github.com/lanl/scico/blob/1a66887a03ad4cca5dfa58dfa86386f1536926ba/scico/test/linop/test_circconv.py#L74-L87 versus https://github.com/lanl/scico/blob/1a66887a03ad4cca5dfa58dfa86386f1536926ba/scico/test/linop/test_diag.py#L146-L158

Can we create a standard function to test scaling (and other similar LinOp properties) rather than copy/pasting variants of this?