mario.upload_settings
- mario.upload_settings(source, *, persist=False)#
Replace settings for this Python process without modifying the package.
Settings are shared by databases in the current process. By default this call only changes the current session. With
persist=True, also save them as user defaults that new sessions load automatically. Kernels that have already loaded their settings keep their current configuration. Matrix aliases can change after loading a database: stored matrix IDs remain canonical and their data is not renamed or rewritten.- Parameters:
source (str or path-like or dict) – Path to a custom
.yamlfile or a settings dictionary. Missing sections and keys are filled with built-in defaults.persist (bool, keyword-only, default False) – Also save validated settings to
get_settings_path(). The profile is shared by the user’s environments unlessMARIO_CONFIG_DIRis set. The installed package is never modified.
- Raises:
WrongFormat – Settings or
persistare invalid. Active and saved settings remain unchanged.OSError – The source cannot be read or the profile cannot be written. Failed writes leave the previous active settings and profile intact.
Examples
>>> settings = mario.download_settings() >>> settings["nomenclature"].update({"E": "R", "F": "Re"}) >>> mario.upload_settings(settings) # this kernel only >>> mario.upload_settings(settings, persist=True) # opt in for future sessions
See Settings and Utilities for session settings, optional persistence and profile locations.