From 72b15b18e0565cad27bfb5d751581322124c041d Mon Sep 17 00:00:00 2001 From: Christopher Rhodes <christopher.rhodes@embl.de> Date: Mon, 30 Oct 2023 13:19:54 +0100 Subject: [PATCH] Made filepath an explicit property --- extensions/chaeo/accessors.py | 3 +++ extensions/chaeo/tests/test_accessors.py | 1 + 2 files changed, 4 insertions(+) diff --git a/extensions/chaeo/accessors.py b/extensions/chaeo/accessors.py index 928aabbc..47f33a19 100644 --- a/extensions/chaeo/accessors.py +++ b/extensions/chaeo/accessors.py @@ -56,6 +56,9 @@ class MonoPatchStackFromFile(MonoPatchStack): self.file_acc = generate_file_accessor(fpath) super().__init__(self.file_acc.data[:, :, 0, :]) + @property + def fpath(self): + return self.file_acc.fpath class Error(Exception): pass diff --git a/extensions/chaeo/tests/test_accessors.py b/extensions/chaeo/tests/test_accessors.py index 83ea1100..40192575 100644 --- a/extensions/chaeo/tests/test_accessors.py +++ b/extensions/chaeo/tests/test_accessors.py @@ -38,6 +38,7 @@ class TestCziImageFileAccess(unittest.TestCase): self.assertEqual(acc.hw, (h, w)) self.assertEqual(acc.count, n) self.assertEqual(acc.make_tczyx().shape, (n, c, 1, h, w)) + self.assertEqual(acc.fpath, monozstackmask['path']) def test_raises_filenotfound(self): from extensions.chaeo.accessors import FileNotFoundError -- GitLab