Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b7ec90e
add MatrixOperator.
paquiteau Nov 25, 2022
26385aa
move base test to pytest.
paquiteau Nov 29, 2022
f41f8fc
[fixme] remove flake8 and emoji config.
paquiteau Nov 29, 2022
70016f9
rewrite test_math module using pytest.
paquiteau Nov 30, 2022
33a4ff0
use fail/skipparam helper function.
paquiteau Nov 30, 2022
1112623
generalize usage of failparam
paquiteau Nov 30, 2022
2add34d
refactor test_signal.
paquiteau Nov 30, 2022
b33c0d8
refactor test_signal, the end.
paquiteau Nov 30, 2022
2299e3f
lint
paquiteau Nov 30, 2022
e04b5ef
fix missing parameter.
paquiteau Dec 6, 2022
bc4c06c
add dummy object test helper.
paquiteau Dec 6, 2022
6ed61ba
rewrite test for cost and gradients.
paquiteau Dec 6, 2022
d4786e8
show missing lines in coverage reports
paquiteau Dec 6, 2022
bee267b
rewrite of proximity operators testing.
paquiteau Dec 6, 2022
611a064
add fail low rank method.
paquiteau Dec 6, 2022
c128c81
add cases for algorithms test
paquiteau Dec 6, 2022
34ff1a8
add algorithm test.
paquiteau Dec 7, 2022
c16c24f
add pytest-cases and pytest-xdists support.
paquiteau Dec 7, 2022
38f065a
add support for testing metrics.
paquiteau Dec 8, 2022
cf76d87
improve base module coverage.
paquiteau Dec 8, 2022
7eb524e
test for wrong mask in metric module.
paquiteau Dec 8, 2022
bf5b8ea
add docstring.
paquiteau Dec 8, 2022
c9aadba
update email adress and authors field.
paquiteau Dec 8, 2022
f8aade1
100% coverage for transform module.
paquiteau Dec 8, 2022
9fb10ed
move linear operator to class
paquiteau Dec 8, 2022
67fea29
update docstring.
paquiteau Dec 8, 2022
b3d019d
paramet(e)rization.
paquiteau Dec 8, 2022
d355fdc
update docstring.
paquiteau Dec 8, 2022
c931cab
Merge branch 'develop' into test_rewrite
paquiteau Jan 2, 2023
2ba52e3
improve test_helper module.
paquiteau Jan 2, 2023
9d5868d
raises should be specified for each failparam call.
paquiteau Jan 2, 2023
c17d3c8
encapsulate module's test in classes.
paquiteau Jan 2, 2023
27f689f
skip test if sklearn is not installed.
paquiteau Jan 3, 2023
7071354
pin pydocstyle
paquiteau Jan 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
shell: bash -l {0}
run: |
export PATH=/usr/share/miniconda/bin:$PATH
python setup.py test
pytest -n 2

- name: Save Test Results
if: always()
Expand Down
4 changes: 4 additions & 0 deletions develop.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
coverage>=5.5
pytest>=6.2.2
pytest-raises>=0.10
pytest-cases>= 3.6
pytest-xdist>= 3.0.1
pytest-cov>=2.11.1
pytest-emoji>=0.2.0
pydocstyle==6.1.1
pytest-pydocstyle>=2.2.0
black
isort
Expand Down
18 changes: 18 additions & 0 deletions modopt/opt/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import numpy as np

from modopt.base.types import check_callable, check_float
from modopt.base.backend import get_array_module
from modopt.signal.wavelet import filter_convolve_stack


Expand Down Expand Up @@ -80,6 +81,23 @@ def __init__(self):
self.adj_op = self.op


class MatrixOperator(LinearParent):
"""
Matrix Operator class.

This class transforms an array into a suitable linear operator.
"""

def __init__(self, array):
self.op = lambda x: array @ x
xp = get_array_module(array)

if xp.any(xp.iscomplex(array)):
self.adj_op = lambda x: array.T.conjugate() @ x
else:
self.adj_op = lambda x: array.T @ x


class WaveletConvolve(LinearParent):
"""Wavelet Convolution Class.

Expand Down
Loading