neurocarto.util.debug

neurocarto.util.debug.print_save(file)

print the saving message for the file, which is used in a saving function call.

It is a debugging use function.

Parameters:

file (str)

Returns:

Path of file

Return type:

Path

neurocarto.util.debug.line_mark(message)

print the current line number.

It is a debugging use function.

Parameters:

message (str)

class neurocarto.util.debug.TimeMarker

print the time interval between calls.

It is a debugging use function.

__init__(disable=False)
reset(message=None)
Parameters:

message (str | None)

class neurocarto.util.debug.Profiler
__init__(file, *, enable=True, capture_exception=False, dump_on_exit=True)
Parameters:
  • file (str | Path) – stat dump file

  • enable (bool | str) – enable profile. Use string, then this flag is controlled by the environment variable.

  • capture_exception – capture exception when __exit__.

  • dump_on_exit – dump file when __exit__ if enabled.

dump_file()

dump profile stat result into file.

Returns:

saved file.

Return type:

Path | None

build_command()
Return type:

str

print_command()

print the command that convert the stat dump file into a dot graph file.

run_command()
Return type:

BaseException | None