Changelog#

Unreleased#

Added#

  • pp.view(): overview band at the bottom (whole recording, current view; click to go there; V key, show_overview=)

  • pp.view(marks=...): layers, intervals or boolean arrays as lanes above the plots and in the overview band; K selects a set, N/P go to the next/previous mark

  • pp.view(): robust y-limits (local level ± 4 robust SDs downwards/upwards, within the data; Y key)

  • d.pupil.blinks_extend_adaptive(): extends blinks over slow openings of the lid, with margins tuned on transplanted blinks that can change over the recording (pp.signal.tune_post_margins())

  • pp.Dataset(cache=...): local studies load converted recordings from pypillometry files (ds.convert() without a folder fills it)

  • pp.Dataset(source=..., token=...): private OSF projects and figshare items (token also from a file, class attribute token_file, or from PYPILLOMETRY_OSF_TOKEN / PYPILLOMETRY_FIGSHARE_TOKEN); token= also in get_figshare_files(), fetch_figshare_file() and make_manifest()

  • d.copy_eye(), d.rename_eye(): copy or rename an eye (values, layers, scale() parameters, band limits), also as pipeline steps

  • TimescaleModel of a single eye: predict(), store() and components() accept the merged eye "mean" (a copy of that eye)

Changed behaviour#

  • remote pp.Datasets keep the recordings as pypillometry files (<path>/pypil) and delete the raw files after the conversion (keep_raw=True to keep them); converted recordings are downloaded again only with ds.download(overwrite=True)

Fixed#

  • pp.view(): time axis did not match the plots (ticks off by several seconds after the layout)

  • binocular TimescaleModel: SD of the merged eye "mean" grew without limit in long gaps of one eye (now at most that of the other eye), and was absurd in segments without data of one eye (merged eye is then the other eye)

2.4.0 (2026-12-04)#

Mostly changes to improve preprocessing. Improved Dataset to handle full studies.

Added#

  • d.pupil.mask_comb(): masks comb artifacts

  • simulation of comb artifacts: Simulation.comb()

  • TimescaleModel(d, params=...): create model with given parameters

  • binocular TimescaleModel: estimate merged eye "mean"

  • uncertainty of reconstructed samples in segments: TimescaleModel.interpolate(sd=True)

  • pp.datasets: exclusions with reasons (ds.exclude())

  • ds.preprocessed(): all recordings preprocessed

  • simpler subclasses of pp.Dataset for local study analysis

  • ds.preprocessed(n_jobs=...) (new dependency: cloudpickle)

  • dsp.preprocess_info(): what the preprocessing stored

  • pp.__version__ and --version for the command-line tools

  • rates (thresholds of the speed of the pupil) instead of velocity thresholds

  • d.local_level() robust multi-scale moving median

  • d.mask_islands(): masks short stretches of usable data

  • d.pupil.mask_transients(): masks fast changes of the pupil

  • uncertainty bands in plots where appropriate

  • TimescaleModel.store(interval=0.95): stores the limits

  • d.pupil.blinks_detect_partial(): partial blinks detection

  • d.gaze.mask_offscreen(), d.gaze.mask_divergences(): variables=, margin=

  • HTML display of datasets in notebooks

  • ds.quality_report(): quality reports of all recordings of a dataset - pp.view(colors=...)

  • ds.segments(): the segments of all recordings of a dataset

  • dsp.view(), dsp.plot(): a preprocessed recording with the raw data

  • reset_time(): d.params["time_zero"] holds the time for reference

  • d.rename_variable(), d.copy_variable()

  • pp.view(overlay_behind=...): overlays drawn behind the data

  • pp.view(overlay=...): EyeData overlays with another time axis

Changed behaviour#

  • TimescaleModel: policy="strict" by default

  • TimescaleModel.params also holds the structure of the model

  • n_jobs: the same everywhere

  • wider HTML quality report

  • wider display EyeData

Breaking changes#

  • vel_onset/vel_offset renamed to rate_onset/rate_offset

  • Dataset.preprocess(d, **kwargs) replaces Dataset.preprocessing()

  • d.pupil.blinks_detect() reworked

  • TimescaleModel: margin= is removed

  • pp.signal.detect_blinks_zero(), detect_blinks_velocity() and helper_merge_blinks() are removed

Fixed#

  • ds.download() and parallel fits crashed sometimes

  • pp.view(): the orange shading of a row shows the masks of all

  • pp.view(), tweak(): overlays are drawn on top of the data

2.3.1 (2026-12-01)#

