Skip to content

Commit

Permalink
added state and wrapper illustrations
Browse files Browse the repository at this point in the history
  • Loading branch information
musslick committed Oct 21, 2024
1 parent 5c46b0c commit df9255a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/The State Mechanism.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"- operate on `States` and \n",
"- return `States`.\n",
"\n",
"<img src=\"https://autoresearch.github.io/autora/img/state_logic.png\" width=\"75%\" alt=\"State Logic\">\n",
"\n",
"The `autora.state` submodule provides classes and functions to help build these functions. "
]
},
Expand Down Expand Up @@ -327,7 +329,9 @@
"source": [
"### Use the `autora.state.on_state` decorator\n",
"\n",
"`autora.state.on_state` is a wrapper for functions which allows them to accept `State` objects as the first argument.\n",
"`autora.state.on_state` is a wrapper for functions which allows them to accept `State` objects as the first argument. This decorator enables AutoRA components to retrieve relevant data from the state and add new data to it. \n",
"\n",
"<img src=\"https://autoresearch.github.io/autora/img/state_wrapper.png\" width=\"75%\" alt=\"State Wrapper Overview\">\n",
"\n",
"The most concise way to use it is as a decorator on the function where it is defined. You can specify how the \n",
"returned values should be mapped to fields on the `State` using the `@autora.state.on_state(output=...)` argument."
Expand Down

0 comments on commit df9255a

Please sign in to comment.