From 95db04c18edd95c74f22fda74be8fdf6e288e92d Mon Sep 17 00:00:00 2001 From: "grego.gc" Date: Wed, 17 Sep 2025 16:00:32 +0200 Subject: [PATCH 1/3] Fix LCC25 voltage min step value to 1mV --- .pre-commit-config.yaml | 3 +++ src/instruments/thorlabs/lcc25.py | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3aa2ef7a..1e041d62 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,6 @@ +default_language_version: + python: /c/tools/Anaconda3/python + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 diff --git a/src/instruments/thorlabs/lcc25.py b/src/instruments/thorlabs/lcc25.py index f4ab4ef9..69051b6c 100644 --- a/src/instruments/thorlabs/lcc25.py +++ b/src/instruments/thorlabs/lcc25.py @@ -133,7 +133,7 @@ def name(self): voltage1 = unitful_property( "volt1", u.V, - format_code="{:.1f}", + format_code="{:.3f}", set_fmt="{}={}", valid_range=(0, 25), doc=""" @@ -148,7 +148,7 @@ def name(self): voltage2 = unitful_property( "volt2", u.V, - format_code="{:.1f}", + format_code="{:.3f}", set_fmt="{}={}", valid_range=(0, 25), doc=""" @@ -163,7 +163,7 @@ def name(self): min_voltage = unitful_property( "min", u.V, - format_code="{:.1f}", + format_code="{:.3f}", set_fmt="{}={}", valid_range=(0, 25), doc=""" @@ -178,7 +178,7 @@ def name(self): max_voltage = unitful_property( "max", u.V, - format_code="{:.1f}", + format_code="{:.3f}", set_fmt="{}={}", valid_range=(0, 25), doc=""" @@ -209,7 +209,7 @@ def name(self): increment = unitful_property( "increment", units=u.V, - format_code="{:.1f}", + format_code="{:.3f}", set_fmt="{}={}", valid_range=(0, None), doc=""" From 6b15844cca99d347298a368de4bbe1e27c7f967c Mon Sep 17 00:00:00 2001 From: "grego.gc" Date: Wed, 17 Sep 2025 16:17:11 +0200 Subject: [PATCH 2/3] precommit was behaving weird because I tried to do something in a computer that I am not admin --- .pre-commit-config.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1e041d62..3aa2ef7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,3 @@ -default_language_version: - python: /c/tools/Anaconda3/python - repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 From d86364ff46f9471ff0f04a3e6c615805d70a643a Mon Sep 17 00:00:00 2001 From: "grego.gc" Date: Fri, 19 Sep 2025 16:21:29 +0200 Subject: [PATCH 3/3] Checked the tests to match the instrument LCC25 resolution --- tests/test_thorlabs/test_thorlabs_lcc25.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_thorlabs/test_thorlabs_lcc25.py b/tests/test_thorlabs/test_thorlabs_lcc25.py index 5cc9bf1b..f09f1823 100644 --- a/tests/test_thorlabs/test_thorlabs_lcc25.py +++ b/tests/test_thorlabs/test_thorlabs_lcc25.py @@ -115,8 +115,8 @@ def test_tc200_remote_invalid_type(): def test_lcc25_voltage1(): with expected_protocol( ik.thorlabs.LCC25, - ["volt1?", "volt1=10.0"], - ["volt1?", "20", "> volt1=10.0", "> "], + ["volt1?", "volt1=10.000"], + ["volt1?", "20", "> volt1=10.000", "> "], sep="\r", ) as lcc: unit_eq(lcc.voltage1, u.Quantity(20, "V")) @@ -134,9 +134,9 @@ def test_lcc25_voltage2(): ik.thorlabs.LCC25, [ "volt2?", - "volt2=10.0", + "volt2=10.000", ], - ["volt2?", "20", "> volt2=10.0", "> "], + ["volt2?", "20", "> volt2=10.000", "> "], sep="\r", ) as lcc: unit_eq(lcc.voltage2, u.Quantity(20, "V")) @@ -146,8 +146,8 @@ def test_lcc25_voltage2(): def test_lcc25_minvoltage(): with expected_protocol( ik.thorlabs.LCC25, - ["min?", "min=10.0"], - ["min?", "20", "> min=10.0", "> "], + ["min?", "min=10.000"], + ["min?", "20", "> min=10.000", "> "], sep="\r", ) as lcc: unit_eq(lcc.min_voltage, u.Quantity(20, "V")) @@ -157,8 +157,8 @@ def test_lcc25_minvoltage(): def test_lcc25_maxvoltage(): with expected_protocol( ik.thorlabs.LCC25, - ["max?", "max=10.0"], - ["max?", "20", "> max=10.0", "> "], + ["max?", "max=10.000"], + ["max?", "20", "> max=10.000", "> "], sep="\r", ) as lcc: unit_eq(lcc.max_voltage, u.Quantity(20, "V")) @@ -186,8 +186,8 @@ def test_lcc25_dwell_positive(): def test_lcc25_increment(): with expected_protocol( ik.thorlabs.LCC25, - ["increment?", "increment=10.0"], - ["increment?", "20", "> increment=10.0", "> "], + ["increment?", "increment=10.000"], + ["increment?", "20", "> increment=10.000", "> "], sep="\r", ) as lcc: unit_eq(lcc.increment, u.Quantity(20, "V"))