Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mole99 committed Oct 1, 2024
1 parent 2e85d18 commit efa8f8c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/source/tutorials/custom_scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The `script` argument defines the name of the Python script that is called for e
CACE expects the custom script to provide a function called `postprocess`. The function signature of `postprocess` is as follows:

```Python
def postprocess(results: dict[str, list], conditions: dict[str, Any], collate: str|None) -> dict[str, list]:
def postprocess(results: dict[str, list], conditions: dict[str, Any]) -> dict[str, list]:
```

The `results` argument contains the results of a single simulation run. Since `variables: [null, vout]` is set in the datasheet, `results` contains a single key `vout` with a list of values (`results['vout'] = [..., ...]`). The `conditions` argument contains the conditions for this simulation run. For example, it contains a key `temperature` with the value for this simulation run, e.g. `27` (`conditions['temperature'] = 27`).
Expand All @@ -53,6 +53,12 @@ def postprocess(results: dict[str, list], conditions: dict[str, Any]) -> dict[st
return {}
```

To notify CACE about any issues, simply raise an exception in your script:

```Python
raise Exception('This is an exception')
```

For a real example, see the contents of `inl.py`:

```Python
Expand Down

0 comments on commit efa8f8c

Please sign in to comment.