streamsight.utils
Utility
The utility module provides a set of utility functions that are used in the Streamsight library. These function are general functions that are not class specific and also contains functions that are used in the top level such as preparing the logger and creating the configuration file.
|
Create a configuration file for the logger. |
|
Check if directory is safe |
|
Add a column of zeros to a csr_matrix. |
|
Add a row of zeros to a csr_matrix. |
|
Converts a type to its name or returns the string. |
|
|
|
Prepare the logger. |
|
Converts a matrix to binary by setting all non-zero values to 1. |
|
Whether single element or tuple, always returns as tuple. |
Progress bar as visual. |
Logging
The logging module provides functions to control the logging level and suppression of warnings.
Example
import streamsight
# Set log level to INFO and suppress warnings
streamsight.log_level_by_name("INFO")
streamsight.suppress_warnings(suppress=True)
# Log some information
logger = logging.getLogger("streamsight")
logger.info("This is an informational message.")
# Emit a warning (this will be suppressed)
warnings.warn("This warning will not appear.")
|
Change the logging level for root logger. |
|
Change the logging level using level names like 'DEBUG', 'INFO', etc. |
|
Enable or disable the suppression of warnings. |
|
Suppress specific warnings by category. |