Skip to content

Adds qt-like signals to Parameters#548

Open
MarcusZuber wants to merge 1 commit intomasterfrom
signals-for-parameters
Open

Adds qt-like signals to Parameters#548
MarcusZuber wants to merge 1 commit intomasterfrom
signals-for-parameters

Conversation

@MarcusZuber
Copy link
Copy Markdown
Member

I was looking for an elegant way to connect different Parameterizable-Parameters and had this idea.

This uses https://github.com/nexconnectio/pynnex which implements qt-like signals and slots and is quite light-weight. Currently, the development is quite active and looks clean.

Example:

from concert.devices.cameras.dummy import Camera
camera = await Camera()

def print_value(val):
   print(value)

camera['exposure_time'].value_set.connect(print_value)


camera.exposure = 1*q.s

One motivation for this would be to couple experiment parameters with addon-parameters (the number of the online-reco couples with the num_projections of the CT experiment).

TODO:

  • Tests
  • Doc

Parameters emit signals when the value and limits is changed by the user.
@MarcusZuber MarcusZuber force-pushed the signals-for-parameters branch from e6b807a to 7926fe0 Compare April 10, 2025 07:33
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 73.91304% with 6 lines in your changes missing coverage. Please review.

Project coverage is 82.83%. Comparing base (2eb3060) to head (7926fe0).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
concert/base.py 73.91% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #548      +/-   ##
==========================================
- Coverage   82.85%   82.83%   -0.02%     
==========================================
  Files         133      133              
  Lines       10928    10951      +23     
==========================================
+ Hits         9054     9071      +17     
- Misses       1874     1880       +6     

☔ 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

Works only with python3.10+. 3.9 will be EOL this October. I don't think we will do a new realease before...

@tfarago
Copy link
Copy Markdown
Contributor

tfarago commented Nov 12, 2025

Doesn't psutil work only on linux? I get the motivation but the concrete cases you mentioned could be also handled without signals, or? Let's discuss this Friday in the meeting.

@MarcusZuber
Copy link
Copy Markdown
Member Author

I did' t add psutil here... Sure, lets discuss it on Friday.

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.

2 participants