gcubed
The gcubed package provides a full implementation of the G-Cubed model.
An introduction to the G-Cubed Python implementation is available online.
Support for G-Cubed is available from McKibbin Software Group.
©1993-2023 McKibbin Software Group Pty Ltd. All rights reserved.
Return whether direct ndarray attributes should be compressed individually.
The default is disabled because model artifacts are normally written with an outer joblib zlib compression layer. Compressing large direct numeric arrays here first makes those bytes pass through two compression operations. On the 6N/196 benchmark, leaving direct arrays native reduced baseline save time from about 23.8s to 18.2s with effectively unchanged artifact size.
Return whether matrix dictionaries should be stored as one compressed payload.
Pack a matrix dictionary into one compressed NPZ payload.
Unpack a matrix dictionary stored by matrix_dictionary_to_npz_compressed_bytes.
Overview
Convenience method for setting up the logging system.
Run this at the start of an experiment to set up a standard logging system.
Arguments
folder: The folder where logs will be saved.
If the exception is not KeyboardInterrupt, handle it.
Install a warning handler that:
- Logs full warning messages with package-aware source info.
- Highlights the user code location inside the given project_root.
- Adds diagnostics for common NumPy warnings.
Args: project_root (Path): The root directory of your project. logger (Optional[logging.Logger]): Optional custom logger.
The current time and date as a string with a format that is
%Y-%m-%d_%H-%M-%S
This is useful for result reporting and debugging purposes when naming output files.
The natural logarithm of x.
This is a convenience function that is provided for consistency with the G-Cubed model.
Parameters
x : float The value for which the natural logarithm is required.
Returns
float The natural logarithm of x.
Overview
Get a summary of a file path
Arguments
file_path : The file path to summarise.
ancestors : The number of ancestor folders to include in the summary, 3 by default.
Returns
A string summarising the file path.
Exceptions
If the file path is not a Path object, an assertion error is raised.
Try to serialise a DataFrame to Parquet bytes with Zstd compression. Returns None if pyarrow/fastparquet is unavailable.