Skip to content

Commit 30f0eb3

Browse files
docs(website): more robust custom experiment docs (#284)
- Add point.yaml to density example - Load point.yaml and python density custom_experiment example from the files in the example folder - Update tox.ini to run the density example
1 parent 4b4d8c2 commit 30f0eb3

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) IBM Corporation
2+
# SPDX-License-Identifier: MIT
3+
entity:
4+
mass: 8
5+
volume: 4
6+
experiments:
7+
- actuatorIdentifier: custom_experiments
8+
experimentIdentifier: calculate_density

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ commands=
5353
pytest -n auto --dist worksteal -rx -vv --log-level=INFO --color=yes plugins/actuators/sfttrainer/ado_actuators/sfttrainer/tests/
5454
# Basic test of custom experiment examples
5555
ado describe experiment calculate_density
56+
run_experiment examples/density_example/point.yaml
5657
# Basic test of ray_tune
5758
ado get operator ray_tune
5859
ado template operation --operator-name=ray_tune

website/docs/actuators/creating-custom-experiments.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,9 @@ In the simplest case:
4747
`output_property_identifiers` parameter of the decorator
4848

4949
```python
50-
from typing import Dict, Any
51-
from orchestrator.modules.actuators.custom_experiments import custom_experiment
52-
53-
54-
@custom_experiment(
55-
output_property_identifiers=["density"]
56-
)
57-
def calculate_density(mass: float, volume: float) -> Dict[str, Any]:
58-
density_value = mass / volume if volume else None
59-
return {"density": density_value}
50+
{%
51+
include "../../../examples/density_example/density/density.py"
52+
%}
6053
```
6154

6255
**Experiment Naming:**
@@ -113,7 +106,7 @@ To add your experiments to `ado`:
113106
2. Run:
114107

115108
```shell
116-
ado describe actuators --details
109+
ado get actuators --details
117110
```
118111

119112
All custom experiments are made available in `ado` through
@@ -127,13 +120,11 @@ You can test your custom experiment
127120
using the [`run_experiment`](run_experiment.md) command line tool.
128121
Save the following YAML to a file `point.yaml`
129122

123+
<!-- markdownlint-disable-next-line first-line-h1 -->
130124
```yaml
131-
entity:
132-
mass:8
133-
volume:4
134-
experiments:
135-
- actuatorIdentifier: custom_experiments
136-
experimentIdentifier: calculate_density
125+
{%
126+
include "../../../examples/density_example/point.yaml"
127+
%}
137128
```
138129

139130
then execute:

0 commit comments

Comments
 (0)