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

A case for Actor capability descriptions #45

Open
bilderbuchi opened this issue Feb 12, 2023 · 4 comments
Open

A case for Actor capability descriptions #45

bilderbuchi opened this issue Feb 12, 2023 · 4 comments
Assignees
Labels
discussion-needed A solution still needs to be determined distributed_ops Aspects of a distributed operation, networked or on a node messages Concerns the message format

Comments

@bilderbuchi
Copy link
Member

bilderbuchi commented Feb 12, 2023

I think it would be important to require an Actor to be able to describe the capabilities of its Driver (e.g. list of Parameters and Actions) in an automated fashion, e.g. via a schema exchange mechanism.
So far, this was one of the points that made Avro attractive (as this is built into that protocol), but Avro is considered to complex for preserving a low entry threshold (#43).
However, this is not tied to using Avro, and can be implemented in a number of other ways.

There is significant disagreement on the benefits/drawbacks of requiring this description (see #43).
I'll try to make a case for requiring that Actors be able to describe their capabilities in an automated fashion, and will try to support this with use cases, usage scenarios, maybe some prototyping (e.g. how to derive a schema from any pymeasure Instrument -- I already did that before).

@bilderbuchi bilderbuchi added distributed_ops Aspects of a distributed operation, networked or on a node discussion-needed A solution still needs to be determined messages Concerns the message format labels Feb 12, 2023
@bilderbuchi bilderbuchi self-assigned this Feb 12, 2023
@bilderbuchi bilderbuchi changed the title Actor capability description A case for Actor capability descriptions Feb 12, 2023
@BenediktBurger
Copy link
Member

Shouldn't we also standardize the pymeasure docstrings in order to make at least pymeasure compatible (and here at least new instruments)?

@bilderbuchi
Copy link
Member Author

Shouldn't we also standardize the pymeasure docstrings in order to make at least pymeasure compatible (and here at least new instruments)?

Yes we should.

@BenediktBurger
Copy link
Member

I wrote a "TransparentDirector", which requests at access all properties from the connected Actor, such that you could replace inst = SomeInstrument(adapter) with inst = TransparentDirector(actor="Namespace.Actor_of_SomeInstrument") and your code will work the same, as long as you use properties (get or set).

A capability description would allow that director to also call methods transparently (right now you have to add a Descriptor for each method you'd like to use) and to use channels transparently.
Last but not least, the description would allow to use autocompletion on the TransparentDirector.

@bilderbuchi
Copy link
Member Author

Nice!
One thing a generic capability description feature in LECO would enable is to have this be independent of the instrument library that is behind the Actor. If the instrument library is consistent enough, this would have to be implemented once for all its instruments.
E.g. in pymeasure, we heavily use properties, so it's pretty straightforward to detect the interfaces. Other libraries might use methods only, or maybe consistenly named GetX/SetX pairs (thinking of C++ idioms).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion-needed A solution still needs to be determined distributed_ops Aspects of a distributed operation, networked or on a node messages Concerns the message format
Projects
None yet
Development

No branches or pull requests

2 participants