What’s New¶
Here we list a changelog of pyprep
.
Version 0.4.3 (2023-10-27)¶
Changelog¶
Use MNE logger and ProgressBar instead of prints to display logging messages, by Mathieu Scheltienne (#112).
Clarify the use of
ref_chs
andreref_chs
for theprep_params
dict inPrepPipeline
, by Stefan Appelhoff (#137).
Bug¶
find_bad_by_ransac
now accepts channel labels (complete_chn_labs
) as a list as well, by Ole Bialas (#116).
Version 0.4.2 (2022-03-16)¶
Changelog¶
Fixing an issue in
.zenodo.json
metadata from 0.4.1.
Version 0.4.1 (2022-03-16)¶
Changelog¶
Version 0.4.0 (2021-10-22)¶
Changelog¶
Created a new module named
pyprep.ransac
which containsfind_bad_by_ransac
, a standalone function mirroring the previous ransac method from theNoisyChannels
class, by Yorguin Mantilla (#51)Added two attributes
PrepPipeline.noisy_channels_before_interpolation
andPrepPipeline.noisy_channels_after_interpolation
which have the detailed output of each noisy criteria, by Yorguin Mantilla (#45)Added two keys to the
PrepPipeline.noisy_channels_original
dictionary:bad_by_dropout
andbad_by_SNR
, by Yorguin Mantilla (#45)Changed RANSAC chunking logic to reduce max memory use and prefer equal chunk sizes where possible, by Austin Hurst (#44)
Changed RANSAC’s random channel sampling code to produce the same results as MATLAB PREP for the same random seed, additionally changing the default RANSAC sample size from 25% of all good channels (e.g. 15 for a 64-channel dataset with 4 bad channels) to 25% of all channels (e.g. 16 for the same dataset), by Austin Hurst (#62)
Changed RANSAC so that “bad by high-frequency noise” channels are retained when making channel predictions (provided they aren’t flagged as bad by any other metric), matching MATLAB PREP behaviour, by Austin Hurst (#64)
Added a new flag
matlab_strict
toPrepPipeline
,Reference
,NoisyChannels
, andfind_bad_by_ransac()
for optionally matching MATLAB PREP’s internal math as closely as possible, overriding areas where PyPREP attempts to improve on the original, by Austin Hurst (#70)Added a
matlab_strict
method for high-pass trend removal, exactly matching MATLAB PREP’s values ifmatlab_strict
is enabled, by Austin Hurst (#71)Added a window-wise implementation of RANSAC and made it the default method, reducing the typical RAM demands of robust re-referencing considerably, by Austin Hurst (#66)
Added max_chunk_size parameter for specifying the maximum chunk size to use for channel-wise RANSAC, allowing more control over PyPREP RAM usage, by Austin Hurst (#66)
Changed
Reference
to exclude “bad-by-SNR” channels from initial average referencing, matching MATLAB PREP behaviour, by Austin Hurst (#78)Changed
Reference
to only flag “unusable” channels (bad by flat, NaNs, or low SNR) from the first pass of noisy detection for permanent exclusion from the reference signal, matching MATLAB PREP behaviour, by Austin Hurst (#78)Added a framework for automated testing of PyPREP’s components against their MATLAB PREP counterparts (using
.mat
and.set
files generated with the matprep_artifacts script), helping verify that the two PREP implementations are numerically equivalent when matlab_strict isTrue
, by Austin Hurst (#79)Changed
NoisyChannels
to reuse the same random state for each run of RANSAC whenmatlab_strict
isTrue
, matching MATLAB PREP behaviour, by Austin Hurst (#89)Added a new argument as_dict for
get_bads()
, allowing easier retrieval of flagged noisy channels by category, by Austin Hurst (#93)Added a new argument max_iterations for
perform_reference()
androbust_reference()
, allowing the maximum number of referencing iterations to be user-configurable, by Austin Hurst (#93)Changed
robust_reference()
to ignore bad-by-dropout channels during referencing ifmatlab_strict
isTrue
, matching MATLAB PREP behaviour, by Austin Hurst (#93)Changed
robust_reference()
to allow initial bad-by-SNR channels to be used for rereferencing interpolation if no longer bad following initial average reference, matching MATLAB PREP behaviour, by Austin Hurst (#93)Added a
matlab_strict
method for bad channel interpolation, allowing for full numeric equivalence with MATLAB PREP’s robust referencing, by Austin Hurst (#96)
Bug¶
Fixed RANSAC to give consistent results with a fixed seed across different chunk sizes, by Austin Hurst and Yorguin Mantilla (#43)
Fixed “bad channel by flat” threshold in
NoisyChannels.find_bad_by_nan_flat()
to be consistent with MATLAB PREP, by Austin Hurst (#60)Changed “bad channel by deviation” and “bad channel by correlation” detection code in
NoisyChannels
to compute IQR and quantiles in the same manner as MATLAB, thus producing identical results to MATLAB PREP, by Austin Hurst (#57)Fixed a bug where EEG data was getting reshaped into RANSAC windows incorrectly (channel samples were not sequential), which was causing considerable variability and noise in RANSAC results, by Austin Hurst (#67)
Fixed RANSAC to avoid making unnecessary signal predictions for known-bad channels, matching MATLAB behaviour and reducing RAM requirements, by Austin Hurst (#72)
Fixed a bug in
NoisyChannels.find_bad_by_correlation()
that prevented it from being able to handle channels with dropouts (intermittent flat regions), by Austin Hurst (#81).Fixed
NoisyChannels
so that it always runs “bad channel by NaN” and “bad channel by flat” detection, preventing these channels from causing problems with otherNoisyChannels
methods, by Austin Hurst (#79)Fixed
Reference
so that channels are no longer excluded from final average reference calculation if they were originally bad by NaN, flat, or low SNR, by Austin Hurst (#92)
API¶
The permissible parameters for the following methods were removed and/or reordered: ransac._ransac_correlations, ransac._run_ransac, and ransac._get_ransac_pred methods, by Yorguin Mantilla (#51)
The following methods have been moved to a new module named
ransac
and are now private: NoisyChannels.ransac_correlations, NoisyChannels.run_ransac, and NoisyChannels.get_ransac_pred methods, by Yorguin Mantilla (#51)The permissible parameters for the following methods were removed and/or reordered: NoisyChannels.ransac_correlations, NoisyChannels.run_ransac, and NoisyChannels.get_ransac_pred methods, by Austin Hurst and Yorguin Mantilla (#43)
Changed the meaning of the argument channel_wise in
find_bad_by_ransac()
to mean ‘perform RANSAC across chunks of channels instead of window-wise’, from its original meaning of ‘perform channel-wise RANSAC one channel at a time’, by Austin Hurst (#66)The arguments fraction_bad and fraction_good were renamed to frac_bad and sample_prop, respectively, for
find_bad_by_ransac()
andfind_bad_by_ransac()
, by Austin Hurst (#88)The units of all user-facing EEG data attributes in
PrepPipeline
andReference
were changed from mV to Volts to better match MNE convention, by Austin Hurst (#102)
Version 0.3.1 (2020-10-10)¶
Changelog¶
It’s now possible to pass keyword arguments to the notch filter inside
PrepPipeline
; see thefilter_kwargs
parameter by Yorguin Mantilla (#40)The default filter length for the spectrum_fit method will be ’10s’ to fix memory issues, by Yorguin Mantilla (#40)
Channel types are now available from a new
ch_types_all
attribute, and non-EEG channel names are now available from a newch_names_non_eeg
attribute fromPrepPipeline
, by Yorguin Mantilla (#34)Renaming of
ch_names
attribute ofPrepPipeline
toch_names_all
, by Yorguin Mantilla (#34)It’s now possible to pass
'eeg'
toref_chs
andreref_chs
keywords to theprep_params
parameter ofPrepPipeline
to select only eeg channels for referencing, by Yorguin Mantilla (#34)PrepPipeline
will retain the non eeg channels through theraw
attribute. The eeg-only and non-eeg parts will be in raw_eeg and raw_non_eeg respectively. See theraw
attribute, by Christian O’Reilly (#34)When a ransac call needs more memory than available, pyprep will now automatically switch to a slower but less memory-consuming version of ransac, by Yorguin Mantilla (#32)
It’s now possible to pass an empty list for the
line_freqs
param inPrepPipeline
to skip the line noise removal, by Yorguin Mantilla (#29)The three main classes
PrepPipeline
,NoisyChannels
, andpyprep.Reference
now have arandom_state
parameter to set a seed that gets passed on to all their internal methods and class calls, by Stefan Appelhoff (#31)
Bug¶
Corrected inconsistency of
Reference
with the matlab version (#19), by Yorguin Mantilla (#32)Prevented an over detrending in
Reference
, by Yorguin Mantilla (#32)
API¶
Remove
noisy.py
module from thepyprep
package. Its main functionality has been migrated to the remaining modules, and the functions for FASTER have been dropped because they were out of scope, by Stefan Appelhoff (#39)
Version 0.3.0 (2020-01-04)¶
Changelog¶
Include a boolean
do_detrend
inrobust_reference()
to indicate whether detrend should be done internally or not for the use withNoisyChannels
, by Yorguin Mantilla (#9)Robust average referencing + tests, by Victor Xiang (#6)
Removing trend in the EEG data by high pass filtering and local linear regression + tests, by Aamna Lawrence (#6)
Finding noisy channels with comparable output to Matlab + tests-including test for ransac, by Aamna Lawrence (#6)
Stringing all the things together for the PREP pipeline + tests, by Victor Xiang (#6)
Finding noisy channels with comparable output to Matlab + tests-including test for ransac, by Aamna Lawrence (#6)
Finding the appropriate parameters in the MNE notch filter for implementing clean line noise functionality of Eeglab, by Aamna Lawrence (#6)
Finding the reason for the difference between the Matlab and Pyprep’s output- Probably minor differences in the filter functions and also rounding done by functions like quantile, by Victor Xiang and Aamna Lawrence (#6)
Bug¶
Prevent an undoing of the detrending in
NoisyChannels
, by Yorguin Mantilla (#9)
API¶
Oversaw modularization of PREP pipeline’s submodules and a scikit learn style
pyprep.fit
, by Adam Li (#6)Oversaw ChangeLog by Victor Xiang and Aamna Lawrence for transitioning pyprep to Version 0.3.0, by Adam Li (#6)
Version 0.2.3 (2019-02-02)¶
Doc¶
update formatting and docs and fix tags and releases post-hoc, by Stefan Appelhoff
Version 0.2.2 (2018-05-01)¶
Bug¶
mne.Epochs
index start at 0, not 1, by Stefan Appelhoff (#commit/3780abb)
Version 0.2.1 (2018-04-29)¶
Changelog¶
Add
find_bad_epochs
based on the FASTER algorithm, by Stefan Appelhoff (#commit/0fa9c06)
Version 0.1.1 (2018-04-29)¶
Changelog¶
Miscellaneous changes
Version 0.1.0 (2018-04-24)¶
Changelog¶
Initial commit: 2018-04-12
Miscellaneous changes