Skip to content

Commit

Permalink
Update data-folder.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLich authored Oct 25, 2023
1 parent 98b0205 commit b340a6f
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/docs/guide/data-folder.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,34 @@ with open('./data/bump_manifest/version.json', 'r') as f:

## Saving Data

When regolith is finished running, the data folder will be moved from the temporary location, back into the normal location. This flow allows you to store persistent data, by editing or creating new files.
To save data, you will need to add `"exportData": true,` to your `filter.json` definition. This is opt-in, to avoid slow copying of large data folders.

When regolith is finished running, data folders marked with `exportData` will be moved from the temporary location, back into the normal location. This flow allows you to store persistent data, by editing or creating new files.

For example if your filter is called `hello_world`, with `exportData` set to true, then you would be expected to store data into `data/hello_world/*`.

::: warning
This stands in contrast to the `RP` and `BP` folders, which will not be saved back into the project!
:::

For example:

filter.json
```json
{
"description": "An example of using export data",
"exportData": true,
"filters": [
{
"runWith": "python",
"script": "./main.py",
"name": "bump_manifest"
}
]
}
```

filter
```python
with open('./data/bump_manifest/version.json', 'w') as f:
json.dump({'version': '1.0'}, f)
Expand Down

0 comments on commit b340a6f

Please sign in to comment.