synnax icon indicating copy to clipboard operation
synnax copied to clipboard

Client - py - Fake Data Generation

Open emilbon99 opened this issue 9 months ago • 1 comments

Motivation

There are many a occasion where we want to load in a test data set, such as demoing the server/UI, running manual tests, and general purpose development.

I'd like to add another cli entrypoint to the python client CLI that generates some relevant, fake data and populates the cluster with it.

Details

We use click as our CLI library of choice. It's probably a good idea to try to set up a simple click application outside of Synnax before integrating a command into the Python client.

Step 1 - Add a new file and command

  1. Add a new file in the py/client/synnax/cli folder called populate.py and create a new function called populate that registers a new click command. Make sure to add the command as an entrypoint to the pyproject.toml file in the client/py directory.

Step 2 - Create a populate function with arugments

As arguments to the populate function, take the following arguments:

  1. num_channels - an integer representing the number of channels to create. Should default to 50.
  2. num_ranges - an integer representing the number of ranges to create. Should default to 20.
  3. num_samples - an integer representing the number of samples to generate for each range in each channel.

Step 3 - Create Channels

Using the num_channels parameter and an instantiated client, create fake channels with relevant, generated names (think pressure tranducers, thermocouples, etc.)

emilbon99 avatar Sep 25 '23 22:09 emilbon99