MCPcopy Index your code
hub / github.com/LabPy/lantz / refresh

Method refresh

lantz/driver.py:406–425  ·  view source on GitHub ↗

Refresh cache by reading values from the instrument. :param keys: a string or list of strings with the properties to refresh. Default None, meaning all properties. If keys is a string, returns the value. If keys is a list/tuple,

(self, keys=None)

Source from the content-addressed store, hash-verified

404 return fut
405
406 def refresh(self, keys=None):
407 """Refresh cache by reading values from the instrument.
408
409 :param keys: a string or list of strings with the properties to refresh.
410 Default None, meaning all properties.
411 If keys is a string, returns the value.
412 If keys is a list/tuple, returns a tuple.
413 If keys is a dict, returns a dict.
414 :type keys: str or list or tuple or dict
415 """
416 if keys:
417 if isinstance(keys, (list, tuple)):
418 return tuple(getattr(self, key) for key in keys)
419 elif isinstance(keys, dict):
420 return {key: getattr(self, key) for key in keys.keys()}
421 elif isinstance(keys, str):
422 return getattr(self, keys)
423 else:
424 raise ValueError('keys must be a (str, list, tuple or dict)')
425 return {key: getattr(self, key) for key in self._lantz_features}
426
427 def refresh_async(self, keys=None, *, callback=None):
428 """Asynchronous refresh cache by reading values from the instrument.

Callers 6

__init__Method · 0.80
test_refreshMethod · 0.80
test_derived_classMethod · 0.80
fungen.pyFile · 0.80
simple_testFunction · 0.80

Calls 1

keysMethod · 0.45

Tested by 3

test_refreshMethod · 0.64
test_derived_classMethod · 0.64