Repository: ad12/meddlr (language: python)

Issue:
Add support for torchmetrics>=0.7.0
torchmetrics=0.7.0 had some breaking changes. identify these and patch them


Discussion / hints:

Fix patch:
diff --git a/requirements.txt b/requirements.txt
index 0bfd3fdc..25c3930d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,5 +11,5 @@ tqdm
 scikit-image>=0.18.2
 pandas
 silx
-torchmetrics>=0.5.1
+torchmetrics>=0.5.1,<0.7.0
 omegaconf
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 0259839b..ab9e915c 100644
--- a/setup.py
+++ b/setup.py
@@ -98,7 +98,7 @@ def get_version():
         "silx",
         "tqdm",
         "omegaconf",
-        "torchmetrics>=0.5.1",
+        "torchmetrics>=0.5.1,<0.7.0",
         "iopath",
         "packaging",
     ],


Test patch:
diff --git a/tests/forward/test_mri.py b/tests/forward/test_mri.py
index 34d011a0..aa51bd5c 100644
--- a/tests/forward/test_mri.py
+++ b/tests/forward/test_mri.py
@@ -70,7 +70,7 @@ def test_multichannel(self):
             expected.append(A(kspace[..., c], adjoint=True))
         expected = torch.cat(expected, dim=-1)
         out_image = A(kspace, adjoint=True)
-        assert torch.allclose(out_image, expected)
+        assert torch.allclose(out_image, expected, atol=1e-5)
 
         expected = []
         for c in range(num_channels):