From 3a361a3440733938be6b64dca413463b59abcd4e Mon Sep 17 00:00:00 2001 From: AreWeDreaming Date: Mon, 9 Oct 2023 17:55:28 +0200 Subject: [PATCH] Internal caching for wildcard machine_to_omas --- omas/omas_machine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/omas/omas_machine.py b/omas/omas_machine.py index 07ebb6c9..1c93e0a4 100644 --- a/omas/omas_machine.py +++ b/omas/omas_machine.py @@ -126,11 +126,14 @@ def machine_to_omas(ods, machine, pulse, location, options={}, branch='', user_m idm = (machine, branch) failed_locations = {} if location.endswith(".*"): + temp_cache = cache + if temp_cache is None: + temp_cache = {} root = location.split(".*")[0] for key in mappings: if root in key and key not in ods: try: - resolve_mapped(ods, machine, pulse, mappings, key, idm, options_with_defaults, branch, cache=cache) + resolve_mapped(ods, machine, pulse, mappings, key, idm, options_with_defaults, branch, cache=temp_cache) except (TreeNODATA, MdsIpException) as e: if hasattr(e, "eval2TDI"): failed_locations[key] = e.eval2TDI