Skip to content

Commit 32bbfdb

Browse files
committed
Since stage.x, y, z are integers, do not waste space formatting them as floats :.1f
1 parent b160bda commit 32bbfdb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/instamatic/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ def one_cycle(tilt: float = 5, sign=1) -> list:
402402
# self.stage.z = 0 # for testing
403403

404404
zc = self.stage.z
405-
print(f'Current z = {zc:.1f} nm')
405+
print(f'Current z = {zc} nm')
406406

407407
zs = zc + np.linspace(-dz, dz, steps)
408408
shifts = []

src/instamatic/microscope/components/stage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self, tem: MicroscopeBase):
2323

2424
def __repr__(self):
2525
x, y, z, a, b = self.get()
26-
return f'{self.name}(x={x:.1f}, y={y:.1f}, z={z:.1f}, a={a:.1f}, b={b:.1f})'
26+
return f'{self.name}(x={x}, y={y}, z={z}, a={a:.1f}, b={b:.1f})'
2727

2828
@property
2929
def name(self) -> str:
@@ -258,7 +258,7 @@ def alpha_wobbler(self, delta: float_deg = 5.0, event=None) -> None:
258258

259259
print(f"Restoring 'alpha': {a_center:.2f}")
260260
self.a = a_center
261-
print(f'Print z={self.z:.2f}')
261+
print(f'Print z={self.z}')
262262

263263
def relax_xy(self, step: int = 100) -> None:
264264
"""Relax the stage by moving it in the opposite direction from the last

src/instamatic/microscope/interface/jeol_microscope.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ def setStagePosition(
361361
if self.VERIFY_STAGE_POSITION:
362362
nx, ny, nz, na, nb = self.getStagePosition()
363363
if x is not None and abs(nx - x) > 150:
364-
logger.warning(f'stage.x -> requested: {x:.1f}, got: {nx:.1f}')
364+
logger.warning(f'stage.x -> requested: {x}, got: {nx}')
365365
if y is not None and abs(ny - y) > 150:
366-
logger.warning(f'stage.y -> requested: {y:.1f}, got: {ny:.1f}')
366+
logger.warning(f'stage.y -> requested: {y}, got: {ny}')
367367
if z is not None and abs(nz - z) > 500:
368368
logger.warning(f'stage.z -> requested: {z}, got: {nz}')
369369
if a is not None and abs(na - a) > 0.057:

0 commit comments

Comments
 (0)