Skip to content

Conversation

@trlemon
Copy link
Contributor

@trlemon trlemon commented Feb 6, 2026

WIP

Background

The doFastSweep method relies on "old" technology from qcodes_loop, and it also returns a Qcodes dataset which may not be desirable for all applications. Instead, it would be better to use ParameterWithSetpoints and return a numpy array.

Summary of Changes

  • Remove dependence on qcodes_loop
  • Use ParameterWithSetpoints with additional parameters for configuration.
  • Return fast sweep data as numpy array instead of qcodes dataset.

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 81.94444% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.02%. Comparing base (3bf10d8) to head (22eb507).

Files with missing lines Patch % Lines
...odes/instrument_drivers/Keithley/_Keithley_2600.py 81.94% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7851      +/-   ##
==========================================
+ Coverage   59.87%   60.02%   +0.14%     
==========================================
  Files         352      352              
  Lines       31872    31879       +7     
==========================================
+ Hits        19083    19134      +51     
+ Misses      12789    12745      -44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@astafan8 astafan8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks promising!

log.debug(f"Reset channel {self.channel}. Updating settings...")
self.snapshot(update=True)

def doFastSweep(self, start: float, stop: float, steps: int, mode: str) -> DataSet:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is important to mention this breaking change in the changelog

"""Holds array of setpoints for doing a fastsweep. Can
be of units V or I depending on `Keithley2600Channel.fastsweep_mode`"""

self.fastsweep: LuaSweepParameter = self.add_parameter(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you update the example notebook for this driver to mention this new parameter and how to use it (no need to repeat the general artcile on how to use parameters with setpoints but good to mention specifics for this driver there) ?

f"for index = 1, {steps} do",
" target = startX + (index-1)*dX",
f" {channel}.source.level{source} = target",
f" {channel}.measure.{meas}({channel}.nvbuffer1)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depending on the use cases for the measurements, perhaps it's useful to add a possibility of a delay between setting a target value and measuring a value? and add a parameter for it e.g. fastsweep_inter_delay, and if it's 0 then a line of lua code to sleep for that time does not even get added.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a builtin .interval or something that we can expose as a qcodes parameter and then use in this lua script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants