Skip to content

Commit 3a4d023

Browse files
drammocklarsoner
authored andcommitted
handle lazy loading through .pyi type stubs (mne-tools#12072)
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
1 parent c12bee7 commit 3a4d023

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1796
-1084
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ recursive-include tutorials *.py
1515
recursive-include tutorials *.txt
1616

1717
recursive-include mne *.py
18+
recursive-include mne *.pyi
1819
recursive-include mne/data *
1920
recursive-include mne/icons *
2021
recursive-include mne/data/helmets *

mne/__init__.py

Lines changed: 1 addition & 274 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""MNE software for MEG and EEG data analysis."""
2-
32
# PEP0440 compatible formatted version, see:
43
# https://www.python.org/dev/peps/pep-0440/
54
#
@@ -26,279 +25,7 @@
2625
from ._version import __version__
2726
except ImportError:
2827
__version__ = "0.0.0"
29-
30-
31-
__getattr__, __dir__, __all__ = lazy.attach(
32-
__name__,
33-
submodules=[
34-
"beamformer",
35-
"channels",
36-
"chpi",
37-
"commands",
38-
"coreg",
39-
"cuda",
40-
"datasets",
41-
"decoding",
42-
"defaults",
43-
"dipole",
44-
"epochs",
45-
"event",
46-
"export",
47-
"filter",
48-
"forward",
49-
"gui",
50-
"inverse_sparse",
51-
"io",
52-
"minimum_norm",
53-
"preprocessing",
54-
"report",
55-
"source_space",
56-
"simulation",
57-
"stats",
58-
"surface",
59-
"time_frequency",
60-
"viz",
61-
],
62-
submod_attrs={
63-
"_freesurfer": [
64-
"get_volume_labels_from_aseg",
65-
"head_to_mni",
66-
"head_to_mri",
67-
"read_freesurfer_lut",
68-
"read_lta",
69-
"read_talxfm",
70-
"vertex_to_mni",
71-
],
72-
"annotations": [
73-
"Annotations",
74-
"annotations_from_events",
75-
"count_annotations",
76-
"events_from_annotations",
77-
"read_annotations",
78-
],
79-
"bem": [
80-
"make_bem_model",
81-
"make_bem_solution",
82-
"make_sphere_model",
83-
"read_bem_solution",
84-
"read_bem_surfaces",
85-
"write_bem_solution",
86-
"write_bem_surfaces",
87-
"write_head_bem",
88-
],
89-
"channels": [
90-
"equalize_channels",
91-
"rename_channels",
92-
"find_layout",
93-
"read_vectorview_selection",
94-
],
95-
"coreg": [
96-
"create_default_subject",
97-
"scale_bem",
98-
"scale_labels",
99-
"scale_mri",
100-
"scale_source_space",
101-
],
102-
"cov": [
103-
"Covariance",
104-
"compute_covariance",
105-
"compute_raw_covariance",
106-
"make_ad_hoc_cov",
107-
"read_cov",
108-
"whiten_evoked",
109-
"write_cov",
110-
],
111-
"dipole": [
112-
"Dipole",
113-
"DipoleFixed",
114-
"fit_dipole",
115-
"read_dipole",
116-
],
117-
"epochs": [
118-
"BaseEpochs",
119-
"Epochs",
120-
"EpochsArray",
121-
"concatenate_epochs",
122-
"make_fixed_length_epochs",
123-
"read_epochs",
124-
],
125-
"event": [
126-
"AcqParserFIF",
127-
"concatenate_events",
128-
"count_events",
129-
"find_events",
130-
"find_stim_steps",
131-
"make_fixed_length_events",
132-
"merge_events",
133-
"pick_events",
134-
"read_events",
135-
"write_events",
136-
],
137-
"evoked": [
138-
"Evoked",
139-
"EvokedArray",
140-
"combine_evoked",
141-
"read_evokeds",
142-
"write_evokeds",
143-
],
144-
"forward": [
145-
"Forward",
146-
"apply_forward_raw",
147-
"apply_forward",
148-
"average_forward_solutions",
149-
"convert_forward_solution",
150-
"make_field_map",
151-
"make_forward_dipole",
152-
"make_forward_solution",
153-
"read_forward_solution",
154-
"use_coil_def",
155-
"write_forward_solution",
156-
],
157-
"io": [
158-
"read_epochs_fieldtrip",
159-
"read_evoked_besa",
160-
"read_evoked_fieldtrip",
161-
"read_evokeds_mff",
162-
],
163-
"io.base": [
164-
"concatenate_raws",
165-
"match_channel_orders",
166-
],
167-
"io.eeglab": [
168-
"read_epochs_eeglab",
169-
],
170-
"io.kit": [
171-
"read_epochs_kit",
172-
],
173-
"_fiff.meas_info": [
174-
"Info",
175-
"create_info",
176-
],
177-
"_fiff.pick": [
178-
"channel_indices_by_type",
179-
"channel_type",
180-
"pick_channels_cov",
181-
"pick_channels_forward",
182-
"pick_channels_regexp",
183-
"pick_channels",
184-
"pick_info",
185-
"pick_types_forward",
186-
"pick_types",
187-
],
188-
"_fiff.proj": [
189-
"Projection",
190-
],
191-
"_fiff.reference": [
192-
"add_reference_channels",
193-
"set_bipolar_reference",
194-
"set_eeg_reference",
195-
],
196-
"_fiff.what": [
197-
"what",
198-
],
199-
"label": [
200-
"BiHemiLabel",
201-
"grow_labels",
202-
"label_sign_flip",
203-
"Label",
204-
"labels_to_stc",
205-
"morph_labels",
206-
"random_parcellation",
207-
"read_label",
208-
"read_labels_from_annot",
209-
"split_label",
210-
"stc_to_label",
211-
"write_label",
212-
"write_labels_to_annot",
213-
],
214-
"misc": [
215-
"parse_config",
216-
"read_reject_parameters",
217-
],
218-
"morph_map": [
219-
"read_morph_map",
220-
],
221-
"morph": [
222-
"SourceMorph",
223-
"compute_source_morph",
224-
"grade_to_vertices",
225-
"read_source_morph",
226-
],
227-
"proj": [
228-
"compute_proj_epochs",
229-
"compute_proj_evoked",
230-
"compute_proj_raw",
231-
"read_proj",
232-
"sensitivity_map",
233-
"write_proj",
234-
],
235-
"rank": [
236-
"compute_rank",
237-
],
238-
"report": [
239-
"Report",
240-
"open_report",
241-
],
242-
"source_estimate": [
243-
"MixedSourceEstimate",
244-
"MixedVectorSourceEstimate",
245-
"SourceEstimate",
246-
"VectorSourceEstimate",
247-
"VolSourceEstimate",
248-
"VolVectorSourceEstimate",
249-
"extract_label_time_course",
250-
"grade_to_tris",
251-
"read_source_estimate",
252-
"spatial_dist_adjacency",
253-
"spatial_inter_hemi_adjacency",
254-
"spatial_src_adjacency",
255-
"spatial_tris_adjacency",
256-
"spatio_temporal_dist_adjacency",
257-
"spatio_temporal_src_adjacency",
258-
"spatio_temporal_tris_adjacency",
259-
"stc_near_sensors",
260-
],
261-
"source_space._source_space": [
262-
"SourceSpaces",
263-
"add_source_space_distances",
264-
"get_volume_labels_from_src",
265-
"morph_source_spaces",
266-
"read_source_spaces",
267-
"setup_source_space",
268-
"setup_volume_source_space",
269-
"write_source_spaces",
270-
],
271-
"surface": [
272-
"decimate_surface",
273-
"dig_mri_distances",
274-
"get_head_surf",
275-
"get_meg_helmet_surf",
276-
"get_montage_volume_labels",
277-
"read_surface",
278-
"read_tri",
279-
"write_surface",
280-
],
281-
"transforms": [
282-
"Transform",
283-
"read_trans",
284-
"transform_surface_to",
285-
"write_trans",
286-
],
287-
"utils": [
288-
"get_config_path",
289-
"get_config",
290-
"grand_average",
291-
"open_docs",
292-
"set_cache_dir",
293-
"set_config",
294-
"set_memmap_min_size",
295-
"sys_info",
296-
"use_log_level",
297-
"verbose",
298-
],
299-
},
300-
)
301-
28+
(__getattr__, __dir__, __all__) = lazy.attach_stub(__name__, __file__)
30229
# initialize logging
30330
from .utils import set_log_level, set_log_file
30431

0 commit comments

Comments
 (0)