Added#

  • pp.datasets: support for whole studies

  • open datasets:

    • "robison2022": Robison & Brewer (2022)

    • "rlmw": reinforcement learning and mind wandering

  • get_osf_project_files(): the md5 and sha256 checksums of each file

  • d.mask_signal(): mask the data based on a quality signal

  • MaskPolicy: "*" stands for all layers, exclude= leaves layers out

  • EyeData.aux: additional channels

  • d.plot.plot_timeseries() and d.plot.plot_pupil_covariate() plot channels in d.aux

  • pp.view(d, variables=[...]) also shows channels in d.aux

  • d.plot.plot_timeseries_segments(): channels in d.aux in variables

  • Example datasets robison_pxb, robison_pvt, robison_cd

  • d.plot.plot_timeseries(show_layers=True)

  • pp.view(d, overlay={key: array}): overlay plain arrays

  • pp.view(d, show_layers=True)

  • EyeData.from_gazepoint(camera=True)

Changed behaviour#

  • the HTML display of data objects in notebooks is more compact

  • the mask policies "default" and "strict" mask all layers except "interpolated"

  • d.gaze.mask_divergences(store_as=...) stores the distance in d.aux

  • file format 4 (adds aux)

  • d.plot.plot_masked() shows each mask layer

  • new dependency: pooch (downloads)

  • removed load_study_local() etc

  • read_gazepoint(), EyeData.from_gazepoint()

Fixed#

  • TimescaleModel.fit(), fit_bank(): fix occasional RuntimeError

  • pp.view(d, variables=[...]): variables of the eyes other than pupil, x and y

  • d.pupil.blinks_interpolate() (Mahot): bugfix

2.3.0 (2026-11-26)#

Added#

Timescale model (experimental):

  • pp.TimescaleModel: state-space model of the pupil

  • TimescaleModel.interpolate(), .predict(), .store()

  • pp.TimescaleModel(d, binocular=True)

  • TimescaleModel.fit(n_jobs=, progress=)

  • TimescaleModel.simulate(), .process()

  • pp.TimescaleGroup: group-level fit

Simulated data:

  • pp.sim: simulated recordings (slow and fast components using TimeScaleModel)

  • pp.sim.Task: task designs

  • pp.sim.Blinks (occlusion model)

  • pp.sim.TrackerLoss

Reading data:

  • EyeData.from_gazepoint(), read_gazepoint(): read recordings of GazePoint eye trackers

Signal processing:

  • d.pupil.spectrum(), d.plot.plot_pupil_spectrum()

  • pp.signal.gaussmarkov: TimescaleBank, fit_bank(), fit_group(), general_prior(), Constant component, noise variance per sample, segments and diffuse states in the Kalman filter

Fixed#

  • fill_time_discontinuities() left out one sample in some gaps

  • pp.signal.velocity_savgol(direction="backward"/"forward") fixed

Changed behaviour#

  • pupil.blinks_detect(): better default velocity thresholds

  • pupil.blinks_interpolate(method="mahot"): better default thresholds

Breaking changes#

  • FakeEyeData and pp.signal.fake were removed

  • numba is now a dependency

2.2.4 (2026-11-24)#

  • d.pupil.blinks_optimize_parameters(): autotune the parameters of blinks_interpolate()

  • pp.tweak_blink_interpolation(): tweak the parameters of blinks_interpolate()

  • d.plot.plot_blink_clusters(): the detected blinks in groups of similar shape, to spot bad detections

  • pp.view(..., overlay=): support other EyeData objects

  • pp.view(), pp.tweak(): also work with PySide6

  • pp.signal.transplant_blinks() and related functions

Changed behaviour#

  • blinks_interpolate(method="kalman"): replaces a margin around the core of each blink

  • blinks_detect(): max_duration (now 2 s) applies to all blinks

  • blinks_interpolate() (Mahot): blinks are only merged if they overlap

  • blinks_interpolate() (Mahot): stretches longer than max_duration (2 s) are skipped

  • dependency: PySide6 instead of PyQt5

2.2.3 (2026-11-19)#

  • blinks_interpolate(method="kalman"): new interpolation method based on Kalman filter

  • blinks_interpolate(): change parameter handling to allow multiple methods

  • blinks_detect(): vel_onset_min_duration and vel_offset_min_duration default to 10 ms (was 5 ms)

  • blinks_detect(): a velocity onset without its own offset no longer takes the offset of the next blink

  • blinks_detect(margin=...): extend the detected blinks on each side, e.g. to include the transient

  • blinks_interpolate(): the Mahot method now searches for transient onsets in the whole window

