diff --git a/MANIFEST.in b/MANIFEST.in index 612153d940d..be164882d8a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -89,3 +89,6 @@ recursive-exclude mne/io/brainvision/tests/data * recursive-exclude mne/io/egi/tests/data * recursive-exclude mne/io/nicolet/tests/data * recursive-exclude mne/preprocessing/tests/data * + +# Type stubs +recursive-include mne *.pyi diff --git a/mne/__init__.py b/mne/__init__.py index 97cbedb6de5..ab660592627 100644 --- a/mne/__init__.py +++ b/mne/__init__.py @@ -28,276 +28,7 @@ __version__ = "0.0.0" -__getattr__, __dir__, __all__ = lazy.attach( - __name__, - submodules=[ - "beamformer", - "channels", - "chpi", - "commands", - "coreg", - "cuda", - "datasets", - "decoding", - "defaults", - "dipole", - "epochs", - "event", - "export", - "filter", - "forward", - "gui", - "inverse_sparse", - "io", - "minimum_norm", - "preprocessing", - "report", - "source_space", - "simulation", - "stats", - "surface", - "time_frequency", - "viz", - ], - submod_attrs={ - "_freesurfer": [ - "get_volume_labels_from_aseg", - "head_to_mni", - "head_to_mri", - "read_freesurfer_lut", - "read_lta", - "read_talxfm", - "vertex_to_mni", - ], - "annotations": [ - "Annotations", - "annotations_from_events", - "count_annotations", - "events_from_annotations", - "read_annotations", - ], - "bem": [ - "make_bem_model", - "make_bem_solution", - "make_sphere_model", - "read_bem_solution", - "read_bem_surfaces", - "write_bem_solution", - "write_bem_surfaces", - "write_head_bem", - ], - "channels": [ - "equalize_channels", - "rename_channels", - "find_layout", - "read_vectorview_selection", - ], - "coreg": [ - "create_default_subject", - "scale_bem", - "scale_labels", - "scale_mri", - "scale_source_space", - ], - "cov": [ - "Covariance", - "compute_covariance", - "compute_raw_covariance", - "make_ad_hoc_cov", - "read_cov", - "whiten_evoked", - "write_cov", - ], - "dipole": [ - "Dipole", - "DipoleFixed", - "fit_dipole", - "read_dipole", - ], - "epochs": [ - "BaseEpochs", - "Epochs", - "EpochsArray", - "concatenate_epochs", - "make_fixed_length_epochs", - "read_epochs", - ], - "event": [ - "AcqParserFIF", - "concatenate_events", - "count_events", - "find_events", - "find_stim_steps", - "make_fixed_length_events", - "merge_events", - "pick_events", - "read_events", - "write_events", - ], - "evoked": [ - "Evoked", - "EvokedArray", - "combine_evoked", - "read_evokeds", - "write_evokeds", - ], - "forward": [ - "Forward", - "apply_forward_raw", - "apply_forward", - "average_forward_solutions", - "convert_forward_solution", - "make_field_map", - "make_forward_dipole", - "make_forward_solution", - "read_forward_solution", - "use_coil_def", - "write_forward_solution", - ], - "io": [ - "read_epochs_fieldtrip", - "read_evoked_besa", - "read_evoked_fieldtrip", - "read_evokeds_mff", - ], - "io.base": [ - "concatenate_raws", - "match_channel_orders", - ], - "io.eeglab": [ - "read_epochs_eeglab", - ], - "io.kit": [ - "read_epochs_kit", - ], - "_fiff.meas_info": [ - "Info", - "create_info", - ], - "_fiff.pick": [ - "channel_indices_by_type", - "channel_type", - "pick_channels_cov", - "pick_channels_forward", - "pick_channels_regexp", - "pick_channels", - "pick_info", - "pick_types_forward", - "pick_types", - ], - "_fiff.proj": [ - "Projection", - ], - "_fiff.reference": [ - "add_reference_channels", - "set_bipolar_reference", - "set_eeg_reference", - ], - "_fiff.what": [ - "what", - ], - "label": [ - "BiHemiLabel", - "grow_labels", - "label_sign_flip", - "Label", - "labels_to_stc", - "morph_labels", - "random_parcellation", - "read_label", - "read_labels_from_annot", - "split_label", - "stc_to_label", - "write_label", - "write_labels_to_annot", - ], - "misc": [ - "parse_config", - "read_reject_parameters", - ], - "morph_map": [ - "read_morph_map", - ], - "morph": [ - "SourceMorph", - "compute_source_morph", - "grade_to_vertices", - "read_source_morph", - ], - "proj": [ - "compute_proj_epochs", - "compute_proj_evoked", - "compute_proj_raw", - "read_proj", - "sensitivity_map", - "write_proj", - ], - "rank": [ - "compute_rank", - ], - "report": [ - "Report", - "open_report", - ], - "source_estimate": [ - "MixedSourceEstimate", - "MixedVectorSourceEstimate", - "SourceEstimate", - "VectorSourceEstimate", - "VolSourceEstimate", - "VolVectorSourceEstimate", - "extract_label_time_course", - "grade_to_tris", - "read_source_estimate", - "spatial_dist_adjacency", - "spatial_inter_hemi_adjacency", - "spatial_src_adjacency", - "spatial_tris_adjacency", - "spatio_temporal_dist_adjacency", - "spatio_temporal_src_adjacency", - "spatio_temporal_tris_adjacency", - "stc_near_sensors", - ], - "source_space._source_space": [ - "SourceSpaces", - "add_source_space_distances", - "get_volume_labels_from_src", - "morph_source_spaces", - "read_source_spaces", - "setup_source_space", - "setup_volume_source_space", - "write_source_spaces", - ], - "surface": [ - "decimate_surface", - "dig_mri_distances", - "get_head_surf", - "get_meg_helmet_surf", - "get_montage_volume_labels", - "read_surface", - "read_tri", - "write_surface", - ], - "transforms": [ - "Transform", - "read_trans", - "transform_surface_to", - "write_trans", - ], - "utils": [ - "get_config_path", - "get_config", - "grand_average", - "open_docs", - "set_cache_dir", - "set_config", - "set_memmap_min_size", - "sys_info", - "use_log_level", - "verbose", - ], - }, -) +__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__) # initialize logging from .utils import set_log_level, set_log_file diff --git a/mne/__init__.pyi b/mne/__init__.pyi new file mode 100644 index 00000000000..8ba92be54df --- /dev/null +++ b/mne/__init__.pyi @@ -0,0 +1,309 @@ +from . import beamformer as beamformer + +from . import channels as channels + +from . import chpi as chpi + +from . import commands as commands + +from . import coreg as coreg + +from . import cuda as cuda + +from . import datasets as datasets + +from . import decoding as decoding + +from . import defaults as defaults + +from . import dipole as dipole + +from . import epochs as epochs + +from . import event as event + +from . import export as export + +from . import filter as filter + +from . import forward as forward + +from . import gui as gui + +from . import inverse_sparse as inverse_sparse + +from . import io as io + +from . import minimum_norm as minimum_norm + +from . import preprocessing as preprocessing + +from . import report as report + +from . import source_space as source_space + +from . import simulation as simulation + +from . import stats as stats + +from . import surface as surface + +from . import time_frequency as time_frequency + +from . import viz as viz + +from ._freesurfer import ( + get_volume_labels_from_aseg as get_volume_labels_from_aseg, + head_to_mni as head_to_mni, + head_to_mri as head_to_mri, + read_freesurfer_lut as read_freesurfer_lut, + read_lta as read_lta, + read_talxfm as read_talxfm, + vertex_to_mni as vertex_to_mni, +) + +from .annotations import ( + Annotations as Annotations, + annotations_from_events as annotations_from_events, + count_annotations as count_annotations, + events_from_annotations as events_from_annotations, + read_annotations as read_annotations, +) + +from .bem import ( + make_bem_model as make_bem_model, + make_bem_solution as make_bem_solution, + make_sphere_model as make_sphere_model, + read_bem_solution as read_bem_solution, + read_bem_surfaces as read_bem_surfaces, + write_bem_solution as write_bem_solution, + write_bem_surfaces as write_bem_surfaces, + write_head_bem as write_head_bem, +) + +from .channels import ( + equalize_channels as equalize_channels, + rename_channels as rename_channels, + find_layout as find_layout, + read_vectorview_selection as read_vectorview_selection, +) + +from .coreg import ( + create_default_subject as create_default_subject, + scale_bem as scale_bem, + scale_labels as scale_labels, + scale_mri as scale_mri, + scale_source_space as scale_source_space, +) + +from .cov import ( + Covariance as Covariance, + compute_covariance as compute_covariance, + compute_raw_covariance as compute_raw_covariance, + make_ad_hoc_cov as make_ad_hoc_cov, + read_cov as read_cov, + whiten_evoked as whiten_evoked, + write_cov as write_cov, +) + +from .dipole import ( + Dipole as Dipole, + DipoleFixed as DipoleFixed, + fit_dipole as fit_dipole, + read_dipole as read_dipole, +) + +from .epochs import ( + BaseEpochs as BaseEpochs, + Epochs as Epochs, + EpochsArray as EpochsArray, + concatenate_epochs as concatenate_epochs, + make_fixed_length_epochs as make_fixed_length_epochs, + read_epochs as read_epochs, +) + +from .event import ( + AcqParserFIF as AcqParserFIF, + concatenate_events as concatenate_events, + count_events as count_events, + find_events as find_events, + find_stim_steps as find_stim_steps, + make_fixed_length_events as make_fixed_length_events, + merge_events as merge_events, + pick_events as pick_events, + read_events as read_events, + write_events as write_events, +) + +from .evoked import ( + Evoked as Evoked, + EvokedArray as EvokedArray, + combine_evoked as combine_evoked, + read_evokeds as read_evokeds, + write_evokeds as write_evokeds, +) + +from .forward import ( + Forward as Forward, + apply_forward_raw as apply_forward_raw, + apply_forward as apply_forward, + average_forward_solutions as average_forward_solutions, + convert_forward_solution as convert_forward_solution, + make_field_map as make_field_map, + make_forward_dipole as make_forward_dipole, + make_forward_solution as make_forward_solution, + read_forward_solution as read_forward_solution, + use_coil_def as use_coil_def, + write_forward_solution as write_forward_solution, +) + +from .io import ( + read_epochs_fieldtrip as read_epochs_fieldtrip, + read_evoked_besa as read_evoked_besa, + read_evoked_fieldtrip as read_evoked_fieldtrip, + read_evokeds_mff as read_evokeds_mff, +) + +from .io.base import ( + concatenate_raws as concatenate_raws, + match_channel_orders as match_channel_orders, +) + +from .io.eeglab import read_epochs_eeglab as read_epochs_eeglab + +from .io.kit import read_epochs_kit as read_epochs_kit + +from ._fiff.meas_info import ( + Info as Info, + create_info as create_info, +) + +from ._fiff.pick import ( + channel_indices_by_type as channel_indices_by_type, + channel_type as channel_type, + pick_channels_cov as pick_channels_cov, + pick_channels_forward as pick_channels_forward, + pick_channels_regexp as pick_channels_regexp, + pick_channels as pick_channels, + pick_info as pick_info, + pick_types_forward as pick_types_forward, + pick_types as pick_types, +) + +from ._fiff.proj import Projection as Projection + +from ._fiff.reference import ( + add_reference_channels as add_reference_channels, + set_bipolar_reference as set_bipolar_reference, + set_eeg_reference as set_eeg_reference, +) + +from ._fiff.what import what as what + +from .label import ( + BiHemiLabel as BiHemiLabel, + grow_labels as grow_labels, + label_sign_flip as label_sign_flip, + Label as Label, + labels_to_stc as labels_to_stc, + morph_labels as morph_labels, + random_parcellation as random_parcellation, + read_label as read_label, + read_labels_from_annot as read_labels_from_annot, + split_label as split_label, + stc_to_label as stc_to_label, + write_label as write_label, + write_labels_to_annot as write_labels_to_annot, +) + +from .misc import ( + parse_config as parse_config, + read_reject_parameters as read_reject_parameters, +) + +from .morph_map import read_morph_map as read_morph_map + +from .morph import ( + SourceMorph as SourceMorph, + compute_source_morph as compute_source_morph, + grade_to_vertices as grade_to_vertices, + read_source_morph as read_source_morph, +) + +from .proj import ( + compute_proj_epochs as compute_proj_epochs, + compute_proj_evoked as compute_proj_evoked, + compute_proj_raw as compute_proj_raw, + read_proj as read_proj, + sensitivity_map as sensitivity_map, + write_proj as write_proj, +) + +from .rank import compute_rank as compute_rank + +from .report import ( + Report as Report, + open_report as open_report, +) + +from .source_estimate import ( + MixedSourceEstimate as MixedSourceEstimate, + MixedVectorSourceEstimate as MixedVectorSourceEstimate, + SourceEstimate as SourceEstimate, + VectorSourceEstimate as VectorSourceEstimate, + VolSourceEstimate as VolSourceEstimate, + VolVectorSourceEstimate as VolVectorSourceEstimate, + extract_label_time_course as extract_label_time_course, + grade_to_tris as grade_to_tris, + read_source_estimate as read_source_estimate, + spatial_dist_adjacency as spatial_dist_adjacency, + spatial_inter_hemi_adjacency as spatial_inter_hemi_adjacency, + spatial_src_adjacency as spatial_src_adjacency, + spatial_tris_adjacency as spatial_tris_adjacency, + spatio_temporal_dist_adjacency as spatio_temporal_dist_adjacency, + spatio_temporal_src_adjacency as spatio_temporal_src_adjacency, + spatio_temporal_tris_adjacency as spatio_temporal_tris_adjacency, + stc_near_sensors as stc_near_sensors, +) + +from .source_space._source_space import ( + SourceSpaces as SourceSpaces, + add_source_space_distances as add_source_space_distances, + get_volume_labels_from_src as get_volume_labels_from_src, + morph_source_spaces as morph_source_spaces, + read_source_spaces as read_source_spaces, + setup_source_space as setup_source_space, + setup_volume_source_space as setup_volume_source_space, + write_source_spaces as write_source_spaces, +) + +from .surface import ( + decimate_surface as decimate_surface, + dig_mri_distances as dig_mri_distances, + get_head_surf as get_head_surf, + get_meg_helmet_surf as get_meg_helmet_surf, + get_montage_volume_labels as get_montage_volume_labels, + read_surface as read_surface, + read_tri as read_tri, + write_surface as write_surface, +) + +from .transforms import ( + Transform as Transform, + read_trans as read_trans, + transform_surface_to as transform_surface_to, + write_trans as write_trans, +) + +from .utils import ( + get_config_path as get_config_path, + get_config as get_config, + grand_average as grand_average, + open_docs as open_docs, + set_cache_dir as set_cache_dir, + set_config as set_config, + set_memmap_min_size as set_memmap_min_size, + sys_info as sys_info, + use_log_level as use_log_level, + verbose as verbose, +) diff --git a/mne/io/__init__.py b/mne/io/__init__.py index b6261e9a688..dbf21742549 100644 --- a/mne/io/__init__.py +++ b/mne/io/__init__.py @@ -7,61 +7,7 @@ import lazy_loader as lazy -__getattr_lz__, __dir__, __all__ = lazy.attach( - __name__, - submodules=[ - "constants", - "pick", - # Remove these three in 1.6 along with their .py files - "proj", - "meas_info", - "reference", - ], - submod_attrs={ - "base": ["BaseRaw", "concatenate_raws", "match_channel_orders"], - "array": ["RawArray"], - "besa": ["read_evoked_besa"], - "brainvision": ["read_raw_brainvision"], - "bti": ["read_raw_bti"], - "cnt": ["read_raw_cnt"], - "ctf": ["read_raw_ctf"], - "curry": ["read_raw_curry"], - "edf": ["read_raw_edf", "read_raw_bdf", "read_raw_gdf"], - "egi": ["read_raw_egi", "read_evokeds_mff"], - "kit": ["read_raw_kit", "read_epochs_kit"], - "fiff": ["read_raw_fif", "Raw"], - "fil": ["read_raw_fil"], - "nedf": ["read_raw_nedf"], - "nicolet": ["read_raw_nicolet"], - "artemis123": ["read_raw_artemis123"], - "eeglab": ["read_raw_eeglab", "read_epochs_eeglab"], - "eximia": ["read_raw_eximia"], - "hitachi": ["read_raw_hitachi"], - "nirx": ["read_raw_nirx"], - "boxy": ["read_raw_boxy"], - "snirf": ["read_raw_snirf"], - "persyst": ["read_raw_persyst"], - "fieldtrip": [ - "read_raw_fieldtrip", - "read_epochs_fieldtrip", - "read_evoked_fieldtrip", - ], - "nihon": ["read_raw_nihon"], - "nsx": ["read_raw_nsx"], - "_read_raw": ["read_raw"], - "eyelink": ["read_raw_eyelink"], - "_fiff_wrap": [ - "read_info", - "write_info", - "anonymize_info", - "read_fiducials", - "write_fiducials", - "show_fiff", - "get_channel_type_constants", - ], - }, -) - +__getattr_lz__, __dir__, __all__ = lazy.attach_stub(__name__, __file__) # Remove in 1.6 and change __getattr_lz__ to __getattr__ from ..utils import warn as _warn diff --git a/mne/io/__init__.pyi b/mne/io/__init__.pyi new file mode 100644 index 00000000000..2bbde21ec59 --- /dev/null +++ b/mne/io/__init__.pyi @@ -0,0 +1,99 @@ +from . import constants as constants + +from . import pick as pick + +from . import proj as proj + +from . import meas_info as meas_info + +from . import reference as reference + +from .base import ( + BaseRaw as BaseRaw, + concatenate_raws as concatenate_raws, + match_channel_orders as match_channel_orders, +) + +from .array import RawArray as RawArray + +from .besa import read_evoked_besa as read_evoked_besa + +from .brainvision import read_raw_brainvision as read_raw_brainvision + +from .bti import read_raw_bti as read_raw_bti + +from .cnt import read_raw_cnt as read_raw_cnt + +from .ctf import read_raw_ctf as read_raw_ctf + +from .curry import read_raw_curry as read_raw_curry + +from .edf import ( + read_raw_edf as read_raw_edf, + read_raw_bdf as read_raw_bdf, + read_raw_gdf as read_raw_gdf, +) + +from .egi import ( + read_raw_egi as read_raw_egi, + read_evokeds_mff as read_evokeds_mff, +) + +from .kit import ( + read_raw_kit as read_raw_kit, + read_epochs_kit as read_epochs_kit, +) + +from .fiff import ( + read_raw_fif as read_raw_fif, + Raw as Raw, +) + +from .fil import read_raw_fil as read_raw_fil + +from .nedf import read_raw_nedf as read_raw_nedf + +from .nicolet import read_raw_nicolet as read_raw_nicolet + +from .artemis123 import read_raw_artemis123 as read_raw_artemis123 + +from .eeglab import ( + read_raw_eeglab as read_raw_eeglab, + read_epochs_eeglab as read_epochs_eeglab, +) + +from .eximia import read_raw_eximia as read_raw_eximia + +from .hitachi import read_raw_hitachi as read_raw_hitachi + +from .nirx import read_raw_nirx as read_raw_nirx + +from .boxy import read_raw_boxy as read_raw_boxy + +from .snirf import read_raw_snirf as read_raw_snirf + +from .persyst import read_raw_persyst as read_raw_persyst + +from .fieldtrip import ( + read_raw_fieldtrip as read_raw_fieldtrip, + read_epochs_fieldtrip as read_epochs_fieldtrip, + read_evoked_fieldtrip as read_evoked_fieldtrip, +) + +from .nihon import read_raw_nihon as read_raw_nihon + +from .nsx import read_raw_nsx as read_raw_nsx + +from ._read_raw import read_raw as read_raw + +from .eyelink import read_raw_eyelink as read_raw_eyelink + +from ._fiff_wrap import ( + read_info as read_info, + write_info as write_info, + anonymize_info as anonymize_info, + read_fiducials as read_fiducials, + write_fiducials as write_fiducials, + show_fiff as show_fiff, + get_channel_type_constants as get_channel_type_constants, +) diff --git a/mne/utils/__init__.py b/mne/utils/__init__.py index 76e52f378fe..62d86f77631 100644 --- a/mne/utils/__init__.py +++ b/mne/utils/__init__.py @@ -1,208 +1,3 @@ import lazy_loader as lazy -__getattr__, __dir__, __all__ = lazy.attach( - __name__, - submodules=[], - submod_attrs={ - "_bunch": ["Bunch", "BunchConst", "BunchConstNamed"], - "check": [ - "check_fname", - "check_version", - "check_random_state", - "_check_fname", - "_check_subject", - "_check_pandas_installed", - "_check_pandas_index_arguments", - "_check_event_id", - "_check_ch_locs", - "_check_compensation_grade", - "_check_if_nan", - "_is_numeric", - "_ensure_int", - "_check_integer_or_list", - "_check_preload", - "_validate_type", - "_check_range", - "_check_info_inv", - "_check_channels_spatial_filter", - "_check_one_ch_type", - "_check_rank", - "_check_option", - "_check_depth", - "_check_combine", - "_path_like", - "_check_src_normal", - "_check_stc_units", - "_check_qt_version", - "_check_sphere", - "_check_time_format", - "_check_freesurfer_home", - "_suggest", - "_require_version", - "_on_missing", - "_check_on_missing", - "int_like", - "_safe_input", - "_check_all_same_channel_names", - "path_like", - "_ensure_events", - "_check_eeglabio_installed", - "_check_pybv_installed", - "_check_edflib_installed", - "_to_rgb", - "_soft_import", - "_check_dict_keys", - "_check_pymatreader_installed", - "_import_h5py", - "_import_h5io_funcs", - "_import_nibabel", - "_import_pymatreader_funcs", - "_check_head_radius", - ], - "config": [ - "set_config", - "get_config", - "get_config_path", - "set_cache_dir", - "set_memmap_min_size", - "get_subjects_dir", - "_get_stim_channel", - "sys_info", - "_get_extra_data_path", - "_get_root_dir", - "_get_numpy_libs", - ], - "docs": [ - "copy_function_doc_to_method_doc", - "copy_doc", - "linkcode_resolve", - "open_docs", - "deprecated", - "fill_doc", - "deprecated_alias", - "legacy", - "copy_base_doc_to_subclass_doc", - "_doc_special_members", - ], - "fetching": ["_url_to_local_path"], - "_logging": [ - "verbose", - "logger", - "set_log_level", - "set_log_file", - "use_log_level", - "catch_logging", - "warn", - "filter_out_warnings", - "wrapped_stdout", - "_get_call_line", - "_record_warnings", - "ClosingStringIO", - "_verbose_safe_false", - "_parse_verbose", - ], - "misc": [ - "run_subprocess", - "_pl", - "_clean_names", - "pformat", - "_file_like", - "_empty_hash", - "_explain_exception", - "_get_argvalues", - "sizeof_fmt", - "running_subprocess", - "_DefaultEventParser", - "_assert_no_instances", - "_resource_path", - "repr_html", - "_auto_weakref", - ], - "progressbar": ["ProgressBar"], - "_testing": [ - "run_command_if_main", - "requires_mne", - "requires_good_network", - "ArgvSetter", - "SilenceStdout", - "has_freesurfer", - "has_mne_c", - "_TempDir", - "buggy_mkl_svd", - "requires_freesurfer", - "requires_mne_mark", - "assert_object_equal", - "assert_and_remove_boundary_annot", - "_raw_annot", - "assert_dig_allclose", - "assert_meg_snr", - "assert_snr", - "assert_stcs_equal", - "_click_ch_name", - "requires_openmeeg_mark", - ], - "numerics": [ - "hashfunc", - "_compute_row_norms", - "_reg_pinv", - "random_permutation", - "_reject_data_segments", - "compute_corr", - "_get_inst_data", - "array_split_idx", - "sum_squared", - "split_list", - "_gen_events", - "create_slices", - "_time_mask", - "_freq_mask", - "grand_average", - "object_diff", - "object_hash", - "object_size", - "_apply_scaling_cov", - "_undo_scaling_cov", - "_apply_scaling_array", - "_undo_scaling_array", - "_scaled_array", - "_replace_md5", - "_PCA", - "_mask_to_onsets_offsets", - "_array_equal_nan", - "_julian_to_cal", - "_cal_to_julian", - "_dt_to_julian", - "_julian_to_dt", - "_dt_to_stamp", - "_stamp_to_dt", - "_check_dt", - "_ReuseCycle", - "_arange_div", - "_hashable_ndarray", - "_custom_lru_cache", - ], - "mixin": [ - "SizeMixin", - "GetEpochsMixin", - "TimeMixin", - "ExtendedTimeMixin", - "_prepare_read_metadata", - "_prepare_write_metadata", - "_check_decim", - ], - "linalg": [ - "_svd_lwork", - "_repeated_svd", - "_sym_mat_pow", - "sqrtm_sym", - "eigh", - "_get_blas_funcs", - ], - "dataframe": [ - "_set_pandas_dtype", - "_scale_dataframe_data", - "_convert_times", - "_build_data_frame", - ], - }, -) +__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__) diff --git a/mne/utils/__init__.pyi b/mne/utils/__init__.pyi new file mode 100644 index 00000000000..c5eaeb9f8d7 --- /dev/null +++ b/mne/utils/__init__.pyi @@ -0,0 +1,216 @@ +from ._bunch import ( + Bunch as Bunch, + BunchConst as BunchConst, + BunchConstNamed as BunchConstNamed, +) + +from .check import ( + check_fname as check_fname, + check_version as check_version, + check_random_state as check_random_state, + _check_fname as _check_fname, + _check_subject as _check_subject, + _check_pandas_installed as _check_pandas_installed, + _check_pandas_index_arguments as _check_pandas_index_arguments, + _check_event_id as _check_event_id, + _check_ch_locs as _check_ch_locs, + _check_compensation_grade as _check_compensation_grade, + _check_if_nan as _check_if_nan, + _is_numeric as _is_numeric, + _ensure_int as _ensure_int, + _check_integer_or_list as _check_integer_or_list, + _check_preload as _check_preload, + _validate_type as _validate_type, + _check_range as _check_range, + _check_info_inv as _check_info_inv, + _check_channels_spatial_filter as _check_channels_spatial_filter, + _check_one_ch_type as _check_one_ch_type, + _check_rank as _check_rank, + _check_option as _check_option, + _check_depth as _check_depth, + _check_combine as _check_combine, + _path_like as _path_like, + _check_src_normal as _check_src_normal, + _check_stc_units as _check_stc_units, + _check_qt_version as _check_qt_version, + _check_sphere as _check_sphere, + _check_time_format as _check_time_format, + _check_freesurfer_home as _check_freesurfer_home, + _suggest as _suggest, + _require_version as _require_version, + _on_missing as _on_missing, + _check_on_missing as _check_on_missing, + int_like as int_like, + _safe_input as _safe_input, + _check_all_same_channel_names as _check_all_same_channel_names, + path_like as path_like, + _ensure_events as _ensure_events, + _check_eeglabio_installed as _check_eeglabio_installed, + _check_pybv_installed as _check_pybv_installed, + _check_edflib_installed as _check_edflib_installed, + _to_rgb as _to_rgb, + _soft_import as _soft_import, + _check_dict_keys as _check_dict_keys, + _check_pymatreader_installed as _check_pymatreader_installed, + _import_h5py as _import_h5py, + _import_h5io_funcs as _import_h5io_funcs, + _import_nibabel as _import_nibabel, + _import_pymatreader_funcs as _import_pymatreader_funcs, + _check_head_radius as _check_head_radius, +) + +from .config import ( + set_config as set_config, + get_config as get_config, + get_config_path as get_config_path, + set_cache_dir as set_cache_dir, + set_memmap_min_size as set_memmap_min_size, + get_subjects_dir as get_subjects_dir, + _get_stim_channel as _get_stim_channel, + sys_info as sys_info, + _get_extra_data_path as _get_extra_data_path, + _get_root_dir as _get_root_dir, + _get_numpy_libs as _get_numpy_libs, +) + +from .docs import ( + copy_function_doc_to_method_doc as copy_function_doc_to_method_doc, + copy_doc as copy_doc, + linkcode_resolve as linkcode_resolve, + open_docs as open_docs, + deprecated as deprecated, + fill_doc as fill_doc, + deprecated_alias as deprecated_alias, + legacy as legacy, + copy_base_doc_to_subclass_doc as copy_base_doc_to_subclass_doc, + _doc_special_members as _doc_special_members, +) + +from .fetching import _url_to_local_path as _url_to_local_path + +from ._logging import ( + verbose as verbose, + logger as logger, + set_log_level as set_log_level, + set_log_file as set_log_file, + use_log_level as use_log_level, + catch_logging as catch_logging, + warn as warn, + filter_out_warnings as filter_out_warnings, + wrapped_stdout as wrapped_stdout, + _get_call_line as _get_call_line, + _record_warnings as _record_warnings, + ClosingStringIO as ClosingStringIO, + _verbose_safe_false as _verbose_safe_false, + _parse_verbose as _parse_verbose, +) + +from .misc import ( + run_subprocess as run_subprocess, + _pl as _pl, + _clean_names as _clean_names, + pformat as pformat, + _file_like as _file_like, + _empty_hash as _empty_hash, + _explain_exception as _explain_exception, + _get_argvalues as _get_argvalues, + sizeof_fmt as sizeof_fmt, + running_subprocess as running_subprocess, + _DefaultEventParser as _DefaultEventParser, + _assert_no_instances as _assert_no_instances, + _resource_path as _resource_path, + repr_html as repr_html, + _auto_weakref as _auto_weakref, +) + +from .progressbar import ProgressBar as ProgressBar + +from ._testing import ( + run_command_if_main as run_command_if_main, + requires_mne as requires_mne, + requires_good_network as requires_good_network, + ArgvSetter as ArgvSetter, + SilenceStdout as SilenceStdout, + has_freesurfer as has_freesurfer, + has_mne_c as has_mne_c, + _TempDir as _TempDir, + buggy_mkl_svd as buggy_mkl_svd, + requires_freesurfer as requires_freesurfer, + requires_mne_mark as requires_mne_mark, + assert_object_equal as assert_object_equal, + assert_and_remove_boundary_annot as assert_and_remove_boundary_annot, + _raw_annot as _raw_annot, + assert_dig_allclose as assert_dig_allclose, + assert_meg_snr as assert_meg_snr, + assert_snr as assert_snr, + assert_stcs_equal as assert_stcs_equal, + _click_ch_name as _click_ch_name, + requires_openmeeg_mark as requires_openmeeg_mark, +) + +from .numerics import ( + hashfunc as hashfunc, + _compute_row_norms as _compute_row_norms, + _reg_pinv as _reg_pinv, + random_permutation as random_permutation, + _reject_data_segments as _reject_data_segments, + compute_corr as compute_corr, + _get_inst_data as _get_inst_data, + array_split_idx as array_split_idx, + sum_squared as sum_squared, + split_list as split_list, + _gen_events as _gen_events, + create_slices as create_slices, + _time_mask as _time_mask, + _freq_mask as _freq_mask, + grand_average as grand_average, + object_diff as object_diff, + object_hash as object_hash, + object_size as object_size, + _apply_scaling_cov as _apply_scaling_cov, + _undo_scaling_cov as _undo_scaling_cov, + _apply_scaling_array as _apply_scaling_array, + _undo_scaling_array as _undo_scaling_array, + _scaled_array as _scaled_array, + _replace_md5 as _replace_md5, + _PCA as _PCA, + _mask_to_onsets_offsets as _mask_to_onsets_offsets, + _array_equal_nan as _array_equal_nan, + _julian_to_cal as _julian_to_cal, + _cal_to_julian as _cal_to_julian, + _dt_to_julian as _dt_to_julian, + _julian_to_dt as _julian_to_dt, + _dt_to_stamp as _dt_to_stamp, + _stamp_to_dt as _stamp_to_dt, + _check_dt as _check_dt, + _ReuseCycle as _ReuseCycle, + _arange_div as _arange_div, + _hashable_ndarray as _hashable_ndarray, + _custom_lru_cache as _custom_lru_cache, +) + +from .mixin import ( + SizeMixin as SizeMixin, + GetEpochsMixin as GetEpochsMixin, + TimeMixin as TimeMixin, + ExtendedTimeMixin as ExtendedTimeMixin, + _prepare_read_metadata as _prepare_read_metadata, + _prepare_write_metadata as _prepare_write_metadata, + _check_decim as _check_decim, +) + +from .linalg import ( + _svd_lwork as _svd_lwork, + _repeated_svd as _repeated_svd, + _sym_mat_pow as _sym_mat_pow, + sqrtm_sym as sqrtm_sym, + eigh as eigh, + _get_blas_funcs as _get_blas_funcs, +) + +from .dataframe import ( + _set_pandas_dtype as _set_pandas_dtype, + _scale_dataframe_data as _scale_dataframe_data, + _convert_times as _convert_times, + _build_data_frame as _build_data_frame, +)