-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add create group operator #165
Conversation
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.
Are you thinking in using this group operator for the modular implementation of the devices?
If so I would like to understand better how. And what's the difference between this operator and the group by.
e5f7f5c
to
c8d6818
Compare
@aspaNeuro yes that is also the goal. The main difference with Notice that in the earlier workaround we were abusing
Basically in case the input is an existing grouped observable, the key is taken from the group key and the elements are simply the sequence defined in the nested workflow. |
Great, really neat and it seems quite easy to work with.
…__
André Almeida
Tel: +44 (0) 77 3736 2319
Email: ***@***.******@***.***>
Website: https://neurogears.org<https://neurogears.org/>
Address: 31 Oval Road, London, NW1 7EA
NeuroGEARS Ltd is a limited company registered in England and Wales.
Company Registration No. 10773335
________________________________
From: glopesdev ***@***.***>
Sent: 23 October 2023 9:22 AM
To: SainsburyWellcomeCentre/aeon_acquisition ***@***.***>
Cc: André Almeida ***@***.***>; Mention ***@***.***>
Subject: Re: [SainsburyWellcomeCentre/aeon_acquisition] Add create group operator (PR #165)
@aspaNeuro<https://github.com/aspaNeuro> yes that is also the goal. The main difference with GroupBy is that you can create a sequence of grouped observables directly from the key, instead of having to do PairValueWithKey > GroupBy. Graphically below it is the difference between the left-hand and right-hand side workflows:
[image]<https://user-images.githubusercontent.com/5315880/277269679-0f81c5b2-9a79-49b2-b32d-ca5696695ef3.png>
Notice that in the earlier workaround we were abusing GroupBy to construct a grouped observable by having effectively sequences where all items are the same key. There were costs associated with this, e.g. we are creating a dictionary with a single entry for each sequence and then doing a lookup on that dictionary for every single value. Granted, these are mostly negligible but more importantly we want to be able to specify for every group what is the nested workflow that generates values, which requires some kind of nested operator that captures this pattern, which is hard to do simply using the existing operators.
CreateGroup also works for changing the values of existing groups while keeping the same key, which is also currently clunky to do. Graphically again the difference between the left-hand and right-hand side workflows:
[image]<https://user-images.githubusercontent.com/5315880/277272890-d82061bc-ca4e-48ca-9baa-ef80477c3d26.png>
Basically in case the input is an existing grouped observable, the key is taken from the group key and the elements are simply the sequence defined in the nested workflow.
—
Reply to this email directly, view it on GitHub<#165 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARXDCUU2VAVEFSBVV5WEI2TYAYSNTAVCNFSM6AAAAAA6KMMLDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZUGY3TCMBWGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
c8d6818
to
f4ed4e4
Compare
This PR introduces a new
CreateGroup
operator used to convert the values in a sequence into a grouped observable, using each element of the input sequence as the group key. The values of each created group are specified through a nested workflow which receives the key value as its input.