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

Add more structure to controllers #51

Merged
merged 7 commits into from
Oct 17, 2024
Merged

Add more structure to controllers #51

merged 7 commits into from
Oct 17, 2024

Conversation

jsouter
Copy link
Collaborator

@jsouter jsouter commented Oct 3, 2024

Setting as a draft as I have not fixed the tests yet, and I may refactor to make it less convoluted.

  • Fixes EigerHandler.put so that the responses it expects line up with what is provided by the real detector, not the tickit-devices sim (I will push a PR for my sim changes soon)
  • EigerController now has a subcontroller for each of the subsystems (detector, stream, monitor)
  • The detector subsystem controller has another subcontroller for threshold parameters
  • The threshold subcontroller has extra logic to shorten the record names
  • _create_attributes is now static, and allows the user to pass in methods to name and group the attributes to facilitate this
  • Each subcontroller has reference to a new Subsystem class which now owns all the queue_update logic, and an attribute_mapping which maps the parameter key to attributes if they have a custom name or belong to a subcontroller of the subsystem controller.
  • The top level subsystem controllers handle the update() logic and find attributes from their subcontrollers, which don't do much more than own their Attributes
  • Each subsystem has its own stale parameter Attribute, and the top level controller also has one that is True when any of the subcontrollers is stale.

Fixes #49

@jsouter
Copy link
Collaborator Author

jsouter commented Oct 3, 2024

image
The detector subsystem screen and threshold subscreen pictured here

@jsouter jsouter force-pushed the structure branch 4 times, most recently from 843895d to 88c8065 Compare October 9, 2024 13:22
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 67.74194% with 30 lines in your changes missing coverage. Please review.

Project coverage is 72.20%. Comparing base (42ee5ae) to head (1ab7a23).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/fastcs_eiger/eiger_controller.py 67.74% 30 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
+ Coverage   68.82%   72.20%   +3.38%     
==========================================
  Files           4        4              
  Lines         263      295      +32     
==========================================
+ Hits          181      213      +32     
  Misses         82       82              

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

@jsouter jsouter force-pushed the structure branch 2 times, most recently from 1744560 to b9384f3 Compare October 9, 2024 13:31
@jsouter jsouter marked this pull request as ready for review October 9, 2024 13:32
@jsouter
Copy link
Collaborator Author

jsouter commented Oct 9, 2024

Opening as tickit-devices changes have been merged and I've rewritten the tests to pass with the new structure

@jsouter jsouter requested a review from GDYendell October 9, 2024 13:34
@GDYendell GDYendell changed the title Add more structure to controllers (Fixes #49) Add more structure to controllers Oct 14, 2024
Copy link
Contributor

@GDYendell GDYendell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have had a first look over and it looks like a good start, but I don't think the overall structure is quite right.

src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
Copy link
Contributor

@GDYendell GDYendell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better now! Second pass review.

src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
src/fastcs_eiger/eiger_controller.py Outdated Show resolved Hide resolved
Copy link
Contributor

@GDYendell GDYendell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine to ignore the codecov patch failure here as the project coverage is higher with this.

Thanks @jsouter! Are you happy to merge?

@jsouter
Copy link
Collaborator Author

jsouter commented Oct 17, 2024

I am fine to ignore the codecov patch failure here as the project coverage is higher with this.

Thanks @jsouter! Are you happy to merge?

Yep, think it's in a good state!

@GDYendell GDYendell merged commit 4af946e into main Oct 17, 2024
18 of 19 checks passed
@GDYendell GDYendell deleted the structure branch October 17, 2024 10:49
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.

Add more structure to UI
2 participants