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 2 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

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
@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

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