Settings and logging#

In-place operations#

By default, methods change the object they are called on (see Data objects). The default can be changed for the whole package:

pp.set_default_inplace(False)   # methods return changed copies
pp.get_default_inplace()        # False

A value given to an object’s constructor (inplace=...) or to a single method call takes precedence. This holds for every method that changes the data (also drop_data(), blink detection and seg.pupil.baseline_correct()); all of them return the (changed) object. Only the set_* methods (e.g., set_events()) always change the object itself.

set_default_inplace

Set the package-level default for inplace.

get_default_inplace

Return the package-level default for inplace.

Logging#

pypillometry reports what it does with loguru. By default, the log level is INFO, which gives a moderate amount of information. Use WARNING to see only problems, or DEBUG to see everything:

pp.logging_set_level("WARNING")
pp.logging_disable()            # no messages at all
pp.logging_enable()

with pp.loglevel("DEBUG"):      # temporarily, for a block of code
    d.pupil.blinks_detect()

with pp.nologging():            # temporarily silent
    d.pupil.blinks_detect()

To see detailed messages from one part of the package only:

pp.logging_disable()
pp.logger.enable("pypillometry.eyedata")

logging_set_level

Set the logging level for all pypillometry submodules.

logging_get_level

Get the current logging level for pypillometry.

logging_disable

Disable logging for all pypillometry submodules.

logging_enable

Enable logging for all pypillometry submodules.

loglevel

Temporarily set the logging level for pypillometry submodules.

nologging

Temporarily disable logging for pypillometry submodules.