clean up some format strings

expand obs example
This commit is contained in:
onyx-and-iris
2022-07-22 15:44:36 +01:00
parent 22d663acdc
commit 43d4496378
4 changed files with 31 additions and 17 deletions

View File

@@ -116,7 +116,7 @@ class PhysicalBus(Bus):
if kind.name == "potato":
EFFECTS_cls = _make_effects_mixin()
kls += (EFFECTS_cls,)
return type(f"PhysicalBus", kls, {})
return type("PhysicalBus", kls, {})
def __str__(self):
return f"{type(self).__name__}{self.index}"
@@ -146,7 +146,7 @@ class VirtualBus(Bus):
elif kind.name == "potato":
EFFECTS_cls = _make_effects_mixin()
kls += (EFFECTS_cls,)
return type(f"VirtualBus", kls, {})
return type("VirtualBus", kls, {})
def __str__(self):
return f"{type(self).__name__}{self.index}"
@@ -164,15 +164,15 @@ class BusLevel(IRemote):
If observables thread running fetch values from cache otherwise call CAPI func.
"""
def fget(i):
return round(20 * log(i, 10), 1) if i > 0 else -200.0
def fget(x):
return round(20 * log(x, 10), 1) if x > 0 else -200.0
if self._remote.running and "bus_level" in self._remote.cache:
vals = self._remote.cache["bus_level"][self.range[0] : self.range[-1]]
else:
vals = [self._remote.get_level(mode, i) for i in range(*self.range)]
return tuple(fget(i) for i in vals)
return tuple(fget(val) for val in vals)
@property
def identifier(self) -> str: