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

[BUG]: Auto-generated TSP functions containing arguments with defaults require all optional arguments to be provided values if any are desired to be changed #285

Open
GaliumNick opened this issue Aug 27, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@GaliumNick
Copy link

GaliumNick commented Aug 27, 2024

Description of the bug

Hello,
I am trying to get the sample code smu_2460_solar_panel_sweep.py to work without fail_abort restraint. Any idea how to turn off fail_abort? I set it to 0, '0', 'smu.OFF', 'False', False, and inst.commands.smu.OFF with no effect.
image

The parameter calls for a str, but when I input a string, it just spits out:
Screenshot 2024-08-29 122220

I changing the function to `sweeplinearstep()' and it shows the same error. When I put in 0 nothing changes. The sweep still stops when the smu hits compliance.

Steps To Reproduce

  1. Run sample code smu_2460_solar_panel_sweep.py
  2. Go to sweeplinear() parameters and add fail_abort=inst.commands.smu.OFF
  3. Read terminal
  4. Complain on GitHub
@GaliumNick GaliumNick added the bug Something isn't working label Aug 27, 2024
@GaliumNick
Copy link
Author

I found the error in the source code:

As you can see in the first screen shot up top in my post, all optional arguments are set to None. The problem occurs in the next lines of the sweeplinear() function:
image
I set fail_abort=inst.commands.smu.OFF, however because of the code line if x is not None, the function doesn't write anything for empty arguments. This causes it to end up writing 'smu.OFF' to the first optional argument count instead. This is why there's a TypeError.

All that is needed to fix this issue is to set every argument to their default in the argument list:
image

@nfelt14 nfelt14 reopened this Aug 29, 2024
@nfelt14
Copy link
Collaborator

nfelt14 commented Aug 29, 2024

I am re-opening this issue, since it is not fixed yet.

@nfelt14
Copy link
Collaborator

nfelt14 commented Aug 29, 2024

The workaround is just to provide all default values when you call the function, but that isn't a true fix.

@nfelt14 nfelt14 changed the title [BUG]: IV Sweep Fail_Abort TypeError [BUG]: Auto-generated TSP functions containing arguments with defaults require all optional arguments to be provided values if any are desired to be changed Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants