Skip to content

Commit 3885be0

Browse files
Gregocactgrego.gc
andauthored
Fix LCC25 voltage min step value to 1mV (#451)
* Fix LCC25 voltage min step value to 1mV * precommit was behaving weird because I tried to do something in a computer that I am not admin * Checked the tests to match the instrument LCC25 resolution --------- Co-authored-by: grego.gc <[email protected]>
1 parent 1be7d8a commit 3885be0

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/instruments/thorlabs/lcc25.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def name(self):
133133
voltage1 = unitful_property(
134134
"volt1",
135135
u.V,
136-
format_code="{:.1f}",
136+
format_code="{:.3f}",
137137
set_fmt="{}={}",
138138
valid_range=(0, 25),
139139
doc="""
@@ -148,7 +148,7 @@ def name(self):
148148
voltage2 = unitful_property(
149149
"volt2",
150150
u.V,
151-
format_code="{:.1f}",
151+
format_code="{:.3f}",
152152
set_fmt="{}={}",
153153
valid_range=(0, 25),
154154
doc="""
@@ -163,7 +163,7 @@ def name(self):
163163
min_voltage = unitful_property(
164164
"min",
165165
u.V,
166-
format_code="{:.1f}",
166+
format_code="{:.3f}",
167167
set_fmt="{}={}",
168168
valid_range=(0, 25),
169169
doc="""
@@ -178,7 +178,7 @@ def name(self):
178178
max_voltage = unitful_property(
179179
"max",
180180
u.V,
181-
format_code="{:.1f}",
181+
format_code="{:.3f}",
182182
set_fmt="{}={}",
183183
valid_range=(0, 25),
184184
doc="""
@@ -209,7 +209,7 @@ def name(self):
209209
increment = unitful_property(
210210
"increment",
211211
units=u.V,
212-
format_code="{:.1f}",
212+
format_code="{:.3f}",
213213
set_fmt="{}={}",
214214
valid_range=(0, None),
215215
doc="""

tests/test_thorlabs/test_thorlabs_lcc25.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def test_tc200_remote_invalid_type():
115115
def test_lcc25_voltage1():
116116
with expected_protocol(
117117
ik.thorlabs.LCC25,
118-
["volt1?", "volt1=10.0"],
119-
["volt1?", "20", "> volt1=10.0", "> "],
118+
["volt1?", "volt1=10.000"],
119+
["volt1?", "20", "> volt1=10.000", "> "],
120120
sep="\r",
121121
) as lcc:
122122
unit_eq(lcc.voltage1, u.Quantity(20, "V"))
@@ -134,9 +134,9 @@ def test_lcc25_voltage2():
134134
ik.thorlabs.LCC25,
135135
[
136136
"volt2?",
137-
"volt2=10.0",
137+
"volt2=10.000",
138138
],
139-
["volt2?", "20", "> volt2=10.0", "> "],
139+
["volt2?", "20", "> volt2=10.000", "> "],
140140
sep="\r",
141141
) as lcc:
142142
unit_eq(lcc.voltage2, u.Quantity(20, "V"))
@@ -146,8 +146,8 @@ def test_lcc25_voltage2():
146146
def test_lcc25_minvoltage():
147147
with expected_protocol(
148148
ik.thorlabs.LCC25,
149-
["min?", "min=10.0"],
150-
["min?", "20", "> min=10.0", "> "],
149+
["min?", "min=10.000"],
150+
["min?", "20", "> min=10.000", "> "],
151151
sep="\r",
152152
) as lcc:
153153
unit_eq(lcc.min_voltage, u.Quantity(20, "V"))
@@ -157,8 +157,8 @@ def test_lcc25_minvoltage():
157157
def test_lcc25_maxvoltage():
158158
with expected_protocol(
159159
ik.thorlabs.LCC25,
160-
["max?", "max=10.0"],
161-
["max?", "20", "> max=10.0", "> "],
160+
["max?", "max=10.000"],
161+
["max?", "20", "> max=10.000", "> "],
162162
sep="\r",
163163
) as lcc:
164164
unit_eq(lcc.max_voltage, u.Quantity(20, "V"))
@@ -186,8 +186,8 @@ def test_lcc25_dwell_positive():
186186
def test_lcc25_increment():
187187
with expected_protocol(
188188
ik.thorlabs.LCC25,
189-
["increment?", "increment=10.0"],
190-
["increment?", "20", "> increment=10.0", "> "],
189+
["increment?", "increment=10.000"],
190+
["increment?", "20", "> increment=10.000", "> "],
191191
sep="\r",
192192
) as lcc:
193193
unit_eq(lcc.increment, u.Quantity(20, "V"))

0 commit comments

Comments
 (0)