scd-edition 0.1.0__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 (104) hide show
  1. scd_edition-0.1.0/CHANGELOG.md +18 -0
  2. scd_edition-0.1.0/CITATION.cff +66 -0
  3. scd_edition-0.1.0/CONTRIBUTING.md +74 -0
  4. scd_edition-0.1.0/LICENSE +29 -0
  5. scd_edition-0.1.0/MANIFEST.in +8 -0
  6. scd_edition-0.1.0/PKG-INFO +708 -0
  7. scd_edition-0.1.0/README.md +665 -0
  8. scd_edition-0.1.0/SUPPORT.md +12 -0
  9. scd_edition-0.1.0/THIRD_PARTY_NOTICES.md +37 -0
  10. scd_edition-0.1.0/docs/demo.gif +0 -0
  11. scd_edition-0.1.0/docs/importing-data.md +88 -0
  12. scd_edition-0.1.0/docs/quickstart.md +54 -0
  13. scd_edition-0.1.0/docs/tutorial.ipynb +118 -0
  14. scd_edition-0.1.0/pyproject.toml +153 -0
  15. scd_edition-0.1.0/scripts/batch_channel_check.py +964 -0
  16. scd_edition-0.1.0/scripts/batch_decompose.py +914 -0
  17. scd_edition-0.1.0/scripts/capture_demo.py +206 -0
  18. scd_edition-0.1.0/scripts/check_distribution.py +85 -0
  19. scd_edition-0.1.0/scripts/fast_batch_channel_check.py +987 -0
  20. scd_edition-0.1.0/setup.cfg +4 -0
  21. scd_edition-0.1.0/src/scd_app/__init__.py +0 -0
  22. scd_edition-0.1.0/src/scd_app/__main__.py +6 -0
  23. scd_edition-0.1.0/src/scd_app/_vendor/__init__.py +1 -0
  24. scd_edition-0.1.0/src/scd_app/_vendor/motor_unit_toolbox/__init__.py +8 -0
  25. scd_edition-0.1.0/src/scd_app/_vendor/motor_unit_toolbox/muap_comp.py +55 -0
  26. scd_edition-0.1.0/src/scd_app/_vendor/motor_unit_toolbox/props.py +1022 -0
  27. scd_edition-0.1.0/src/scd_app/_vendor/motor_unit_toolbox/spike_comp.py +835 -0
  28. scd_edition-0.1.0/src/scd_app/core/__init__.py +0 -0
  29. scd_edition-0.1.0/src/scd_app/core/auto_editor.py +440 -0
  30. scd_edition-0.1.0/src/scd_app/core/config.py +253 -0
  31. scd_edition-0.1.0/src/scd_app/core/constants.py +26 -0
  32. scd_edition-0.1.0/src/scd_app/core/data_handler.py +536 -0
  33. scd_edition-0.1.0/src/scd_app/core/decomp_worker.py +569 -0
  34. scd_edition-0.1.0/src/scd_app/core/filter_recalculation.py +851 -0
  35. scd_edition-0.1.0/src/scd_app/core/mu_model.py +48 -0
  36. scd_edition-0.1.0/src/scd_app/core/mu_properties.py +711 -0
  37. scd_edition-0.1.0/src/scd_app/core/utils.py +16 -0
  38. scd_edition-0.1.0/src/scd_app/examples.py +26 -0
  39. scd_edition-0.1.0/src/scd_app/gui/__init__.py +0 -0
  40. scd_edition-0.1.0/src/scd_app/gui/main_window.py +381 -0
  41. scd_edition-0.1.0/src/scd_app/gui/style/__init__.py +0 -0
  42. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Figtree-Bold.ttf +0 -0
  43. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Figtree-Medium.ttf +0 -0
  44. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Figtree-Regular.ttf +0 -0
  45. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Figtree-SemiBold.ttf +0 -0
  46. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Inter-ExtraBold.ttf +0 -0
  47. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Inter-Medium.ttf +0 -0
  48. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Inter-Regular.ttf +0 -0
  49. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Inter-SemiBold.ttf +0 -0
  50. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Lexend-Black.ttf +0 -0
  51. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Lexend-Bold.ttf +0 -0
  52. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Lexend-ExtraBold.ttf +0 -0
  53. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Lexend-ExtraLight.ttf +0 -0
  54. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Lexend-Light.ttf +0 -0
  55. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Lexend-Medium.ttf +0 -0
  56. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Lexend-Regular.ttf +0 -0
  57. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Lexend-SemiBold.ttf +0 -0
  58. scd_edition-0.1.0/src/scd_app/gui/style/fonts/Lexend-Thin.ttf +0 -0
  59. scd_edition-0.1.0/src/scd_app/gui/style/styling.py +808 -0
  60. scd_edition-0.1.0/src/scd_app/gui/tabs/__init__.py +0 -0
  61. scd_edition-0.1.0/src/scd_app/gui/tabs/config_tab.py +2091 -0
  62. scd_edition-0.1.0/src/scd_app/gui/tabs/decomposition_tab.py +2492 -0
  63. scd_edition-0.1.0/src/scd_app/gui/tabs/edition_tab.py +3627 -0
  64. scd_edition-0.1.0/src/scd_app/gui/tabs/visualisation_tab.py +1055 -0
  65. scd_edition-0.1.0/src/scd_app/gui/widgets/__init__.py +0 -0
  66. scd_edition-0.1.0/src/scd_app/gui/widgets/import_data_dialog.py +142 -0
  67. scd_edition-0.1.0/src/scd_app/gui/widgets/mu_properties_panel.py +420 -0
  68. scd_edition-0.1.0/src/scd_app/gui/widgets/muap_popout.py +179 -0
  69. scd_edition-0.1.0/src/scd_app/gui/widgets/source_plot_widget.py +549 -0
  70. scd_edition-0.1.0/src/scd_app/io/__init__.py +5 -0
  71. scd_edition-0.1.0/src/scd_app/io/atomic_pickle.py +37 -0
  72. scd_edition-0.1.0/src/scd_app/io/data_inspector.py +235 -0
  73. scd_edition-0.1.0/src/scd_app/io/data_loader.py +619 -0
  74. scd_edition-0.1.0/src/scd_app/io/decomposition_loader.py +364 -0
  75. scd_edition-0.1.0/src/scd_app/io/otb4_loader.py +481 -0
  76. scd_edition-0.1.0/src/scd_app/io/portable_format.py +126 -0
  77. scd_edition-0.1.0/src/scd_app/io/rhs_loader.py +334 -0
  78. scd_edition-0.1.0/src/scd_app/main.py +12 -0
  79. scd_edition-0.1.0/src/scd_app/resources/examples/README.md +13 -0
  80. scd_edition-0.1.0/src/scd_app/resources/examples/emg.mat +0 -0
  81. scd_edition-0.1.0/src/scd_app/resources/examples/example_config.json +23 -0
  82. scd_edition-0.1.0/src/scd_app/resources/loaders_configs/loader_csv.yaml +13 -0
  83. scd_edition-0.1.0/src/scd_app/resources/loaders_configs/loader_h5.yaml +25 -0
  84. scd_edition-0.1.0/src/scd_app/resources/loaders_configs/loader_mat.yaml +20 -0
  85. scd_edition-0.1.0/src/scd_app/resources/loaders_configs/loader_npy.yaml +10 -0
  86. scd_edition-0.1.0/src/scd_app/resources/loaders_configs/loader_otb+.yaml +18 -0
  87. scd_edition-0.1.0/src/scd_app/resources/loaders_configs/loader_otb4.yaml +19 -0
  88. scd_edition-0.1.0/src/scd_app/resources/loaders_configs/loader_rhs.yaml +31 -0
  89. scd_edition-0.1.0/src/scd_app/resources/loaders_configs/loader_scd_h5.yaml +22 -0
  90. scd_edition-0.1.0/src/scd_app/resources/loaders_configs/loader_sim_hdf5.yaml +34 -0
  91. scd_edition-0.1.0/src/scd_edition.egg-info/PKG-INFO +708 -0
  92. scd_edition-0.1.0/src/scd_edition.egg-info/SOURCES.txt +102 -0
  93. scd_edition-0.1.0/src/scd_edition.egg-info/dependency_links.txt +1 -0
  94. scd_edition-0.1.0/src/scd_edition.egg-info/entry_points.txt +2 -0
  95. scd_edition-0.1.0/src/scd_edition.egg-info/requires.txt +22 -0
  96. scd_edition-0.1.0/src/scd_edition.egg-info/top_level.txt +1 -0
  97. scd_edition-0.1.0/tests/test_bundled_example.py +26 -0
  98. scd_edition-0.1.0/tests/test_data_import.py +196 -0
  99. scd_edition-0.1.0/tests/test_decomposition_loader.py +283 -0
  100. scd_edition-0.1.0/tests/test_gui_trustworthiness.py +197 -0
  101. scd_edition-0.1.0/tests/test_loader_selection.py +192 -0
  102. scd_edition-0.1.0/tests/test_mu_properties.py +92 -0
  103. scd_edition-0.1.0/tests/test_otb4_loader.py +180 -0
  104. scd_edition-0.1.0/tests/test_smoke.py +129 -0
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ All notable changes to SCD Edition are documented here.
4
+
5
+ ## 0.1.0 — 2026-09-19
6
+
7
+ First public release.
8
+
9
+ - Configure and decompose surface and intramuscular EMG recordings.
10
+ - Load OT Bioelettronica, Intan, MATLAB, HDF5, NumPy and CSV data.
11
+ - Inspect unfamiliar MATLAB/HDF5 layouts in the GUI and reuse the selected
12
+ array path and orientation through saved configurations.
13
+ - Convert proprietary recordings to a documented portable SCD HDF5 format.
14
+ - Review, edit, quality-check and save motor-unit spike trains.
15
+ - Visualise rasters, discharge rates, cumulative spike trains and quality metrics.
16
+ - Open raw Swarm-Contrastive Decomposition output for downstream editing.
17
+ - Include a configured example recording through `scd-edition --example`.
18
+ - Distribute a self-contained Windows application with tagged releases.
@@ -0,0 +1,66 @@
1
+ cff-version: 1.2.0
2
+ type: software
3
+ message: "If you use SCD Edition, please cite this software and the relevant method papers."
4
+ authors:
5
+ - family-names: "Grison"
6
+ given-names: "Agnese"
7
+ orcid: "https://orcid.org/0009-0001-5981-3589"
8
+ email: "agnese.grison@outlook.it"
9
+ affiliation: "Imperial College London"
10
+ title: "SCD Edition"
11
+ version: "0.1.0"
12
+ date-released: "2026-09-19"
13
+ license: BSD-3-Clause
14
+ repository-code: "https://github.com/AgneGris/scd-edition"
15
+ url: "https://github.com/AgneGris/scd-edition"
16
+ keywords:
17
+ - electromyography
18
+ - motor units
19
+ - signal decomposition
20
+ - spike editing
21
+ - neurophysiology
22
+ references:
23
+ - type: article
24
+ authors:
25
+ - family-names: "Grison"
26
+ given-names: "Agnese"
27
+ - family-names: "Clarke"
28
+ given-names: "Alexander Kenneth"
29
+ - family-names: "Muceli"
30
+ given-names: "Silvia"
31
+ - family-names: "Ibáñez"
32
+ given-names: "Jaime"
33
+ - family-names: "Kundu"
34
+ given-names: "Aritra"
35
+ - family-names: "Farina"
36
+ given-names: "Dario"
37
+ doi: "10.1109/TBME.2024.3446806"
38
+ journal: "IEEE Transactions on Biomedical Engineering"
39
+ title: "A Particle Swarm Optimised Independence Estimator for Blind Source Separation of Neurophysiological Time Series"
40
+ volume: "72"
41
+ issue: "1"
42
+ start: "227"
43
+ end: "237"
44
+ year: 2025
45
+ - type: article
46
+ authors:
47
+ - family-names: "Grison"
48
+ given-names: "Agnese"
49
+ - family-names: "Mendez Guerra"
50
+ given-names: "Irene"
51
+ - family-names: "Clarke"
52
+ given-names: "Alexander Kenneth"
53
+ - family-names: "Muceli"
54
+ given-names: "Silvia"
55
+ - family-names: "Ibáñez"
56
+ given-names: "Jaime"
57
+ - family-names: "Farina"
58
+ given-names: "Dario"
59
+ doi: "10.1113/JP287913"
60
+ journal: "The Journal of Physiology"
61
+ title: "Unlocking the full potential of high-density surface EMG: novel non-invasive high-yield motor unit decomposition"
62
+ volume: "603"
63
+ issue: "8"
64
+ start: "2281"
65
+ end: "2300"
66
+ year: 2025
@@ -0,0 +1,74 @@
1
+ # Contributing to SCD Edition
2
+
3
+ Thank you for helping improve SCD Edition. Bug reports, loader requests,
4
+ documentation improvements and focused pull requests are welcome.
5
+
6
+ ## Report a problem
7
+
8
+ Use the appropriate GitHub issue form. Include:
9
+
10
+ - SCD Edition version or commit;
11
+ - installation method, operating system and Python version;
12
+ - CPU or GPU model and, for CUDA problems, driver information;
13
+ - acquisition system and file format;
14
+ - exact steps, expected behaviour, actual behaviour and the complete traceback.
15
+
16
+ Do not upload participant recordings, identifying metadata or confidential lab
17
+ data to a public issue. If a minimal reproducer is necessary, use synthetic or
18
+ explicitly redistributable data.
19
+
20
+ ## Development setup
21
+
22
+ Install [uv](https://docs.astral.sh/uv/), clone the repository, and create an
23
+ environment using either the CPU or CUDA dependency source:
24
+
25
+ ```bash
26
+ uv sync --extra cpu
27
+ ```
28
+
29
+ ```bash
30
+ uv sync --extra cuda
31
+ ```
32
+
33
+ On Windows, add `--python 3.13 --managed-python` if the system Python comes
34
+ from Conda or otherwise causes Qt DLL conflicts.
35
+
36
+ Run the checks before opening a pull request:
37
+
38
+ ```bash
39
+ uv run ruff check src tests scripts docs
40
+ uv run ruff format --check src tests scripts docs
41
+ uv run pytest
42
+ ```
43
+
44
+ The GUI smoke tests run headlessly by setting `QT_QPA_PLATFORM=offscreen`.
45
+ Changes to loaders should include a small synthetic fixture and tests for
46
+ malformed input. Changes to scientific calculations should include numerical
47
+ regression tests and a clear source or rationale.
48
+
49
+ For a new acquisition format, first read the
50
+ [data-import guide](docs/importing-data.md). Generic MATLAB/HDF5 layouts should
51
+ use the inspector; a built-in loader is most useful when the format has stable
52
+ metadata, units and channel-order semantics that the generic path cannot
53
+ capture.
54
+
55
+ ## Pull requests
56
+
57
+ Keep each pull request focused. Explain the user-visible change, tests run and
58
+ any compatibility implications for existing `.pkl` sessions. Update the README
59
+ or quick-start when behaviour or supported formats change.
60
+
61
+ The files under `src/scd_app/_vendor/` come from Motor Unit Toolbox and should
62
+ not be edited casually. If they need updating, record the new upstream commit,
63
+ preserve its MIT licence, and compare the affected numerical outputs against
64
+ the previous version.
65
+
66
+ ## Releases
67
+
68
+ 1. Update the version in `pyproject.toml`, `CITATION.cff` and `CHANGELOG.md`.
69
+ 2. Run the full test suite and `python -m build` from a clean checkout.
70
+ 3. Run `python scripts/check_distribution.py`.
71
+ 4. Push a matching tag such as `v0.1.0`.
72
+ 5. Approve the protected `pypi` environment when the release workflow asks.
73
+ 6. After Zenodo archives the GitHub release, add its concept DOI to the README
74
+ and `CITATION.cff`.
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Agnese Grison and contributors
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice,
10
+ this list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,8 @@
1
+ include CITATION.cff
2
+ include CONTRIBUTING.md
3
+ include CHANGELOG.md
4
+ include SUPPORT.md
5
+ include THIRD_PARTY_NOTICES.md
6
+ recursive-include docs *.gif *.ipynb *.md
7
+ recursive-include scripts *.py
8
+ recursive-include src/scd_app/resources/examples *.json *.mat *.md