py-neuromodulation 0.0.2__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. py_neuromodulation-0.0.4/.gitignore +175 -0
  2. py_neuromodulation-0.0.4/.readthedocs.yaml +25 -0
  3. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/PKG-INFO +72 -32
  4. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/README.rst +19 -7
  5. py_neuromodulation-0.0.4/examples/README.rst +5 -0
  6. py_neuromodulation-0.0.4/examples/plot_2_example_add_feature.py +76 -0
  7. py_neuromodulation-0.0.4/examples/plot_3_example_sharpwave_analysis.py +219 -0
  8. py_neuromodulation-0.0.4/examples/plot_4_example_gridPointProjection.py +210 -0
  9. py_neuromodulation-0.0.4/examples/plot_5_example_rmap_computing.py +64 -0
  10. py_neuromodulation-0.0.4/examples/plot_6_real_time_demo.py +121 -0
  11. py_neuromodulation-0.0.4/py_neuromodulation/ConnectivityDecoding/Automated Anatomical Labeling 3 (Rolls 2020).nii +0 -0
  12. py_neuromodulation-0.0.4/py_neuromodulation/ConnectivityDecoding/_get_grid_hull.m +34 -0
  13. py_neuromodulation-0.0.4/py_neuromodulation/ConnectivityDecoding/_get_grid_whole_brain.py +106 -0
  14. py_neuromodulation-0.0.4/py_neuromodulation/ConnectivityDecoding/_helper_write_connectome.py +119 -0
  15. py_neuromodulation-0.0.4/py_neuromodulation/ConnectivityDecoding/mni_coords_cortical_surface.mat +0 -0
  16. py_neuromodulation-0.0.4/py_neuromodulation/ConnectivityDecoding/mni_coords_whole_brain.mat +0 -0
  17. py_neuromodulation-0.0.4/py_neuromodulation/ConnectivityDecoding/rmap_func_all.nii +0 -0
  18. py_neuromodulation-0.0.4/py_neuromodulation/ConnectivityDecoding/rmap_struc.nii +0 -0
  19. py_neuromodulation-0.0.2/py_neuromodulation/helper.py → py_neuromodulation-0.0.4/py_neuromodulation/_write_example_dataset_helper.py +1 -1
  20. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_EpochStream.py +2 -3
  21. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_IO.py +43 -70
  22. py_neuromodulation-0.0.4/py_neuromodulation/nm_RMAP.py +531 -0
  23. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_analysis.py +1 -1
  24. py_neuromodulation-0.0.4/py_neuromodulation/nm_artifacts.py +25 -0
  25. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_bispectra.py +64 -29
  26. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_bursts.py +44 -30
  27. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_coherence.py +2 -1
  28. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_features.py +4 -2
  29. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_filter.py +63 -32
  30. py_neuromodulation-0.0.4/py_neuromodulation/nm_filter_preprocessing.py +91 -0
  31. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_fooof.py +47 -29
  32. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_mne_connectivity.py +1 -1
  33. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_normalization.py +50 -74
  34. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_oscillatory.py +151 -31
  35. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_plots.py +13 -10
  36. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_rereference.py +10 -8
  37. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_run_analysis.py +28 -13
  38. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_settings.json +51 -3
  39. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_sharpwaves.py +103 -136
  40. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_stats.py +44 -30
  41. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_stream_abc.py +18 -10
  42. py_neuromodulation-0.0.4/py_neuromodulation/nm_stream_offline.py +359 -0
  43. py_neuromodulation-0.0.4/py_neuromodulation/utils/_logging.py +24 -0
  44. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/pyproject.toml +82 -79
  45. py_neuromodulation-0.0.4/requirements_rtd.txt +34 -0
  46. py_neuromodulation-0.0.4/tests/__init__.py +0 -0
  47. py_neuromodulation-0.0.4/tests/conftest.py +117 -0
  48. py_neuromodulation-0.0.4/tests/test_all_examples.py +10 -0
  49. py_neuromodulation-0.0.4/tests/test_all_features.py +63 -0
  50. py_neuromodulation-0.0.4/tests/test_bispectra.py +70 -0
  51. py_neuromodulation-0.0.4/tests/test_bursts.py +105 -0
  52. py_neuromodulation-0.0.4/tests/test_feature_sampling_rates.py +143 -0
  53. py_neuromodulation-0.0.4/tests/test_fooof.py +16 -0
  54. py_neuromodulation-0.0.4/tests/test_initalization_offline_stream.py +41 -0
  55. py_neuromodulation-0.0.4/tests/test_multiprocessing.py +58 -0
  56. py_neuromodulation-0.0.4/tests/test_nan_values.py +29 -0
  57. py_neuromodulation-0.0.4/tests/test_nm_filter.py +95 -0
  58. py_neuromodulation-0.0.4/tests/test_nm_resample.py +63 -0
  59. py_neuromodulation-0.0.4/tests/test_normalization_settings.py +146 -0
  60. py_neuromodulation-0.0.4/tests/test_notch_filter.py +31 -0
  61. py_neuromodulation-0.0.4/tests/test_osc_features.py +424 -0
  62. py_neuromodulation-0.0.4/tests/test_preprocessing_filter.py +151 -0
  63. py_neuromodulation-0.0.4/tests/test_rereference.py +171 -0
  64. py_neuromodulation-0.0.4/tests/test_sampling.py +57 -0
  65. py_neuromodulation-0.0.4/tests/test_settings_change_after_init.py +76 -0
  66. py_neuromodulation-0.0.4/tests/test_sharpwave.py +165 -0
  67. py_neuromodulation-0.0.4/tests/test_target_channel_add.py +100 -0
  68. py_neuromodulation-0.0.4/tests/test_timing.py +80 -0
  69. py_neuromodulation-0.0.4/tox.ini +16 -0
  70. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/MOV_aligned_features_ch_ECOG_RIGHT_0_all.png +0 -0
  71. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/all_feature_plt.pdf +0 -0
  72. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_FEATURES.csv +0 -182
  73. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_LM_ML_RES.p +0 -0
  74. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_SETTINGS.json +0 -273
  75. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_SIDECAR.json +0 -6
  76. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_decoding_performance.png +0 -0
  77. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_nm_channels.csv +0 -11
  78. py_neuromodulation-0.0.2/py_neuromodulation/nm_RMAP.py +0 -234
  79. py_neuromodulation-0.0.2/py_neuromodulation/nm_stream_offline.py +0 -217
  80. py_neuromodulation-0.0.2/py_neuromodulation/py_neuromodulation.egg-info/PKG-INFO +0 -104
  81. py_neuromodulation-0.0.2/py_neuromodulation/py_neuromodulation.egg-info/dependency_links.txt +0 -1
  82. py_neuromodulation-0.0.2/py_neuromodulation/py_neuromodulation.egg-info/requires.txt +0 -26
  83. py_neuromodulation-0.0.2/py_neuromodulation/py_neuromodulation.egg-info/top_level.txt +0 -1
  84. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/LICENSE +0 -0
  85. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/FieldTrip.py +0 -0
  86. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/__init__.py +0 -0
  87. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/README +0 -0
  88. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/dataset_description.json +0 -0
  89. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/participants.json +0 -0
  90. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/participants.tsv +0 -0
  91. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_space-mni_coordsystem.json +0 -0
  92. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_space-mni_electrodes.tsv +0 -0
  93. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_channels.tsv +0 -0
  94. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.eeg +0 -0
  95. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.json +0 -0
  96. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.vhdr +0 -0
  97. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.vmrk +0 -0
  98. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/sub-testsub_ses-EphysMedOff_scans.tsv +0 -0
  99. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/grid_cortex.tsv +0 -0
  100. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/grid_subcortex.tsv +0 -0
  101. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_across_patient_decoding.py +0 -0
  102. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_cohortwrapper.py +0 -0
  103. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_decode.py +0 -0
  104. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_define_nmchannels.py +0 -0
  105. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_eval_timing.py +0 -0
  106. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_features_abc.py +0 -0
  107. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_generator.py +0 -0
  108. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_hjorth_raw.py +0 -0
  109. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_kalmanfilter.py +0 -0
  110. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_linelength.py +0 -0
  111. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_nolds.py +0 -0
  112. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_projection.py +0 -0
  113. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_resample.py +0 -0
  114. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/nm_settings.py +0 -0
  115. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/plots/STN_surf.mat +0 -0
  116. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/plots/Vertices.mat +0 -0
  117. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/plots/faces.mat +0 -0
  118. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.4}/py_neuromodulation/plots/grid.mat +0 -0
  119. /py_neuromodulation-0.0.2/py_neuromodulation/py_neuromodulation.egg-info/SOURCES.txt → /py_neuromodulation-0.0.4/py_neuromodulation/utils/__init__.py +0 -0
