From c77cd6b4da280b3aaa1a7a1be11ef6ce94b7100f Mon Sep 17 00:00:00 2001 From: Jakub Both Date: Mon, 9 Oct 2023 04:26:25 +0200 Subject: [PATCH] MAINT: Name all keys in metadata dict equal to attributes --- src/darsia/image/image.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/darsia/image/image.py b/src/darsia/image/image.py index dfbd871f..09093eda 100644 --- a/src/darsia/image/image.py +++ b/src/darsia/image/image.py @@ -84,7 +84,7 @@ def __init__( """Original dtype at construction of the object.""" # ! ---- Spatial meta information - self.space_dim: int = kwargs.get("dim", 2) + self.space_dim: int = kwargs.get("space_dim", 2) """Dimension of the spatial domain.""" self.space_num: int = np.prod(self.shape[: self.space_dim]) @@ -417,7 +417,7 @@ def metadata(self) -> dict: """ metadata = { - "dim": self.space_dim, + "space_dim": self.space_dim, "indexing": self.indexing, "dimensions": self.dimensions, "origin": self.origin, @@ -1499,11 +1499,11 @@ def __init__( """ # Define metadata specific for optical images optical_metadata = { - "dim": 2, + "space_dim": 2, "indexing": "ij", "scalar": False, } - kwargs.pop("dim", None) + kwargs.pop("space_dim", None) kwargs.pop("indexing", None) kwargs.pop("scalar", None)