set_datadir#
- set_datadir(root_dir, relative_path=None)[source]#
Set the data folder and relative path to the user-specified location.
On startup, the datadir and rel_path are set to the conventions used to store data. datadir is the root directory to the data, and relative_path is a list of sub directories to the data –> to change the location of the data the user is able to supply a new root_dir and new relative path. If the user uses a similar directory path model that we use e.g. root_dir/demographics/contact… the user can change datadir without changing relative path, by passing in relative_path = None (default) – note, mostly deprecated but still functional if needed.
- Parameters:
root_dir (str) – new root directory for the data folder to point to
relative_path (str) – new relative path to the root_dir
- Returns:
path to the updated settings.datadir
- Return type:
str