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

Use Coroutine Decorator to make Helics Federate #19

Open
josephmckinsey opened this issue Nov 4, 2022 · 0 comments
Open

Use Coroutine Decorator to make Helics Federate #19

josephmckinsey opened this issue Nov 4, 2022 · 0 comments

Comments

@josephmckinsey
Copy link
Collaborator

josephmckinsey commented Nov 4, 2022

The idea here is to create a decorator which applies to a coroutine, turning it into helics federate.

@helics_federate
@dynamic_input("voltage_in", Voltage)
@dynamic_output("voltage_out", Voltage)
@dynamic_input("topology", Topology)
@static_input("some_type", some_type)
async def state_estimator(time, voltage_in, voltage_out, topology, some_type):
    await time.request(1)
    voltage_arr = await voltage_in.get()
    await voltage_out.push(voltage_arr)

With this kind of language, we could be very compatible with mosaik and helics.

This might also allow us to create convenient subsystems like "race these two algorithms and then choose the output". That kind of behavior is hard to do with just HELICS.

It would also allow us to generate component descriptions very easily, and it would make real unit tests possible.

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

No branches or pull requests

1 participant