Skip to content

Commit

Permalink
Update settings.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen committed May 14, 2024
1 parent 3d40d5d commit f4bcced
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions docs/user/settings/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ export QUACC_CREATE_UNIQUE_DIR=False
export QUACC_WORKFLOW_ENGINE=None
```

or run the following before the first `quacc` import in your code:

```python
import os
os.environ["QUACC_SCRATCH_DIR"] = "/path/to/my/scratch/dir"
os.environ["QUACC_CREATE_UNIQUE_DIR"] = False
os.environ["QUACC_WORKFLOW_ENGINE"] = None
```

For more complex types, such as lists or dictionaries, refer to the corresponding section in the [pydantic-settings](https://docs.pydantic.dev/latest/concepts/pydantic_settings/#parsing-environment-variable-values) documentation. We use `__` as the delimiter for nested settings.

??? Tip "When is This Method Ideal?"
Expand All @@ -75,6 +65,10 @@ with change_settings({"RESULTS_DIR": "/new/path/to/store/results"}):
pass # Your calculation here
```

!!! "Warning"

Note that when deploying calculations via a workflow engine, changes to in-memory global variables on the local machine will not be reflected on the remote machine. To modify global settings in a script, ensure the setting re-assignment takes place in the decorated function itself. [Issue #2147](https://github.com/Quantum-Accelerators/quacc/issues/2147) seeks to improve the user experience in this regard.

??? Tip "When is This Method Ideal?"

This approach is ideal for fine-tuned modifications to settings within your workflow and for debugging scenarios (e.g. in a Jupyter Notebook). Note that when deploying calculations via a workflow engine, changes to in-memory global variables on the local machine will not be reflected on the remote machine. To modify global settings in a script, ensure the setting re-assignment takes place in the decorated function itself.
This approach is ideal for fine-tuned modifications to settings within your workflow and for debugging scenarios (e.g. in a Jupyter Notebook).

0 comments on commit f4bcced

Please sign in to comment.