2.2.2 (2026-11-11)#

  • HeadMountedEyeData: data from eye-tracking glasses

  • HeadMountedEyeData.from_tobii_prolab(), read_tobii_prolab(): read data exports of Tobii Pro Lab (Tobii Pro Glasses 3)

  • d.scene functions to analyze scene from video

  • d.plot.plot_scene_scanpath(): scanpath on a frame of the scene video

  • d.scene.render_video(): write the scene video with the gaze position drawn on it

  • d.plot.plot_timeseries() of HeadMountedEyeData also plots channels in d.aux (e.g. variables=["pupil", "luminance", "gyro"])

  • d.plot.plot_pupil_covariate(): pupil size against a channel in d.aux

  • pp.view() and pp.tweak() start much faster

2.2.1 (2026-11-10)#

  • Events.merge_table() and Epochs.merge_table(): add the columns of a behaviour log

  • figshare support

  • Example dataset nback_001 + case study

  • All plotting functions follow the same conventions

Breaking changes#

  • pupil_plot() is plot_pupil(), pupil_plot_segments() is plot_pupil_segments()

  • Plotting homogenized

2.2.0 (2026-11-10)#

This version is a major refactor of the package without changing functionality (many bugs fixed, though). Scripts will need update to the new syntax.

Breaking changes#

  • One data class, EyeData instead of per modality, pupil methods are in d.pupil, gaze methods in d.gaze

  • similarly, plotter classes (EyePlotter, PupilPlotter, GazePlotter) were removed

  • Mask layers: multiple layers for reasons data may be masked

  • Plain numbers are ms everywhere

  • get_intervals() and get_epochs(event, window)

  • GenericEyeData removed

  • SegmentedEyeData.intervals is SegmentedEyeData.epochs

  • SegmentedEyeData holds several channels

  • GroupLevelSegmentedData was removed

  • scale()/unscale(): center=/scale=

  • The functions for numpy arrays are only in pp.signal

  • merge_intervals() is concat_intervals()

  • Intervals.plot_highlight() was removed; the plots shade intervals with highlight=

  • downsample() stores the actual sampling rate (fs/factor)

  • Gaze plots (heatmap, scanpath) draw y downward (screen pixels)

  • The time axis of all plots is in seconds by default

  • nblinks() was removed (use blink_stats() or layer_stats())

Added#

  • scale(method=...) for common transformations

  • seg.pupil.baseline_correct(method=...)

  • faster import pypillometry

  • Namespaces d.pupil, d.gaze and d.plot

  • Segments of several channels share their epochs

  • seg.gaze for regions of interest: roi_hits()

  • User guide page “Regions of interest”

  • seg.average(by=...) averages all trials or groups of them - concat_segments()

  • Pipelines with pipe operator: d | pp.pupil.blinks_detect()

  • Mask layers per channel

  • pp.MaskPolicy to decide which samples to mask

  • pp.Epochs (event-locked windows)

  • Warning for events on another clock

  • Events.onset(label) find onset of a special event

  • highlight= and highlight_color= in pupil_plot

  • pypil-upgrade: converts saved files to the current format

  • d.plot.plot_masked(policy=...) to show the interpolated stretches

  • "<start>" and "<end>" for interval selectors

  • d.layer_stats(): stats for each mask layer per channel

  • pp.Table and pp.RecordDict

  • seg.plot_carpet(): all segments of a channel as an image

Fixed#

  • from_eyelink() with non-English day and month names

  • Download progress bars hidden in pp.nologging()

  • fs after downsample did not match the time vector

  • reset_time did not shift blinks stored in time units

  • FakeEyeData.sim_data was not cut or downsampled

  • Masks only grew: re-running a detector added to the old mask

  • Experimental setup and calibration were sometimes lost

  • plot_heatmap(show_masked=True) with NaN samples

  • A plot_range with start after end raises an error

  • The sample at the end of plot_range was not plotted

  • scale() twice then unscale() left the data scaled

  • pypilview --eyes right FILE took the file for an eye

  • CircularROI.from_degrees/RectangularROI.from_degrees

  • pypillometry.viewer.tweak (the function) was replaced by its submodule

  • pupil.estimate_response(eyes=...) removed parameters

  • pupil.estimate_response() on data without events raises a ValueError

  • pp.nologging() could leave logging disabled

  • summary(), Intervals.stats() return Python numbers

  • pupil.blinks_detect() with an unknown strategy

  • crop() with start after end or outside the data

  • Re-running pupil.blinks_detect() after pupil.blinks_interpolate() found no blinks (it read the interpolated values) and cleared the blink layer

2.1.0 (2026-11-02)#

