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

Proper implementation of 2D-slits #533

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Proper implementation of 2D-slits #533

wants to merge 4 commits into from

Conversation

MarcusZuber
Copy link
Member

@MarcusZuber MarcusZuber commented Mar 21, 2024

TODOs:

  • Allow multiple states per Parameterizable
  • Add tests for multiple states
  • Add some more documentation for the states
  • Add slit implementations
    • Slit with 4 motors, each moving one blade
    • Slit with motors moving the offset and gap
  • Add tests for slits

About the multiple states:
We use multiple devices, that are composed of sub-devices, where the state-machine can be split in multiple state-machines. Therefore, I introduced the possibility to use multiple states.

class ComplicatedDevice(Device):
   state_1 = State(default="standby")
   state_2 = State(default="standby")
   parameter_1 = Quantity(q.mm, check("standby", state_name="state_1")
   parameter_2 = Quantity(q.mm, check("standby", state_name="state_2")

   @transition(immediate="moving", target="standby", state_name="state_1")
   async def _set_parameter_1(self, p):
       # Do stuff

   @transition(immediate="moving", target="standby", state_name="state_2")
   async def _set_parameter_2(self, p):
       # Do stuff

Multiple states (instead on only 'state') can be used in concert.base.Parameterizable. This can be useful if the Device can be represented by multiple independent FSMs.
The *check*- and *transition*-function now have an additional parameter *state_name*, where the name of the corresponding state can be set.
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 91.90751% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 88.48%. Comparing base (b3fbd53) to head (1a630f7).
Report is 10 commits behind head on master.

Files Patch % Lines
concert/devices/slits/base.py 88.23% 10 Missing ⚠️
concert/base.py 70.00% 3 Missing ⚠️
concert/tests/unit/devices/test_slits.py 98.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #533      +/-   ##
==========================================
+ Coverage   88.36%   88.48%   +0.11%     
==========================================
  Files         120      124       +4     
  Lines        8306     8481     +175     
==========================================
+ Hits         7340     7504     +164     
- Misses        966      977      +11     

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

@MarcusZuber
Copy link
Member Author

Tests fail due to race-condition when motion is started. Have to find a elegant solution for this.

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.

None yet

1 participant