Qcodes icon indicating copy to clipboard operation
Qcodes copied to clipboard

Deprecate `parameter.__getitem__`

Open jenshnielsen opened this issue 2 years ago • 3 comments

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

jenshnielsen avatar Feb 26 '23 08:02 jenshnielsen

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     

codecov[bot] avatar Feb 26 '23 08:02 codecov[bot]

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

jenshnielsen avatar Mar 01 '23 12:03 jenshnielsen