generic_functions

Functions from TanayLabUtilities which it is useful to make available. In principle we should put these in a separate TanayLabUtilities.py wrapper package, but that’s too much of a hassle.

class dafpy.generic_functions. AbnormalHandler ( value ) [source]

The action to take when encountering an “abnormal” (but recoverable) operation. See the Julia documentation for details.

IgnoreHandler = 'IgnoreHandler'

Ignore the abnormal operation.

WarnHandler = 'WarnHandler'

Print a warning for the abnormal operation.

ErrorHandler = 'ErrorHandler'

Raise an error for the abnormal operation.

dafpy.generic_functions. inefficient_action_handler ( handler : AbnormalHandler ) AbnormalHandler [source]

Specify the AbnormalHandler to use when accessing a matrix in an inefficient way (“against the grain”). Returns the previous handler. See the Julia documentation for details.

class dafpy.generic_functions. LogLevel ( value ) [source]

The (Julia) log levels. A specific int level can be used instead of any of these.

Debug = 'Debug'

Show debug messages and above.

Info = 'Info'

Show informational messages and above.

Warn = 'Warn'

Show warning messages and above.

Error = 'Error'

Show only error messages.

dafpy.generic_functions. setup_logger ( io : TextIO = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'> , * , level : LogLevel | int | None = None , show_time : bool | None = None , show_module : bool | None = None , show_location : bool | None = None ) None [source]

Setup a global logger that will print into io (which currently must be either sys.stdout or sys.stderr ), printing messages with a timestamp prefix. See the Julia documentation for details.