Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add function do2d_retrace #5780

Merged
merged 13 commits into from
Apr 11, 2024
Merged

add function do2d_retrace #5780

merged 13 commits into from
Apr 11, 2024

Conversation

julienbarrier
Copy link
Contributor

@julienbarrier julienbarrier commented Feb 26, 2024

  • Added a function to measure a 2D map in two directions: do2d_retrace.
  • The function is based on do2d, and tested on a working experiment running the latest build.

@julienbarrier julienbarrier requested a review from a team as a code owner February 26, 2024 19:51
@samantha-ho
Copy link
Contributor

Hi Julien, and thanks for your submission. We like your idea, but you may have missed some recent tools that make more complex measurements easier to write. Please see this example for an overview of the datasaver_builder and dond_into extensions. In the meantime, here's a quick skeleton refactor of your proposed function using the new tools. I think you'll agree it is cleaner.

def do2d_retrace(
    param_set1: ParameterBase,
    start1: float,
    stop1: float,
    num_points1: int,
    delay1: float,
    param_set2: ParameterBase,
    start2: float,
    stop2: float,
    num_points2: int,
    delay2: float,
    *param_meas: ParameterBase,
    measurement_name: str = "",
):
    dataset_definition = [
        DataSetDefinition(
            name=measurement_name,
            independent=[param_set1, param_set2],
            dependent=param_meas,
        ),
        DataSetDefinition(
            name=f"retrace {measurement_name}",
            independent=[param_set1, param_set2],
            dependent=param_meas,
        ),
    ]

    with datasaver_builder(dataset_definition) as datasavers:
        for _ in LinSweeper(param_set1, start1, stop1, num_points1, delay1):
            sweep_up = LinSweep(param_set2, start2, stop2, num_points2, delay2)
            sweep_down = LinSweep(param_set2, stop2, start2, num_points2, delay2)
            dond_into(
                datasavers[0], sweep_up, *param_meas, additional_setpoints=(param_set1,)
            )
            dond_into(
                datasavers[1],
                sweep_down,
                *param_meas,
                additional_setpoints=(param_set1,),
            )
    datasets = [datasaver.dataset for datasaver in datasavers]
    return datasets

@julienbarrier
Copy link
Contributor Author

Thanks @samantha-ho . The changes were implemented, but I had to remove a few arguments that I don’t think would be supported with this method:

  • set_before_sweep (there was no need in this type of measurement anyway)
  • write_period
  • flush_columns
  • do_plot
  • log_info
  • use_threads
  • break_condition

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 67.38%. Comparing base (1b430c6) to head (2556cc8).
Report is 10 commits behind head on main.

Files Patch % Lines
src/qcodes/dataset/dond/do2d_retrace.py 0.00% 29 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5780      +/-   ##
==========================================
- Coverage   67.45%   67.38%   -0.07%     
==========================================
  Files         348      349       +1     
  Lines       30138    30167      +29     
==========================================
  Hits        20329    20329              
- Misses       9809     9838      +29     

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

@astafan8 astafan8 enabled auto-merge April 11, 2024 07:42
@astafan8
Copy link
Contributor

@julienbarrier could you run the pre-commit hooks? see here https://github.com/microsoft/Qcodes/actions/runs/8643227369/job/23695807903?pr=5780 , there's something in the do2d retrace file and also in the newsfragment

@astafan8 astafan8 added this pull request to the merge queue Apr 11, 2024
Merged via the queue into microsoft:main with commit 6b2e1b0 Apr 11, 2024
17 of 19 checks passed
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.

None yet

3 participants