Add ruff checking for unnecessary comprehensions
This commit is contained in:
parent
2050c2dc7c
commit
1c54d25212
4 changed files with 4 additions and 4 deletions
|
|
@ -87,7 +87,7 @@ def make_hardware_interface(
|
|||
axes = stage.axis_names
|
||||
|
||||
def pos2dict(pos: Sequence[float]) -> Mapping[str, float]:
|
||||
return {k: p for k, p in zip(axes, pos)}
|
||||
return dict(zip(axes, pos))
|
||||
|
||||
def dict2pos(posd: Mapping[str, float]) -> Sequence[float]:
|
||||
return tuple(posd[k] for k in axes if k in posd)
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class BaseStage(Thing):
|
|||
|
||||
position = PropertyDescriptor(
|
||||
Mapping[str, int],
|
||||
{k: 0 for k in _axis_names},
|
||||
dict.fromkeys(_axis_names, 0),
|
||||
description="Current position of the stage",
|
||||
readonly=True,
|
||||
observable=True,
|
||||
|
|
|
|||
|
|
@ -91,5 +91,5 @@ class DummyStage(BaseStage):
|
|||
It is intended for use after manually or automatically recentring the
|
||||
stage.
|
||||
"""
|
||||
self.position = {k: 0 for k in self.axis_names}
|
||||
self.position = dict.fromkeys(self.axis_names, 0)
|
||||
self.instantaneous_position = self.position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue