Skip to content

Commit 797b2e7

Browse files
maubrevilleCopilot
andauthored
Update exact/util/cellvizio.py
Added caching for meta_data Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c1be0f3 commit 797b2e7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

exact/util/cellvizio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ def _2_init__(self, filename):
184184

185185
@property
186186
def meta_data(self) -> dict:
187-
return self.getMostRelevantMetaInfo()
187+
# Cache metadata to avoid repeated file I/O and parsing.
188+
if not hasattr(self, "_meta_data_cache"):
189+
self._meta_data_cache = self.getMostRelevantMetaInfo()
190+
return self._meta_data_cache
188191

189192
@property
190193
def meta_data_dict(self) -> dict:

0 commit comments

Comments
 (0)