From 6b248efcfc442244b22d5283f3ac87fef73d4111 Mon Sep 17 00:00:00 2001 From: Polarisyjr Date: Sat, 14 Mar 2026 01:11:21 -0400 Subject: [PATCH] Fix depth warning: move from StorageAttributes to Storage StorageAttributes does not have a `name` attribute (it inherits from Attributes/DictNode, not Leaf). Move the depth warning to Storage.__init__ where both `self.name` and `self.attributes.depth` are accessible. --- pytimeloop/timeloopfe/v4/arch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytimeloop/timeloopfe/v4/arch.py b/pytimeloop/timeloopfe/v4/arch.py index 04bde53..e954a60 100644 --- a/pytimeloop/timeloopfe/v4/arch.py +++ b/pytimeloop/timeloopfe/v4/arch.py @@ -383,6 +383,8 @@ def declare_attrs(cls, *args, **kwargs): def __init__(self, *args, **kwargs): super().__init__(self, *args, **kwargs) self.attributes: StorageAttributes = self["attributes"] + if self.attributes.depth is None: + print(f'WARNING: "depth" is not set for storage element {self.name}') class Compute(Component): @@ -587,8 +589,6 @@ def __init__(self, *args, **kwargs): ] self.decompression_supported: Union[str, bool] = self["decompression_supported"] self.compression_supported: Union[str, bool] = self["compression_supported"] - if self.depth is None: - print(f'WARNING: "depth" is not set for storage element {self.name}') class Nothing(Component):