Breaking changes#

  • EyeData.get_pupildata() was removed, use to_pupildata()

  • Events now need time units, sample indices are units="samples"

  • Converting Intervals between sample indices and time now requires the data

  • sub_slice() was renamed to crop(); sub_slice() is a deprecated alias

  • get_intervals(), stat_per_event(): interval was renamed to window

Added#

  • EyeData.to_pupildata() and to_gazedata()

  • quality_report(): data-quality measures

  • Default quality thresholds based on reference data from six datasets

  • pypilinfo --quality/--html/--descriptions: quality reports

  • HDF5 files: write_file()/write_pickle() write HDF5 if filename ends .h5

  • Excluded periods (e.g., breaks, calibration): exclude_intervals()

  • remove_intervals(): remove periods (e.g., breaks)

  • get_intervals(): "<start>" and "<end>"

  • Events from behaviour logs: Events.from_table()

  • sync_clocks() (fits offset and drift between clocks)

  • Event metadata (e.g., trial, condition, reaction time):

  • get_intervals() passes the metadata

Changed#

  • pupil_estimate_response() does not use excluded periods and NaN samples for the fit; events with less than min_valid (default 0.5) of their response outside them are left out (coefficient NaN)

  • get_intervals() with two events pairs each first event with the next second event (e.g., ("End Block", "Start Block") gives the breaks)

  • Saved files (pickle and HDF5) contain a versioned state of the object. Files from earlier versions are upgraded when they are read.

Fixed#

  • pupil_estimate_response() uses more efficient solver

  • downsample() respects masked samples

  • set_events() stored onsets of Events with units=None as ms

  • Segments of index intervals that are not event-locked wrong time

  • plot_intervals() with index intervals mixed sample indices and ms

2.0.0 (2026-10-28)#

Breaking changes#

  • Python 3.11 or newer is required.

  • inplace=None now follows the object setting.

  • fill_time_discontinuities() fills gaps with NaN (was 0), so filled-in samples are masked for all variables, not only pupil.

  • apply_history() was removed

  • ExperimentalSetup.degrees_to_mm() take plain numbers as degrees

  • Positive y is up in all mm coordinates

  • new module pp.study hosting all study-related io functions

  • Internal helpers no longer exported at the top level

  • blinks_merge_close() defaults to apply_mask=False (returns the merged blinks), like pupil_blinks_detect()

  • nprange, p_asym_laplac, p_asym_laplac_kappa and trans_logistic_vec are no longer exported at the top level (still in pp.convenience)

  • stat_event_interval is no longer exported at the top level (use stat_per_event())

  • pint is no longer used, replaced by units.py

