API Reference

pulse2percept is organized into the following subpackages:

implants

Visual prostheses, e.g. Argus II, Alpha-IMS, PRIMA, NeuroPortArray.

stimuli

Visual and electrical stimuli.

models

Computational models of prosthetic vision

percepts

Visual percepts and phosphenes.

datasets

Utilities to download and import datasets.

plotting

Figures and animations that combine multiple pulse2percept objects.

utils

Various utility and helper functions.

topography

Visual field maps, retinotopy, and visuotopy

units

Physical units used by pulse2percept.

vision

Visual scenes, residual vision, and binocular views.

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()