Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ff5d41d
working module admin actions, need to edit based on state, needs cleanup
caseystone Aug 12, 2024
cf3f611
working module pause button, need to account for allowed admin actions
caseystone Aug 14, 2024
c7182fe
small changes before rebase
caseystone Aug 14, 2024
284fa37
merge with dev
caseystone Aug 14, 2024
f47a3a9
working pause resume module button
caseystone Aug 20, 2024
f7eb49e
pause module button only appears if has pasue admin action
caseystone Aug 21, 2024
e0f27db
pause resume workcell button, not tested on modules with no pause adm…
caseystone Aug 21, 2024
a1d7eb2
Adding docs for datapoints, cleaning up experiment client and routes
RyanTheRobothead Aug 26, 2024
5e09e92
Docker cache improvements, fix color terminal output for modules on w…
RyanTheRobothead Aug 28, 2024
eda9815
Add workcell-as-module support; add experiment datapoint creation sup…
RyanTheRobothead Aug 28, 2024
064bb9c
Merge branch 'main' into docs_updates
RyanTheRobothead Aug 28, 2024
8d7de4b
Add check-in for experiment clients
RyanTheRobothead Sep 4, 2024
5afef66
buttons for admin commands added, work needed on functionality
caseystone Sep 4, 2024
e5ac575
Merge branch 'main' into admin_actions
caseystone Sep 4, 2024
ea77ecd
Pre-commit Checks
RyanTheRobothead Sep 10, 2024
8a063d6
WIP: add lock/unlock support; testing
RyanTheRobothead Sep 11, 2024
21d88c7
Add utility module
RyanTheRobothead Sep 11, 2024
472cf2a
Merge branch 'docs_updates' of https://github.com/AD-SDL/wei into doc…
RyanTheRobothead Sep 11, 2024
6c122f7
Merge branch 'docs_updates' into admin_actions
RyanTheRobothead Sep 11, 2024
ba38a8b
Bump to v0.6.3
RyanTheRobothead Sep 11, 2024
be01d29
Merge branch 'dev' into admin_actions
RyanTheRobothead Sep 11, 2024
68de8dc
Pre-commit fixes
RyanTheRobothead Sep 11, 2024
72eaab5
Fix stringy dashboard args, make utility module robust to errors
RyanTheRobothead Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
#cache-from: type=gha
#cache-to: type=gha,mode=max
cache-from: type=gha
cache-to: type=gha,mode=max
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ RUN mkdir -p wei/requirements
RUN mkdir -p .wei/experiments
RUN mkdir -p .diaspora

# Install Python Dependencies first, for caching purposes
# Install Node and Python Dependencies first, for caching purposes
COPY ./src/ui/package*.json ./
RUN npm install

COPY requirements/requirements.txt wei/requirements/requirements.txt
COPY requirements/dev.txt wei/requirements/dev.txt
RUN --mount=type=cache,target=/root/.cache \
pip install --upgrade setuptools wheel pip && \
pip install -r wei/requirements/requirements.txt

# Install Node Dependencies first, for caching purposes
COPY ./src/ui/package*.json ./
RUN npm install

# Copy rest of wei files
COPY src wei/src
COPY tests wei/tests
Expand Down
8 changes: 8 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ services:
--save 600 1
--loglevel warning
--appendonly yes'
utilities:
image: ${IMAGE}
container_name: utilities
ports:
- 8001:8001
command: 'python3 -m wei.modules.utility_module
--port 8001
--alias utilities'

################
# Data Storage #
Expand Down
30 changes: 30 additions & 0 deletions docs/source/pages/_autosummary/wei.core.notifications.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
wei.core.notifications
======================

.. automodule:: wei.core.notifications







.. rubric:: Functions

.. autosummary::

send_email
send_failed_step_notification













4 changes: 3 additions & 1 deletion docs/source/pages/_autosummary/wei.core.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wei.core
wei.core
========

.. automodule:: wei.core
Expand Down Expand Up @@ -34,10 +34,12 @@ wei.core
wei.core.location
wei.core.loggers
wei.core.module
wei.core.notifications
wei.core.scheduler
wei.core.state_manager
wei.core.step
wei.core.storage
wei.core.workcell
wei.core.workcell_actions
wei.core.workflow

36 changes: 36 additions & 0 deletions docs/source/pages/_autosummary/wei.core.workcell_actions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
wei.core.workcell\_actions
==========================

.. automodule:: wei.core.workcell_actions







.. rubric:: Functions

.. autosummary::

delay
delay_until





.. rubric:: Classes

.. autosummary::

WorkcellActions









31 changes: 31 additions & 0 deletions docs/source/pages/_autosummary/wei.routers.data_routes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
wei.routers.data\_routes
========================

.. automodule:: wei.routers.data_routes







.. rubric:: Functions

.. autosummary::

create_datapoint
get_datapoint
get_datapoint_info













Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ wei.routers.experiment\_routes

.. autosummary::

event_return
get_all_experiments
get_campaign
get_experiment_endpoint
Expand Down
3 changes: 2 additions & 1 deletion docs/source/pages/_autosummary/wei.routers.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wei.routers
wei.routers
===========

.. automodule:: wei.routers
Expand Down Expand Up @@ -28,6 +28,7 @@ wei.routers
:recursive:

wei.routers.admin_routes
wei.routers.data_routes
wei.routers.event_routes
wei.routers.experiment_routes
wei.routers.location_routes
Expand Down
6 changes: 5 additions & 1 deletion docs/source/pages/_autosummary/wei.server.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wei.server
wei.server
==========

