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

BF APT Piezo Motor Actuator Multi Channel support #373

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

trappitsch
Copy link
Contributor

This BF is based on the bug report by @GarbatyGrabarz in issue #372. Multiple channels, e.g., for the KIM101, are incorrectly addressed. The following channel number convention, as defined in APT manual, is now implemented:

The channel being addressed
Chan 1 = 1, Chan 2 = 2, Chan 3 = 4, Chan 4 = 8

Tests were extended such that the correct behavior is now tested for by checking - where required - using all 4 channels.

@trappitsch
Copy link
Contributor Author

Hmm, I don't see exactly what is wrong here. Some dependency that was updated? Fails locally as well when I recreate the tox environment, however, I can't seem to figure out which dependency it would be, since the CI just successfully ran two days ago. Any ideas @scasagrande?

@trappitsch trappitsch marked this pull request as draft October 2, 2022 13:10
@scasagrande
Copy link
Contributor

Yeah let me take a look...

@scasagrande
Copy link
Contributor

It looks like importlib-metadata updated to 5.0.0 on Oct 1

This might be a pytest issue, or a hypothesis issue, not sure yet

@trappitsch
Copy link
Contributor Author

Thanks for looking into this. I will need some more time for the PR anyway to think it better through, next couple of weeks will be really busy...

@scasagrande
Copy link
Contributor

@trappitsch can you update your branch with latest main

@trappitsch
Copy link
Contributor Author

Yey, the tests are running through smoothly now. Thanks for the fix @scasagrande. Now I just need to find the time to work on this more... it's a fun issue though :)

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.10%. Comparing base (1db61e5) to head (407cef0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/instruments/thorlabs/thorlabsapt.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #373      +/-   ##
==========================================
- Coverage   99.11%   99.10%   -0.01%     
==========================================
  Files          89       89              
  Lines        8962     8975      +13     
==========================================
+ Hits         8883     8895      +12     
- Misses         79       80       +1     
Flag Coverage Δ
unittests 99.10% <92.30%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@trappitsch
Copy link
Contributor Author

My apologies, it has been a while. @GarbatyGrabarz I have no idea if this is still of interest to you - I hope it is. I tried my hands on another fix for #372:

  • KIM101 controller is assumed (if no other info given)( to be initialized as a multi-channel device and so 1, 2, 4, or 8 are sent for the channel number
  • If a channel's state is set to set_enabled, it's address is changed to 1, 2, 3, 4, and back to 1,2,4,8 if this is disabled again.

This is some try to get a handle on this mess, but since I don't have the hardware, it is difficult to say if this is a working solution. Any advise would be highly appreciated.

@GarbatyGrabarz
Copy link

Thanks for the fix! Unfortunately I am not able to verify it as currently I have no access to the device. I will let you know as soon as I get the access. Let's play a long game with this fix ;)

@trappitsch
Copy link
Contributor Author

Thanks @GarbatyGrabarz, that sounds great for me! Looking forward to the check and happy to work on it more if this doesn't work.

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.

3 participants