Core Utils

HAL Core Utility functions.

hal_py.CoreUtils.get_base_directory() os.PathLike

Get the base path to the HAL installation. 1. Use Environment Variable HAL_BASE_PATH 2. If current executable is hal (not e.g. python3 interpreter) use it’s path to determine base path. 3. Try to find hal executable in path and use its base path.

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_binary_directory() os.PathLike

Get the path to the executable of HAL.

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_default_log_directory(source_file: os.PathLike = '') os.PathLike

Get the path to the default directory for log files. If a netlist source file is provided, the function returns the parent directory, otherwise get_user_share_directory() / "log".

Parameters

source_file (pathlib.Path) – The netlist source file.

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_gate_library_directories() List[os.PathLike]

Get the paths to the locations where gate libraries are searched. Contains the share and user share directories.

Returns

A list of paths.

Return type

list[pathlib.Path]

hal_py.CoreUtils.get_library_directory() os.PathLike

Get the path to the shared and static libraries of HAL. The resulting path is relative to the binary directory.

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_plugin_directories() List[os.PathLike]

Get the paths to the locations where plugins are searched. Contains the library and user share directories.

Returns

A list of paths.

Return type

list[pathlib.Path]

hal_py.CoreUtils.get_share_directory() os.PathLike

Get the path to the shared objects of HAL. The resulting path is relative to the binary directory.

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_user_config_directory() os.PathLike

Get the path to the configuration directory of the user. This is ~/.config/hal on Unix.

Returns

The path.

Return type

pathlib.Path

hal_py.CoreUtils.get_user_share_directory() os.PathLike

Get the path to shared objects and files provided by the user. This is ~/.local/share/hal on Unix.

Returns

The path.

Return type

pathlib.Path