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

Deprecate parameter.__getitem__ #5036

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jenshnielsen
Copy link
Collaborator

@jenshnielsen jenshnielsen commented Feb 26, 2023

And therefor the ability to sweep a parameter using the syntax
param[0,1.0,10]

  • This syntax is confusing since its not really indexing the parameter
  • The implementation requires the input to be floats which is not
    pytonic
  • It does nothing that cannot be done with param.sweep

Perhaps it makes more sense to add a sweep function taking a parameter

def sweep(parameter: Parameter, slice) -> SweepFixedValues

and also deprecate sweep.

  • Add changelog
  • The ability to sweep individual values with [val1,val2, ...] is not supported using sweep
  • Setting an individual value with [1] is more clunky
  • Update qcodes_loop to not make use of this

@codecov
Copy link

codecov bot commented Feb 26, 2023

Codecov Report

Merging #5036 (5b7faca) into master (069f68d) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5036      +/-   ##
==========================================
- Coverage   67.31%   67.27%   -0.04%     
==========================================
  Files         357      357              
  Lines       29839    29841       +2     
==========================================
- Hits        20085    20077       -8     
- Misses       9754     9764      +10     

@jenshnielsen
Copy link
Collaborator Author

jenshnielsen commented Mar 1, 2023

This is not a realistic approach since qcodes_loop makes to heavy use of __getitem__ in all its forms.

Suggest to add a class to qcodes loop that takes a parameter as input and exposes__getitem__ and sweep to use in that package

And therefor the ability to sweep a parameter using the syntax
param[0,1.0,10]

* This syntax is confusing since its not really indexing the parameter
* The implementation requires the input to be floats which is not
pytonic
* It does nothing that cannot be done with param.sweep
@jenshnielsen jenshnielsen force-pushed the deprecate_parameter_get_item branch from 5b7faca to 028f6b4 Compare February 4, 2025 19:26
@jenshnielsen jenshnielsen requested a review from a team as a code owner February 4, 2025 19:26
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.38%. Comparing base (bf68b23) to head (33dac20).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5036   +/-   ##
=======================================
  Coverage   69.37%   69.38%           
=======================================
  Files         341      341           
  Lines       31381    31385    +4     
=======================================
+ Hits        21771    21775    +4     
  Misses       9610     9610           

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

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.

2 participants