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.

def configure_logging(folder: pathlib.Path):

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.
def custom_exception_handler(exc_type, exc_value, exc_traceback):

If the exception is not KeyboardInterrupt, handle it.

def gcubed_warning_handler(message, category, filename, lineno, file=None, line=None):

Reports warnings in the logs and tries to indicate any G-Cubed related cause of the warning.

def now() -> str:

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.

def log(x: float) -> float:

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.

def file_summary(file_path: pathlib.Path, ancestors=3) -> str:

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.