This repository was archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
This repository was archived by the owner on Nov 1, 2024. It is now read-only.
LabGraph Monitor API Improvement #77
Copy link
Copy link
Open
Description
🚀 Feature
LabGraph Monitor currently needs a user to define the websocket connections when generating the yaml file passed to the frontend. Example for labgraph_monitor_example.py (link):
def connections(self) -> lg.Connections:
return (
(self.NOISE_GENERATOR.NOISE_GENERATOR_OUTPUT, self.ROLLING_AVERAGER.ROLLING_AVERAGER_INPUT),
(self.NOISE_GENERATOR.NOISE_GENERATOR_OUTPUT, self.AMPLIFIER.AMPLIFIER_INPUT),
(self.NOISE_GENERATOR.NOISE_GENERATOR_OUTPUT, self.ATTENUATOR.ATTENUATOR_INPUT),
(self.NOISE_GENERATOR.NOISE_GENERATOR_OUTPUT, self.SERIALIZER.SERIALIZER_INPUT_1),
(self.ROLLING_AVERAGER.ROLLING_AVERAGER_OUTPUT, self.SERIALIZER.SERIALIZER_INPUT_2),
(self.AMPLIFIER.AMPLIFIER_OUTPUT, self.SERIALIZER.SERIALIZER_INPUT_3),
(self.ATTENUATOR.ATTENUATOR_OUTPUT, self.SERIALIZER.SERIALIZER_INPUT_4),
(self.SERIALIZER.SERIALIZER_OUTPUT, self.WS_SERVER_NODE.topic),
)
Can we simplify the the API to the following instead:
def connections(self) -> lg.Connections:
return (
(self.NOISE_GENERATOR.NOISE_GENERATOR_OUTPUT, self.ROLLING_AVERAGER.ROLLING_AVERAGER_INPUT),
(self.NOISE_GENERATOR.NOISE_GENERATOR_OUTPUT, self.AMPLIFIER.AMPLIFIER_INPUT),
(self.NOISE_GENERATOR.NOISE_GENERATOR_OUTPUT, self.ATTENUATOR.ATTENUATOR_INPUT),
)
Additional context
- Existing application can be found [here] (https://github.com/facebookresearch/labgraph/tree/main/extensions/yaml_support)
- The code should be added at folder is https://github.com/facebookresearch/labgraph/tree/main/extensions/yaml_support
- Create setup.py and README.md, where example can be found at: https://github.com/facebookresearch/labgraph/tree/main/extensions/labgraph_viz
- Add github action support, reference: https://github.com/facebookresearch/labgraph/actions/workflows/main.yml
- Add proper license header, example:
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
Metadata
Metadata
Assignees
Labels
No labels