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
Distribution of Processing #481
base: master
Are you sure you want to change the base?
Conversation
This first commit enables us to have local and remote acquisitions and consumers. It's mostly about interfaces and defines a way how to create acquisitions and addons. It also introduces an explicit |
b909e95
to
ff891b3
Compare
concert/tests/integration/test_grating_interferometry_experiments.py
Outdated
Show resolved
Hide resolved
How about introducing a RemoteCamera, that sends to the Consumers instead of the RemoteAcquisition? Then the Experiments would not be different for local and remote acquisition. |
Why are you doing this to me?! :-) I will try. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #481 +/- ##
==========================================
- Coverage 87.81% 82.01% -5.80%
==========================================
Files 115 115
Lines 7966 8222 +256
==========================================
- Hits 6995 6743 -252
- Misses 971 1479 +508 ☔ View full report in Codecov by Sentry. |
) | ||
await self._params[arg].set(kwargs[arg]) | ||
|
||
@property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make all 'properties' concert Quantities/Parameters? Otherwise this will be confusing (since there is no async access, which is mandatory for the others to use).
'retrieval_padded_width': q.px, | ||
'retrieval_padded_height': q.px, | ||
'projection_margin': q.px, | ||
'x_region': q.px, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off-topic: Since years I'm thinking about a elegant way to use vectors/lists in Quantities/Properties. At some point somebody tries to do args.x_region[2] = 10*q.px
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't that work like it should automatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the getter will give you the vector (or whatever), but the setter will not be called, since only the []-operator is called on the result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I know what you mean, but this works:
concert > args = [1, 2 ,3] * q.px
concert > args
array([1, 2, 3]) <Unit('pixel')>
concert > args[0] = 10 * q.px
concert > args[0]
10 <Unit('pixel')>
concert > args
array([10, 2, 3]) <Unit('pixel')>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this not (independent of quantity etc.):
from concert.base import Parameterizable
class MyParameterizable(Parameterizable):
my_vector = Parameter()
async def __ainit__(self):
self._vec = [1, 2, 3]
async def _get_my_vector(self):
return self._my_vector
async def _set_my_vector(self, vec):
self._vec = vec
p = await MyParameterizable()
p.my_vector[1] = 5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that, well numpy managed to override []...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already thought to do this for the QuantityValue...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, then I leave it to you 😉
@@ -232,26 +233,39 @@ async def __call__(self, producer): | |||
|
|||
|
|||
class GeneralBackprojectArgs(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you already break (slightly) the interface to the reco-args: I always found it a bit artificial that the reco-args and the Reco were splitted (and not the args where properties of the reco-class). What do you think about merging both classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will keep it in mind, let me finish up the reco and the remote version of it and then I'll see if it will still be reasonable to merge.
|
||
def run_server(): | ||
TangoBenchmarker.run_server( | ||
args=['name', '-ORBendPoint', 'giop:tcp::1235', '-v4', '-nodb', '-dlist', 'a/b/c'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this everywhere to a proper DB-based start.
0c99603
to
3da5890
Compare
Tango device for the dummy concert camera sending images over a zmq socket. | ||
""" | ||
|
||
endpoint = attribute( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarcusZuber do you know why Tango doesn't like inheriting attributes? If you run the TangoDummyCamera
server you can set the endpoint without any problem, but try reading it and it just crashes.
self._params_initialized = True | ||
|
||
def dynamic_getter(self, attr): | ||
# If this were async def Tango would complain about it never being awaited |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of the reasons I will not change the format strings + eval in the reco server right now.
@MarcusZuber in |
which will be dealt with in PR #481.
8a67145
to
c96ed85
Compare
which will be dealt with in PR #481.
This is slightly connected with this and libuca: So far we have only one grab()-function, which will give in a buffered mode the oldest not read frames and in an unbuffered mode most probable the last recorded frame. Should we introduce a 2nd grab function for "live images" in libuca and concert? What is related to this PR: It would be nice to stream the live_images to the |
I don't see why not having a |
We really need the current implementation of the image walker/writer that handles metadata in this also to work. |
Can you give an example why? Is it the motor positions? |
I add a lot of stuff to the metadata, e.g. synchrotron current, motor positions, x-ray tube parameters, timestamps... That was the whole point of introducing the metadata. |
That's not so critical, it will start to be problematic when you really need some synchronization between metadata and a concrete image. What you mentioned here is easy to add, just another stream(s) with the metadata. |
I thought a bit more about the whole logging/metadata stuff. I think in the real use cases it would be ideal to attach metadata to a single image when a camera is run in software-trigger-source (e.g. a special stepped scan of which I have many) and to log time-coded metadata otherwise. So my suggestion would be that we maybe introduce a Line 32 in 9336224
|
I think this breaks encapsulation a little bit and would rather make the writer a bit more clever. I will come up with a concept and get back to this. |
cf933cb would be a simple implementation of the 'log_metadata'. Open for discussions. |
concert: Implement remote walker and logger
This will enable us to acquire data on a remote server and push it there via a ZMQ stream over network to processing nodes which can also be on different machines. Live preview will be able to subscribe to a stream of data and there will also be a stream splitter able to create a whole topology of processing nodes. The control will be done via concert, but only control, meaning mere synchronization of devices and data processing. All the rest will be done remotely, most probably via remote addons implemented as Tango servers for easy RPC access to them. More detailed info and diagrams to follow...
Todo
Acquisition
sends data to aProcessor
which sends the result toAddon
via aProxy
, so the addon doesn't have to care if the processing happens locally or remotely)teardown
vs.delete_device
, only one, both, which?ConcertAsyncioRunner