API Reference

pulse2percept is organized into the following subpackages:

implants

Different prosthetic implants, such as Argus II, Alpha-IMS, BVT-24, PRIMA, Cortivis, etc.

stimuli

Common electrical stimuli, such as charge-balanced square-wave pulse trains.

models

Computational models of the prosthetic vision, such as phosphene and neural response models.

percepts

Visual percepts and phosphenes.

datasets

Utilities to download and import datasets.

viz

Various visualization functions.

utils

Various utility and helper functions.

topography

Visual field maps, retinotopy, and visuotopy

pulse2percept.set_debug_logging(fname='debug.log', level=10, filemode='w')[source]

Write pulse2percept’s log messages to a file

Importing pulse2percept does not configure logging: which messages are emitted, and where they go, is the application’s decision. Call this to opt in to a file-based log of pulse2percept’s own messages.

Note that this configures the pulse2percept logger only, not the root logger, so it will not capture messages from other libraries.

Parameters:
  • fname (str, optional) – File to write the log to.

  • level (int, optional) – Logging level, e.g. logging.DEBUG or logging.INFO.

  • filemode (str, optional) – 'w' to start a fresh log, 'a' to append to an existing one.

Returns:

handler – The handler that was installed. Pass it to logging.getLogger('pulse2percept').removeHandler to undo.

Return type:

logging.FileHandler

Examples

>>> import pulse2percept as p2p
>>> handler = p2p.set_debug_logging()