.. automodule:: wei.server
Expand All @@ -15,6 +15,10 @@ wei.server

is_server_up
lifespan
workcell_about
workcell_action
workcell_resources
workcell_state



Expand Down
23 changes: 23 additions & 0 deletions docs/source/pages/_autosummary/wei.types.datapoint_types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
wei.types.datapoint\_types
==========================

.. automodule:: wei.types.datapoint_types



















30 changes: 30 additions & 0 deletions docs/source/pages/_autosummary/wei.types.exceptions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
wei.types.exceptions
====================

.. automodule:: wei.types.exceptions















.. rubric:: Exceptions

.. autosummary::

WorkflowCanceledException
WorkflowFailedException





4 changes: 3 additions & 1 deletion docs/source/pages/_autosummary/wei.types.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wei.types
wei.types
=========

.. automodule:: wei.types
Expand Down Expand Up @@ -28,7 +28,9 @@ wei.types
:recursive:

wei.types.base_types
wei.types.datapoint_types
wei.types.event_types
wei.types.exceptions
wei.types.experiment_types
wei.types.interface_types
wei.types.module_types
Expand Down
5 changes: 4 additions & 1 deletion docs/source/pages/_autosummary/wei.utils.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wei.utils
wei.utils
=========

.. automodule:: wei.utils
Expand All @@ -18,7 +18,10 @@ wei.utils
initialize_state
json_to_csv
parse_args
pretty_type_repr
string_to_bool
threaded_daemon
threaded_task



Expand Down
56 changes: 56 additions & 0 deletions docs/source/pages/concepts/datapoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

===========
Data Points
===========

A data point is a single measurement or observation taken during the course of an experiment. Data points are the fundamental building blocks of experimental data, and are used to generate the results and conclusions of an experiment.

WEI currently supports two broad categories of data points:

- ``data_value``: A single JSON serializable data point, such as a number, string, or dictionary. This is useful for scalar data points, such as single sensor readings (temperature, pressure, etc.) or for data that lends itself well to a dictionary format (e.g. a set of key-value pairs).
- ``local_file``: A file that is stored locally on the WEI server. This is useful for larger data points, such as images, videos, or other large files that are generated as part of an experiment. The file is stored on the server and can be accessed later by the user. Any file type can be stored as a local file, but the user should be aware of the storage limitations of the WEI server.

Data points are typically generated by a Workflow Run, and are associated with a specific Experiment. They can be logged to the Experiment by the WEI server (such as when returned by a module as part of a Workflow Run) or by the user via the ``/data`` REST API endpoint or :func:`wei.experiment_client.ExperimentClient.create_datapoint` method, and are stored in WEI's database and/or local storage for later retrieval and analysis.

Data Labels
===========

In addition to a unique ID, all data points have a ``label`` field, which is a human-readable string that describes the data point. This label is used to identify the data point in the WEI database and in the results of an experiment. The label should be descriptive and informative, and should help the user understand the context and meaning of the data point.

There are two ways a data point can come to be labeled:

- By the module, as part of the action that generates the data point. In this case, the module should provide a label as part of the data point, which will be used by WEI to identify the data point.
- By the experimenter, as part of labeling a data point in a workflow or creating it in the experiment application. In this case, the experimenter should provide a label for the data point in the workflow file, which will be used by WEI to identify the data point.

For instance, in the following example Workflow definition, the data point generated by the ``take_picture`` action is labeled "experiment_result":

.. code-block:: yaml

- name: Take Picture
module: camera
action: take_picture
args:
file_name: "experiment_result.jpg"
data_labels:
image: "experiment_result"

If this step were part of a Workflow Run, the data point generated by the ``take_picture`` action would be labeled "experiment_result". This label would be used to identify the data point in the WEI database and in the results of the experiment. If the user does not provide a label, the default will be used for each data point returned by a module (in this case, "image")

Retrieving Data Points
======================

Data points can always be retrieved by their ID using the WEI REST API (`/data/{datapoint_id}`) or using the :func:`wei.experiment_client.ExperimentClient.get_datapoint_value` and :func:`wei.experiment_client.ExperimentClient.save_datapoint_value` python methods. You can find the datapoint_id using the information returned in the Workflow Run object; the ids for each datapoint are included in the `result.data` field for the step.

For convenience, you can also use the :func:`wei.types.workflow_types.WorkflowRun.get_datapoint_id_by_label` and :func:`wei.types.workflow_types.WorkflowRun.get_all_datapoint_ids_by_label` methods to retrieve data points by their label.

For instance, to retrieve the data point labeled "experiment_result" from the example above, you could use the following code:

.. code-block:: python


datapoint_id = wf_run.get_datapoint_id_by_label("experiment_result")

# Retrieve the data point using the ExperimentClient
value = experiment_client.get_datapoint_value(datapoint_id)

print(value)
2 changes: 2 additions & 0 deletions docs/source/pages/concepts/experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ We refer to any program or application using the ExperimentClient or the REST AP

A diagram of how a WEI experiment application interacts with a workcell.

Next Steps
==========

To learn how to write your own Experiment Application, consult :doc:`/pages/how-to/experiment`.
1 change: 1 addition & 0 deletions docs/source/pages/concepts/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Core Concepts
workcell
workflow
experiment
datapoints
Loading