Added#

  • files are now saved with compression by default

  • pypilinfo command prints a summary of EDF or pickle files

  • Times with units (units= can be omitted)

  • pp.parse_time() converts times with units

  • pp.set_default_inplace() and pp.get_default_inplace(): package-level default for inplace (initially True).

  • detect_blinks_zero() accepts blink_val=np.nan to detect runs of NaN.

  • Reading from SSH URLs (ssh://[user@]host[:port]/path)

  • pypilview: interactive viewer EDF file stored pypil object

Changed#

  • read_pickle() saves HTTP(S) downloads to a file (temporary by default)

  • Packaging moved from setup.py/requirements.txt to pyproject.toml.

  • Top-level imports are static, so IDEs can complete and resolve pp.*.

  • detect_blinks_velocity(): velocity runs with exactly min_onset_len/ min_offset_len samples are accepted (was: must be longer)

  • interpolate_intervals(margin=...) uses the sign of margin (relative to start/end of the interval); margin[0] > 0 or margin[1] < 0 raise an error

  • get_example_data() caches downloaded datasets in ~/.cache/pypillometry (or cache_dir) instead of downloading them on every call

Fixed#

  • pp.signal and pp.logging were scipy.signal and the standard-library logging instead of the package’s own submodules.

  • fill_time_discontinuities(): samples between two gaps were dropped, so time and data had different lengths

  • pupil_blinks_detect(): the “zero” strategy never detected blinks

  • stat_per_event() gave wrong results for intervals not in ms

  • group_segments()/GroupLevelSegmentedData.from_segments() dropped masks

  • stat_per_event() ignored masks

  • SegmentedEyeData.plot()/GroupLevelSegmentedData.plot() warn if meanfct or varfct ignore masks (e.g., np.median)

  • meanfct/varfct without an axis argument raise an error

  • scale() computed mean and SD including masked samples

  • fit_foreshortening() used masked samples for fitting

  • GazeData.summary() was missing the eyes entry

  • ExperimentalSetup: parse string (e.g. "30 deg")

  • test_selector() raised a NameError fixed

  • sub_slice() dropped all masks and did not shift stored blinks

  • downsample() dropped all masks and did not rescale stored blinks

  • fill_time_discontinuities() called after creation dropped all masks

  • History: internal calls no longer recorded, setters are now recorded

  • get_intervals() between two events fixed

  • set_experimental_setup() lost the eye-to-screen distance when updating other parameters

  • plot_heatmap()/plot_scanpath() with a single eye as string

  • get_example_data("rlmw_010_edf") failed (loader was missing)

  • detect_blinks_zero() missed runs at the start/end of the signal

  • pupil_estimate_baseline() raises a clear error for data with NaN

  • EyeDataDict.copy() kept only masks for NaN values

  • fit_foreshortening(intervals=...) treated all intervals as ms

  • view() of raw arrays without time

  • baseline_pupil_model() used a 4 ms instead of a 4 s response kernel

  • pupil_blinks_interpolate() left blinks NaN when the anchor points fell into a neighbouring blink; such blinks are now merged

  • merge_eyes()/pupil_merge_eyes(): samples masked in all eyes lost their values (0 or NaN, e.g., interpolated blinks)

  • blink_onsets_mahot() (used by pupil_blinks_interpolate()) searched the offset too late for blinks near the start of the data

  • PupilData.from_eyelink()/GazeData.from_eyelink() raised a TypeError

  • Intervals.plot_highlight(zorder=...) raised a TypeError

  • Intervals.stats() raised a ValueError for empty intervals

  • Intervals repr showed “None” as unit for index intervals

  • Intervals.from_mask(units=...) labelled sample indices with time units without converting them

  • view(highlight=...): index intervals failed for raw arrays and were converted although the x-axis is in samples; the passed Intervals were modified

  • plot_intervals(show_mask=True) showed only the mask of the last eye/variable

  • plot_masked(units=None, show_events=True) drew events in ms on an index axis

  • plot_timeseries_segments(ylim=...)/pupil_plot_segments(ylim=...) set the limits only for the last subplot

  • scale() rejected integers and unscale() rejected numbers for mean/sd

  • ExperimentalSetup.mm_to_pixels() without screen size raised a TypeError instead of a clear ValueError

  • ExperimentalSetup.from_dict() warned about plain numbers for stored values

  • detect_blinks_velocity() raised a ValueError if no sample was valid

  • detect_blinks_velocity(): blinks without offset ended one past the last sample (other offsets are inclusive)

  • fake_gaze_fixations() left trailing samples at (0, 0) when the fixations were shorter than duration

  • pupil_kernel() was sampled slightly slower than fs (spacing duration/(n-1))

  • interpolate_intervals() used masked samples (e.g., other blinks) as anchor points

  • get_available_eyes()/get_available_variables() returned eyes/variables in random order; now in the order they were added

  • read_pickle()/read_eyelink() of URLs without cache_file/cache_dir left the temporary download directory behind

  • load_study_osf() printed to stdout instead of logging and showed the download size only with force_download=True

  • Example datasets: missing spaces in descriptions; “rlmw_002” was named “test short”

  • pupil_response() with free npar and tmax passed the unsupported disp option to scipy (OptimizeWarning); progress is now logged

  • Stan baseline: the model was set up on every call and could not be compiled in a read-only install; results were not reproducible (new seed argument)

  • tweak(): “?” did not open the help

  • nblinks() was annotated as returning int (returns a dict)

  • get_segments(): the number of samples per segment depended on the timing of the first event, so group_segments() could fail

  • ExperimentalSetup.screen_point_to_eye_frame(): tilting the screen moved its center towards the eye (z was d*cos(pitch)*cos(yaw) instead of d)

  • pupil_blinks_interpolate() skipped blinks without a velocity drop before them, leaving NaNs in the data

  • SegmentedEyeData.baseline_correct(), Events.filter() and plot_timeseries_segments(interv=...) failed with units

  • plot_experimental_setup(calibration=...), set_experimental_setup() (updating an existing setup) and fit_foreshortening() gave spurious warnings

  • tweak() showed a wrong time axis until the view was zoomed

  • repr() of FakeEyeData was garbled; summaries and pypilinfo print rounded numbers

  • API signatures showed units=<object object>

Documentation#

  • Updated website to a more modern feel.

  • Updated docstrings across the package (eyedata classes, signal, plotting, intervals, io, viewer, experimental setup).

  • Fixed broken links, references and markup in the docs and notebooks.

  • Docs workflow pinned to Python 3.13.