@@ -0,0 +1,175 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .pypirc/
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ pip-wheel-metadata/
25
+ share/python-wheels/
26
+ *.egg-info/
27
+ .installed.cfg
28
+ *.egg
29
+ MANIFEST
30
+
31
+ # PyInstaller
32
+ # Usually these files are written by a python script from a template
33
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ *.py,cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ .python-version
87
+
88
+ # pipenv
89
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
91
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
92
+ # install all needed dependencies.
93
+ #Pipfile.lock
94
+
95
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
96
+ __pypackages__/
97
+
98
+ # Celery stuff
99
+ celerybeat-schedule
100
+ celerybeat.pid
101
+
102
+ # SageMath parsed files
103
+ *.sage.py
104
+
105
+ # Environments
106
+ .env
107
+ .venv
108
+ env/
109
+ venv/
110
+ ENV/
111
+ env.bak/
112
+ venv.bak/
113
+
114
+ # Visual Studio Code
115
+ .vscode
116
+
117
+ # PyCharm
118
+ .idea
119
+
120
+ # Spyder project settings
121
+ .spyderproject
122
+ .spyproject
123
+
124
+ # Rope project settings
125
+ .ropeproject
126
+
127
+ # mkdocs documentation
128
+ /site
129
+
130
+ # mypy
131
+ .mypy_cache/
132
+ .dmypy.json
133
+ dmypy.json
134
+
135
+ # Pyre type checker
136
+ .pyre/
137
+
138
+ # Ignore pickles
139
+ *.pkl
140
+ **/*.pkl
141
+ *.p
142
+
143
+ .pdf
144
+
145
+ sphinx/sub/*
146
+
147
+ docs/build/*
148
+ docs/source/_build/*
149
+ docs/previous/*
150
+ docs/source/auto_examples/*
151
+ docs/source/data/*
152
+
153
+ examples/data/derivatives/*
154
+ examples/other_examples/*
155
+
156
+ examples/sub/*
157
+ examples/utils/*
158
+
159
+ sub/
160
+
161
+ py_neuromodulation/data/derivatives/*
162
+
163
+ requirements.lock
164
+ requirements-dev.lock
165
+
166
+ .python-version
167
+
168
+ py_neuromodulation/ConnectivityDecoding/connectome_folder/*
169
+
170
+ plot_0_first_demo.py
171
+
172
+ requirements.lock
173
+ requirements-dev.lock
174
+
175
+ plot_1_example_BIDS.py
@@ -0,0 +1,25 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ # Set the version of Python and other tools you might need
9
+ build:
10
+ os: ubuntu-22.04
11
+ tools:
12
+ python: "3.11"
13
+
14
+ # Build documentation in the docs/ directory with Sphinx
15
+ sphinx:
16
+ configuration: docs/source/conf.py
17
+ builder: html
18
+ fail_on_warning: false
19
+
20
+ # Optionally declare the Python requirements required to build your docs
21
+ python:
22
+ install:
23
+ - method: pip
24
+ path: .
25
+ - requirements: requirements_rtd.txt
@@ -1,44 +1,73 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: py_neuromodulation
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: Real-time analysis of intracranial neurophysiology recordings.
5
- Keywords: real-time,eeg,ieeg,dbs,ecog,electrocorticography,deep-brain-stimulation,machine-learning
5
+ Project-URL: bugtracker, https://github.com/neuromodulation/py_neuromodulation/issues
6
+ Project-URL: repository, https://github.com/neuromodulation/py_neuromodulation
6
7
  Author-email: Timon Merk <timon.merk@charite.de>
7
8
  Maintainer: Timon Merk
8
- Requires-Python: >=3.10
9
- Description-Content-Type: text/x-rst
9
+ License: MIT License
10
+
11
+ Copyright (c) 2021 Interventional Cognitive Neuromodulation - Neumann Lab Berlin
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE
31
+ Keywords: dbs,deep-brain-stimulation,ecog,eeg,electrocorticography,ieeg,machine-learning,real-time
10
32
  Classifier: Development Status :: 2 - Pre-Alpha
11
- Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: License :: OSI Approved :: MIT License
12
34
  Classifier: Programming Language :: Python
13
35
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
- Requires-Dist: mne
15
- Requires-Dist: filterpy >= 1.4.5
36
+ Requires-Python: >=3.10
37
+ Requires-Dist: black>=24.2.0
38
+ Requires-Dist: filterpy>=1.4.5
16
39
  Requires-Dist: fooof
40
+ Requires-Dist: hatch>=1.9.4
17
41
  Requires-Dist: imbalanced-learn
18
- Requires-Dist: matplotlib >= 3.3.4
19
- Requires-Dist: mne-bids >= 0.8
42
+ Requires-Dist: ipython
43
+ Requires-Dist: joblib>=1.3.2
44
+ Requires-Dist: matplotlib>=3.3.4
45
+ Requires-Dist: mne
46
+ Requires-Dist: mne-bids>=0.8
20
47
  Requires-Dist: mne-connectivity
21
48
  Requires-Dist: mrmr-selection
22
49
  Requires-Dist: nolds
23
- Requires-Dist: numpy >= 1.21.2
24
- Requires-Dist: pandas >= 1.2.2
50
+ Requires-Dist: notebook
51
+ Requires-Dist: numpy>=1.21.2
52
+ Requires-Dist: pandas>=1.2.2
25
53
  Requires-Dist: pip
26
- Requires-Dist: pynput
54
+ Requires-Dist: pyarrow>=14.0.2
27
55
  Requires-Dist: pybids
56
+ Requires-Dist: pybispectra>=1.0.0
57
+ Requires-Dist: pynput
58
+ Requires-Dist: pyparrm
59
+ Requires-Dist: pytest>=8.0.2
28
60
  Requires-Dist: scikit-image
29
- Requires-Dist: scikit-learn >= 0.24.2
61
+ Requires-Dist: scikit-learn>=0.24.2
30
62
  Requires-Dist: scikit-optimize
31
- Requires-Dist: scipy >= 1.7.1
32
- Requires-Dist: seaborn >= 0.11
33
- Requires-Dist: notebook
34
- Requires-Dist: ipython
35
- Requires-Dist: pybispectra
36
- Requires-Dist: black ; extra == "dev"
37
- Requires-Dist: pytest ; extra == "dev"
38
- Requires-Dist: pytest-cov ; extra == "dev"
39
- Project-URL: bugtracker, https://github.com/neuromodulation/py_neuromodulation/issues
40
- Project-URL: repository, https://github.com/neuromodulation/py_neuromodulation
63
+ Requires-Dist: scipy>=1.7.1
64
+ Requires-Dist: seaborn>=0.11
65
+ Requires-Dist: wget
41
66
  Provides-Extra: dev
67
+ Requires-Dist: black; extra == 'dev'
68
+ Requires-Dist: pytest; extra == 'dev'
69
+ Requires-Dist: pytest-cov; extra == 'dev'
70
+ Description-Content-Type: text/x-rst
42
71
 
43
72
  py_neuromodulation
44
73
  ==================
@@ -82,12 +111,24 @@ py_neuromodulation requires at least python 3.10. For installation you can use p
82
111
 
83
112
  pip install py-neuromodulation
84
113
 
85
- We recommend however installing the package in a new new conda environment:
114
+
115
+ We recommend however installing the package using `rye <https://rye-up.com/guide/installation/>`_:
86
116
 
87
117
  .. code-block::
88
118
 
89
119
  git clone https://github.com/neuromodulation/py_neuromodulation.git
90
- conda create -n pynm-test python=3.10
120
+ rye pin 3.11
121
+ rye sync
122
+
123
+ And then activating the virtual environment e.g. in Windows using:
124
+
125
+ .. code-block::
126
+
127
+ .\.venv\Scripts\activate
128
+
129
+ Alternatively you can also install the package in a conda environment:
130
+
131
+ conda create -n pynm-test python=3.11
91
132
  conda activate pynm-test
92
133
 
93
134
  Then install the packages listed in the `pyproject.toml`:
@@ -107,27 +148,27 @@ Then *py_neuromodulation* can be imported via:
107
148
 
108
149
  .. code-block::
109
150
 
110
- import py_neuromodulation as py_nm
151
+ import py_neuromodulation as nm
111
152
 
112
153
  Basic Usage
113
154
  ===========
114
155
 
115
156
  .. code-block:: python
116
157
 
117
- import py_neuromodulation as pn
158
+ import py_neuromodulation as nm
118
159
  import numpy as np
119
160
 
120
161
  NUM_CHANNELS = 5
121
162
  NUM_DATA = 10000
122
163
  sfreq = 1000 # Hz
123
- feature_freq = 3 # Hz
164
+ sampling_rate_features_hz = 3 # Hz
124
165
 
125
166
  data = np.random.random([NUM_CHANNELS, NUM_DATA])
126
167
 
127
- stream = pn.Stream(sfreq=sfreq, data=data, sampling_rate_features_hz=sampling_rate_features_hz)
168
+ stream = nm.Stream(sfreq=sfreq, data=data, sampling_rate_features_hz=sampling_rate_features_hz)
128
169
  features = stream.run()
129
170
 
130
- Check the `Usage <https://py-neuromodulation.readthedocs.io/en/latest/usage.html>`_ and `First examples <https://py-neuromodulation.readthedocs.io/en/latest/auto_examples/plot_first_demo.html>`_ for further introduction.
171
+ Check the `Usage <https://py-neuromodulation.readthedocs.io/en/latest/usage.html>`_ and `First examples <https://py-neuromodulation.readthedocs.io/en/latest/auto_examples/plot_0_first_demo.html>`_ for further introduction.
131
172
 
132
173
  Contact information
133
174
  -------------------
@@ -139,4 +180,3 @@ References
139
180
 
140
181
  .. [1] Merk, T. et al. *Invasive neurophysiology and whole brain connectomics for neural decoding in patients with brain implants*, `https://doi.org/10.21203/rs.3.rs-3212709/v1` (2023).
141
182
  .. [2] Merk, T. et al. *Electrocorticography is superior to subthalamic local field potentials for movement decoding in Parkinson’s disease*. Elife 11, e75126, `https://doi.org/10.7554/eLife.75126` (2022).
142
-
@@ -40,12 +40,24 @@ py_neuromodulation requires at least python 3.10. For installation you can use p
40
40
 
41
41
  pip install py-neuromodulation
42
42
 
43
- We recommend however installing the package in a new new conda environment:
43
+
44
+ We recommend however installing the package using `rye <https://rye-up.com/guide/installation/>`_:
44
45
 
45
46
  .. code-block::
46
47
 
47
48
  git clone https://github.com/neuromodulation/py_neuromodulation.git
48
- conda create -n pynm-test python=3.10
49
+ rye pin 3.11
50
+ rye sync
51
+
52
+ And then activating the virtual environment e.g. in Windows using:
53
+
54
+ .. code-block::
55
+
56
+ .\.venv\Scripts\activate
57
+
58
+ Alternatively you can also install the package in a conda environment:
59
+
60
+ conda create -n pynm-test python=3.11
49
61
  conda activate pynm-test
50
62
 
51
63
  Then install the packages listed in the `pyproject.toml`:
@@ -65,27 +77,27 @@ Then *py_neuromodulation* can be imported via:
65
77
 
66
78
  .. code-block::
67
79
 
68
- import py_neuromodulation as py_nm
80
+ import py_neuromodulation as nm
69
81
 
70
82
  Basic Usage
71
83
  ===========
72
84
 
73
85
  .. code-block:: python
74
86
 
75
- import py_neuromodulation as pn
87
+ import py_neuromodulation as nm
76
88
  import numpy as np
77
89
 
78
90
  NUM_CHANNELS = 5
79
91
  NUM_DATA = 10000
80
92
  sfreq = 1000 # Hz
81
- feature_freq = 3 # Hz
93
+ sampling_rate_features_hz = 3 # Hz
82
94
 
83
95
  data = np.random.random([NUM_CHANNELS, NUM_DATA])
84
96
 
85
- stream = pn.Stream(sfreq=sfreq, data=data, sampling_rate_features_hz=sampling_rate_features_hz)
97
+ stream = nm.Stream(sfreq=sfreq, data=data, sampling_rate_features_hz=sampling_rate_features_hz)
86
98
  features = stream.run()
87
99
 
88
- Check the `Usage <https://py-neuromodulation.readthedocs.io/en/latest/usage.html>`_ and `First examples <https://py-neuromodulation.readthedocs.io/en/latest/auto_examples/plot_first_demo.html>`_ for further introduction.
100
+ Check the `Usage <https://py-neuromodulation.readthedocs.io/en/latest/usage.html>`_ and `First examples <https://py-neuromodulation.readthedocs.io/en/latest/auto_examples/plot_0_first_demo.html>`_ for further introduction.
89
101
 
90
102
  Contact information
91
103
  -------------------
@@ -0,0 +1,5 @@
1
+ .. _examples-index:
2
+
3
+ Examples
4
+ ========
5
+
@@ -0,0 +1,76 @@
1
+ """
2
+ ===================
3
+ Adding New Features
4
+ ===================
5
+
6
+ """
7
+
8
+ import py_neuromodulation as nm
9
+ from py_neuromodulation import nm_features_abc
10
+ import numpy as np
11
+ from typing import Iterable
12
+
13
+ # %%
14
+ # In this example we will demonstrate how a new feature can be added to the existing feature pipeline.
15
+ # This can be done simply by adding an object of the inherited :class:`~nm_features_abc.Feature`
16
+ # class to the stream `stream.run_analysis.features.features` list.
17
+
18
+ data = np.random.random([1, 1000])
19
+
20
+ stream = nm.Stream(
21
+ sfreq=1000,
22
+ data=data,
23
+ sampling_rate_features_hz=10,
24
+ verbose=False,
25
+ )
26
+
27
+
28
+ class NewFeature(nm_features_abc.Feature):
29
+ def __init__(
30
+ self, settings: dict, ch_names: Iterable[str], sfreq: float
31
+ ) -> None:
32
+ self.s = settings
33
+ self.ch_names = ch_names
34
+
35
+ def calc_feature(self, data: np.array, features_compute: dict) -> dict:
36
+ for ch_idx, ch in enumerate(self.ch_names):
37
+ features_compute[f"new_feature_{ch}"] = np.mean(data[ch_idx, :])
38
+
39
+ return features_compute
40
+
41
+ def test_settings():
42
+ pass
43
+
44
+
45
+ newFeature = NewFeature(
46
+ stream.settings, list(stream.nm_channels["name"]), stream.sfreq
47
+ )
48
+ stream.run_analysis.features.features.append(newFeature)
49
+
50
+ features = stream.run_analysis.process(data)
51
+ feature_name = f"new_feature_{stream.nm_channels['name'][0]}"
52
+
53
+ print(f"{feature_name}: {features[feature_name]}")
54
+
55
+ # %%
56
+ # This example shows a simple newly instantiated feature class called `NewFeature`.
57
+ # The instantiated `newFeature` object could then be added to the existing feature list by calling
58
+ # `stream.run_analysis.features.features.append(newFeature)`.
59
+ #
60
+ # To permanently add a novel feature, the new feature class needs to be added to
61
+ # the :class:`~nm_features` class. This can be done by inserting the feature_name in
62
+ # in the :class:`~nm_features.Feature` init function:
63
+ #
64
+ # .. code-block:: python
65
+ #
66
+ # for feature in s["features"]:
67
+ # if s["features"][feature] is False:
68
+ # continue
69
+ # match feature:
70
+ # case "new_feature":
71
+ # FeatureClass = nm_new_feature.NewFeature
72
+ # ...
73
+ #
74
+ # The new feature class can then be used by setting the `settings["feature"]["new_feature"]` value in the
75
+ # settings to true.
76
+ #