From 68f7bac105b574c4eff5d85526a24a2fae3963ee Mon Sep 17 00:00:00 2001 From: John Gerrard Holland Date: Fri, 1 Dec 2023 14:21:46 -0500 Subject: [PATCH] docs: restructure basic-usage directory --- docs/cli/basic-usage/example/__init__.py | 0 docs/cli/basic-usage/{ => example}/lib.py | 0 docs/cli/basic-usage/{ => example}/plot.py | 3 ++- docs/cli/basic-usage/index.md | 8 ++++---- 4 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 docs/cli/basic-usage/example/__init__.py rename docs/cli/basic-usage/{ => example}/lib.py (100%) rename docs/cli/basic-usage/{ => example}/plot.py (96%) diff --git a/docs/cli/basic-usage/example/__init__.py b/docs/cli/basic-usage/example/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/docs/cli/basic-usage/lib.py b/docs/cli/basic-usage/example/lib.py similarity index 100% rename from docs/cli/basic-usage/lib.py rename to docs/cli/basic-usage/example/lib.py diff --git a/docs/cli/basic-usage/plot.py b/docs/cli/basic-usage/example/plot.py similarity index 96% rename from docs/cli/basic-usage/plot.py rename to docs/cli/basic-usage/example/plot.py index 42e25ca2..4ccb4f48 100644 --- a/docs/cli/basic-usage/plot.py +++ b/docs/cli/basic-usage/example/plot.py @@ -4,13 +4,14 @@ import numpy as np import pandas as pd import typer -from lib import ground_truth, noise_std from matplotlib import pyplot as plt from sklearn.model_selection import GridSearchCV from autora.state import StandardState from autora.workflow.__main__ import load_state +from .lib import ground_truth, noise_std + def plot_results(state: StandardState): x = np.linspace(-10, 10, 100).reshape((-1, 1)) diff --git a/docs/cli/basic-usage/index.md b/docs/cli/basic-usage/index.md index 9ff33dc7..9320b85d 100644 --- a/docs/cli/basic-usage/index.md +++ b/docs/cli/basic-usage/index.md @@ -6,8 +6,8 @@ The command line interface allows us to load and save `States` and run arbitrary To use the command line, we first define a file containing the functions we want to run on the State. -```python title="lib.py" ---8<-- "https://raw.githubusercontent.com/AutoResearch/autora-core/docs/update-workflow-docs/docs/cli/basic-usage/lib.py" +```python title="example/lib.py" +--8<-- "https://raw.githubusercontent.com/AutoResearch/autora-core/docs/update-workflow-docs/docs/cli/basic-usage/example/lib.py" ``` We can run the pipeline of initialization, condition generation, experiment and theory building as follows. @@ -109,8 +109,8 @@ print(state) `state` is the following object which, once loaded, can be treated like any other `State` object. For instance, we can plot the results: -```python title="plot.py" ---8<-- "https://raw.githubusercontent.com/AutoResearch/autora-core/docs/update-workflow-docs/docs/cli/basic-usage/plot.py" +```python title="example/plot.py" +--8<-- "https://raw.githubusercontent.com/AutoResearch/autora-core/docs/update-workflow-docs/docs/cli/basic-usage/example/plot.py" ``` ```shell