Debug
load_workspace(path, target_globals=None)
Load variables from a joblib file into the specified global namespace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the |
required |
target_globals
|
Optional[Dict[str, Any]]
|
Dictionary (typically |
None
|
Example
load_workspace("workspace.joblib")
Source code in isca_tools/utils/debug.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
save_workspace(filename, variables=None, compress=('lz4', 3))
Save selected or all variables from the current workspace to a joblib file.
If no variables are specified, saves all local variables from the caller's scope.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Path to the |
required |
variables
|
Optional[Union[Dict[str, Any], list[str]]]
|
Either: - A dictionary of variable names to values to save, or - A list of variable names (as strings) to extract from the caller's workspace. If None, all variables from the caller's local scope are saved. |
None
|
compress
|
Union[bool, str, tuple]
|
Compression method for joblib. Examples: - False (no compression) - 'lz4' or 'gzip' - ('lz4', 3) for method + compression level |
('lz4', 3)
|
Example
x, y = 1, [1, 2, 3] save_workspace("test.joblib", ["x", "y"]) save_workspace("all_vars.joblib") # saves everything in current workspace
Source code in isca_tools/utils/debug.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |