Skip to content

Conversation

jenshnielsen
Copy link
Collaborator

@jenshnielsen jenshnielsen commented Apr 11, 2025

Resolves #7076

@jenshnielsen jenshnielsen requested a review from a team as a code owner April 11, 2025 13:00
@jenshnielsen jenshnielsen changed the title Refactor do2d [wip] Refactor do2d Apr 11, 2025
num_points2: int,
delay2: float,
*param_meas: ParamMeasT,
set_before_sweep: bool | None = True,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

flush_columns and set_before_sweep are not supported by dond yet. Need to figure out how to deal with that

message is used.
break_condition: Callable that takes no arguments. If returned True,
measurement is interrupted.
**kwargs: kwargs are the same as for dond and forwarded directly to dond.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add links like do0d/do1d

if log_info is not None:
meas._extra_log_info = log_info
else:
meas._extra_log_info = "Using 'qcodes.dataset.do2d'"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Retain this log message like do1d/do0d

enter_actions: ActionsT = (),
exit_actions: ActionsT = (),
before_inner_actions: ActionsT = (),
after_inner_actions: ActionsT = (),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are also not available.

Copy link
Contributor

Choose a reason for hiding this comment

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

enter_actions and exit_actions are available in dond.
Here's a suggestion to include before_inner_actions and after_inner_actions:

  1. Add arguments pre_sweep_actions and post_sweep_actions to LinSweep
  2. In _Sweeper.__getitem__, check if index is first or last in the sweep, then append pre_sweep or post_sweep to the actions accordingly.

Happy to have a go at this in a separate PR if you think it's a good solution

@jenshnielsen jenshnielsen requested a review from Copilot May 19, 2025 08:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the do2d function to delegate its core functionality to the dond function by using LinSweep objects.

  • Replaces legacy measurement setup, plotting, and parameter registration code
  • Delegates parameter sweep management and configuration through keyword arguments via dond
Comments suppressed due to low confidence (1)

src/qcodes/dataset/dond/do_2d.py:65

  • The refactoring removes several measurement configuration steps (e.g., parameter registrations, write period handling, and logging extra info) that were present in the legacy implementation; ensure that these functionalities are fully handled by dond or reintegrate the missing behavior if needed.
return cast(

show_progress: bool | None = None,
log_info: str | None = None,
break_condition: BreakConditionT | None = None,
**kwargs: Unpack[DondKWargs],
Copy link

Copilot AI May 19, 2025

Choose a reason for hiding this comment

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

The function docstring has not been updated to reflect the new keyword arguments that are forwarded to dond; consider updating it to clearly document the accepted parameters.

Copilot uses AI. Check for mistakes.

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.

refactor do2d

2 participants