From b40c9158eb9194ae11621c893b282b28567d3d12 Mon Sep 17 00:00:00 2001 From: mrava87 Date: Sun, 15 Nov 2020 12:27:47 +0100 Subject: [PATCH 1/2] Removed scipy dependency limit --- environment-dev.yml | 2 +- environment.yml | 2 +- requirements-dev.txt | 2 +- requirements-doc.txt | 2 +- requirements.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/environment-dev.yml b/environment-dev.yml index 83d6a3b..5e97ec4 100755 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -6,7 +6,7 @@ channels: dependencies: - python>=3.6.4 - numpy>=1.15.0 - - scipy<=1.3.3 + - scipy>=1.4.0 - pytorch>=1.2.0 - torchvision - pylops diff --git a/environment.yml b/environment.yml index 8c87c3b..caec99f 100755 --- a/environment.yml +++ b/environment.yml @@ -6,7 +6,7 @@ channels: dependencies: - python>=3.6.4 - numpy>=1.15.0 - - scipy<=1.3.3 + - scipy>=1.4.0 - pytorch>=1.2.0 - pylops - pip: diff --git a/requirements-dev.txt b/requirements-dev.txt index d4d7147..5e72257 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ numpy>=1.15.0 -scipy<=1.3.3 +scipy>=1.4.0 torch>=1.2.0 pytorch_complex_tensor pylops[advanced] diff --git a/requirements-doc.txt b/requirements-doc.txt index fa08974..ef2c674 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -1,5 +1,5 @@ numpy>=1.15.0 -scipy<=1.3.3 +scipy>=1.4.0 https://download.pytorch.org/whl/cpu/torch-1.4.0%2Bcpu-cp36-cp36m-linux_x86_64.whl pytorch_complex_tensor pylops diff --git a/requirements.txt b/requirements.txt index 8932776..c582c02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ numpy>=1.15.0 -scipy<=1.3.3 +scipy>=1.4.0 torch>=1.2.0 torchvision pytorch_complex_tensor From 8773ba4d3c180c929c9d9408a224e210c9d2e101 Mon Sep 17 00:00:00 2001 From: mrava87 Date: Sun, 15 Nov 2020 12:43:36 +0100 Subject: [PATCH 2/2] Temporarely removed all tests with complex numbers Seems like pytorch_complex_tensor is not keeping up with the pace of pytorch development and things stopped working. On the other hand pytorch has finally complex numbers in beta, we should switch to using them. Remove tests using complex numbers and pytorch_complex_tensor in the meantime. --- pytests/test_diagonal.py | 4 ++-- pytests/test_identity.py | 5 ++--- pytests/test_matrixmult.py | 4 ++-- pytests/test_utils.py | 7 ++++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pytests/test_diagonal.py b/pytests/test_diagonal.py index 81532b6..c1b33ba 100644 --- a/pytests/test_diagonal.py +++ b/pytests/test_diagonal.py @@ -19,7 +19,7 @@ torch.manual_seed(0) -@pytest.mark.parametrize("par", [(par1), (par2)]) +@pytest.mark.parametrize("par", [(par1)])#, (par2)]) def test_Diagonal_1dsignal(par): """Dot-test and inversion for Diagonal operator for 1d signal """ @@ -45,7 +45,7 @@ def test_Diagonal_1dsignal(par): assert_array_almost_equal(x.numpy(), xcg.cpu().numpy(), decimal=4) -@pytest.mark.parametrize("par", [(par1), (par2)]) +@pytest.mark.parametrize("par", [(par1)])#, (par2)]) def test_Diagonal_2dsignal(par): """Dot-test and inversion for Diagonal operator for 2d signal """ diff --git a/pytests/test_identity.py b/pytests/test_identity.py index 9b5f76b..3d1eb05 100644 --- a/pytests/test_identity.py +++ b/pytests/test_identity.py @@ -26,11 +26,10 @@ torch.manual_seed(0) -@pytest.mark.parametrize("par", [(par1), (par2), (par1j), (par2j), (par3)]) +@pytest.mark.parametrize("par", [(par1), (par2), (par3)])#, (par1j), (par2j)]) def test_Identity_inplace(par): """Dot-test, forward and adjoint for Identity operator """ - print('complex', True if par['imag'] == 1j else False) Iop = Identity(par['ny'], par['nx'], complex=True if par['imag'] == 1j else False, dtype=torchtype_from_numpytype(par['dtype']), @@ -65,7 +64,7 @@ def test_Identity_inplace(par): decimal=4) -@pytest.mark.parametrize("par", [(par1), (par2), (par1j), (par2j), (par3)]) +@pytest.mark.parametrize("par", [(par1), (par2), (par3)]) # (par1j), (par2j), def test_Identity_noinplace(par): """Dot-test, forward and adjoint for Identity operator (not in place) """ diff --git a/pytests/test_matrixmult.py b/pytests/test_matrixmult.py index 3c585fe..b5b01fa 100644 --- a/pytests/test_matrixmult.py +++ b/pytests/test_matrixmult.py @@ -24,7 +24,7 @@ torch.manual_seed(0) -@pytest.mark.parametrize("par", [(par1), (par2), (par1j), (par2j)]) +@pytest.mark.parametrize("par", [(par1), (par2)])#, (par1j), (par2j)]) def test_MatrixMult(par): """Dot-test and inversion for MatrixMult operator """ @@ -53,7 +53,7 @@ def test_MatrixMult(par): assert_array_almost_equal(x.numpy(), xcg.numpy(), decimal=3) -@pytest.mark.parametrize("par", [(par1), (par2), (par1j), (par2j)]) +@pytest.mark.parametrize("par", [(par1), (par2)])#, (par1j), (par2j)]) def test_MatrixMult_repeated(par): """Dot-test and inversion for test_MatrixMult operator repeated along another dimension diff --git a/pytests/test_utils.py b/pytests/test_utils.py index 2afb34c..f7fd26f 100644 --- a/pytests/test_utils.py +++ b/pytests/test_utils.py @@ -23,10 +23,10 @@ def test_typeconversion(): assert torchtype_check == torchtype +""" @pytest.mark.parametrize("par", [(par1), (par2)]) def test_complex_attrs(par): - """Compare attributes of numpy complex and torch ComplexTensor - """ + #Compare attributes of numpy complex and torch ComplexTensor x = np.ones(par['dims'], dtype=np.float32) + \ 3j * np.ones(par['dims'], dtype=np.float32) y = 2*np.ones(par['dims'], dtype=np.float32) - \ @@ -50,4 +50,5 @@ def test_complex_attrs(par): assert_array_equal(sub, complexnumpy_fromtorch(subt)) # sub assert_array_equal(mul, complexnumpy_fromtorch(mult)) # mul assert_array_equal(xc, complexnumpy_fromtorch(xct)) # conj - assert xflattened.shape[1] == np.prod(np.array(par['dims'])) # flatten \ No newline at end of file + assert xflattened.shape[1] == np.prod(np.array(par['dims'])) # flatten +""" \ No newline at end of file