uesgraphs.utilities
Utilies: Collection of all utility functions that are useful in several classes.
Functions
Creates default output file UESgraphOutput in the user dictionary. |
|
|
Retrieve an attribute value from a dictionary, handling case insensitivity. |
|
Creates a local workspace with given name |
|
Gives the uesgraph a name |
|
Set up a full file+console logger for major functions. |
|
Set up a simple console-only logger for small functions. |
- uesgraphs.utilities.default_json_path()[source]
Creates default output file UESgraphOutput in the user dictionary.
Paramters
- UESgraph_defaul_pathstr
Path, where uesgraph files will be saved.
- returns:
path – Path, where to save uesgraph files
- rtype:
str
- uesgraphs.utilities.make_workspace(name_workspace=None)[source]
Creates a local workspace with given name
If no name is given, the general workspace directory will be used
- uesgraphs.utilities.set_up_terminal_logger(name: str, level: int = 20) Logger [source]
Set up a simple console-only logger for small functions.
- Parameters:
name – Logger name
level – Logging level (default: INFO)
- Returns:
Configured console logger
- uesgraphs.utilities.set_up_file_logger(name: str, log_dir: str | None = None, level: int = 40) Logger [source]
Set up a full file+console logger for major functions.
- Parameters:
name – Logger name
log_dir – Directory for log files (default: temp directory)
level – Logging level (default: ERROR)
- Returns:
Configured file+console logger
- uesgraphs.utilities.get_attribute_case_insensitive(row, attribute_name)[source]
Retrieve an attribute value from a dictionary, handling case insensitivity.
This function tries to access the attribute with the original name first, then attempts to access it with different capitalizations if the original attempt fails.