Skip to content

Proper implementation of 2D-slits#533

Open
MarcusZuber wants to merge 4 commits intomasterfrom
add_slits
Open

Proper implementation of 2D-slits#533
MarcusZuber wants to merge 4 commits intomasterfrom
add_slits

Conversation

@MarcusZuber
Copy link
Copy Markdown
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.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 21, 2024

Codecov Report

❌ Patch coverage is 91.90751% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.48%. Comparing base (b3fbd53) to head (1a630f7).
⚠️ Report is 47 commits behind head on master.

Files with missing lines 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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MarcusZuber
Copy link
Copy Markdown
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.

1 participant