accusleepy 0.4.3__py3-none-any.whl → 0.4.5__py3-none-any.whl

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.
Binary file
accusleepy/gui/main.py CHANGED
@@ -51,7 +51,7 @@ from accusleepy.signal_processing import (
51
51
  )
52
52
 
53
53
  # max number of messages to display
54
- MESSAGE_BOX_MAX_DEPTH = 50
54
+ MESSAGE_BOX_MAX_DEPTH = 200
55
55
  LABEL_LENGTH_ERROR = "label file length does not match recording length"
56
56
  # relative path to config guide txt file
57
57
  CONFIG_GUIDE_FILE = os.path.normpath(r"text/config_guide.txt")
@@ -294,7 +294,7 @@ class AccuSleepWindow(QtWidgets.QMainWindow):
294
294
  error_message = self.check_single_file_inputs(recording_index)
295
295
  if error_message:
296
296
  self.show_message(
297
- f"ERROR ({self.recordings[recording_index].name}): {error_message}"
297
+ f"ERROR (recording {self.recordings[recording_index].name}): {error_message}"
298
298
  )
299
299
  return
300
300
 
@@ -431,7 +431,7 @@ class AccuSleepWindow(QtWidgets.QMainWindow):
431
431
  f"error on recording {self.recordings[recording_index].name}"
432
432
  )
433
433
  self.show_message(
434
- f"ERROR ({self.recordings[recording_index].name}): {error_message}"
434
+ f"ERROR (recording {self.recordings[recording_index].name}): {error_message}"
435
435
  )
436
436
  return
437
437
  if self.recordings[recording_index].calibration_file == "":
@@ -440,7 +440,7 @@ class AccuSleepWindow(QtWidgets.QMainWindow):
440
440
  )
441
441
  self.show_message(
442
442
  (
443
- f"ERROR ({self.recordings[recording_index].name}): "
443
+ f"ERROR (recording {self.recordings[recording_index].name}): "
444
444
  "no calibration file selected"
445
445
  )
446
446
  )
@@ -752,7 +752,7 @@ class AccuSleepWindow(QtWidgets.QMainWindow):
752
752
  self.recordings[self.recording_index].calibration_file = filename
753
753
  self.ui.calibration_file_label.setText(filename)
754
754
 
755
- def check_single_file_inputs(self, recording_index: int) -> str:
755
+ def check_single_file_inputs(self, recording_index: int) -> str | None:
756
756
  """Check that a recording's inputs appear valid
757
757
 
758
758
  This runs some basic tests for whether it will be possible to
@@ -772,6 +772,8 @@ class AccuSleepWindow(QtWidgets.QMainWindow):
772
772
  return "invalid epoch length or sampling rate"
773
773
  if self.recordings[self.recording_index].recording_file == "":
774
774
  return "no recording selected"
775
+ if not os.path.isfile(self.recordings[self.recording_index].recording_file):
776
+ return "recording file does not exist"
775
777
  if self.recordings[self.recording_index].label_file == "":
776
778
  return "no label file selected"
777
779
 
@@ -446,8 +446,6 @@ class ManualScoringWindow(QtWidgets.QDialog):
446
446
  self.label_img = create_label_img(
447
447
  self.display_labels, self.label_display_options
448
448
  )
449
- # update the plots
450
- self.update_figures()
451
449
 
452
450
  def redo(self) -> None:
453
451
  """Redo the last change to brain state labels that was undone"""
@@ -716,7 +714,6 @@ class ManualScoringWindow(QtWidgets.QDialog):
716
714
  self.ui.upperfigure.canvas.axes[2].set_xlim(
717
715
  (self.upper_left_epoch, self.upper_right_epoch + 1)
718
716
  )
719
- self.ui.upperfigure.canvas.draw()
720
717
 
721
718
  def zoom_x(self, direction: str) -> None:
722
719
  """Change upper figure x-axis zoom level
@@ -754,6 +751,7 @@ class ManualScoringWindow(QtWidgets.QDialog):
754
751
  self.upper_left_epoch = 0
755
752
  self.upper_right_epoch = self.n_epochs - 1
756
753
  self.adjust_upper_figure_x_limits()
754
+ self.ui.upperfigure.canvas.draw()
757
755
 
758
756
  def modify_current_epoch_label(self, digit: int) -> None:
759
757
  """Change the current epoch's brain state label
@@ -974,8 +972,6 @@ class ManualScoringWindow(QtWidgets.QDialog):
974
972
  else:
975
973
  self.upper_left_epoch = self.epoch - upper_epoch_padding
976
974
  self.upper_right_epoch = self.epoch + upper_epoch_padding
977
- # update upper marker
978
- self.update_upper_marker()
979
975
  self.adjust_upper_figure_x_limits()
980
976
 
981
977
  # update lower figure x-axis range
@@ -990,7 +986,7 @@ class ManualScoringWindow(QtWidgets.QDialog):
990
986
  self.lower_left_epoch = self.epoch - lower_epoch_padding
991
987
  self.lower_right_epoch = self.epoch + lower_epoch_padding
992
988
 
993
- self.update_lower_figure()
989
+ self.update_figures()
994
990
 
995
991
 
996
992
  def convert_labels(labels: np.array, style: str) -> np.array:
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: accusleepy
3
- Version: 0.4.3
3
+ Version: 0.4.5
4
4
  Summary: Python implementation of AccuSleep
5
5
  License: GPL-3.0-only
6
6
  Author: Zeke Barger
7
7
  Author-email: zekebarger@gmail.com
8
- Requires-Python: >=3.10,<3.13
8
+ Requires-Python: >=3.11,<3.14
9
9
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
10
  Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
13
12
  Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
14
  Requires-Dist: fastparquet (>=2024.11.0,<2025.0.0)
15
15
  Requires-Dist: joblib (>=1.4.2,<2.0.0)
16
16
  Requires-Dist: matplotlib (>=3.10.1,<4.0.0)
@@ -18,7 +18,7 @@ Requires-Dist: numpy (>=2.2.4,<3.0.0)
18
18
  Requires-Dist: pandas (>=2.2.3,<3.0.0)
19
19
  Requires-Dist: pillow (>=11.1.0,<12.0.0)
20
20
  Requires-Dist: pre-commit (>=4.2.0,<5.0.0)
21
- Requires-Dist: pyside6 (>=6.7.1,<6.8.0)
21
+ Requires-Dist: pyside6 (>=6.9.0,<7.0.0)
22
22
  Requires-Dist: scipy (>=1.15.2,<2.0.0)
23
23
  Requires-Dist: toml (>=0.10.2,<0.11.0)
24
24
  Requires-Dist: torch (>=2.6.0,<3.0.0)
@@ -30,9 +30,17 @@ Description-Content-Type: text/markdown
30
30
 
31
31
  ## Description
32
32
 
33
- AccuSleePy is a python implementation of AccuSleep--a set of graphical user interfaces for scoring rodent
34
- sleep using EEG and EMG recordings. It offers several improvements over the original MATLAB version
35
- and is the only version that will be actively maintained.
33
+ AccuSleePy is set of graphical user interfaces for scoring rodent sleep
34
+ using EEG and EMG recordings.
35
+ It offers the following improvements over the MATLAB version (AccuSleep):
36
+
37
+ - Up to 10 brain states can be configured through the user interface
38
+ - Classification models can be trained through the user interface
39
+ - Model files contain useful metadata (brain state configuration,
40
+ epoch length, number of epochs)
41
+ - Models optimized for real-time scoring can be trained
42
+ - Lists of recordings can be imported and exported for repeatable batch processing
43
+ - Undo/redo functionality in the manual scoring interface
36
44
 
37
45
  If you use AccuSleep in your research, please cite our
38
46
  [publication](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0224642):
@@ -43,16 +51,20 @@ The data and models associated with AccuSleep are available at https://osf.io/py
43
51
 
44
52
  Please contact zekebarger (at) gmail (dot) com with any questions or comments about the software.
45
53
 
54
+
46
55
  ## Installation
47
56
 
48
57
  - (recommended) create a new virtual environment (using
49
58
  [venv](https://docs.python.org/3/library/venv.html),
50
59
  [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html),
51
- etc.) using python >=3.10,<3.13
60
+ etc.) with python >=3.11,<3.14
52
61
  - (optional) if you have a CUDA device and want to speed up model training, [install PyTorch](https://pytorch.org/)
53
62
  - `pip install accusleepy`
54
63
  - (optional) download a classification model from https://osf.io/py5eb/ under /python_format/models/
55
64
 
65
+ Note that upgrading or reinstalling the package will overwrite any changes
66
+ to the [config file](accusleepy/config.json).
67
+
56
68
  ## Usage
57
69
 
58
70
  `python -m accusleepy` will open the primary interface.
@@ -61,7 +73,16 @@ etc.) using python >=3.10,<3.13
61
73
 
62
74
  [Guide to the manual scoring interface](accusleepy/gui/text/manual_scoring_guide.md)
63
75
 
76
+ ## Changelog
77
+
78
+ - 0.4.5: Added support for python 3.13, **removed support for python 3.10.**
79
+ - 0.4.4: Performance improvements
80
+ - 0.4.3: Improved unit tests and user manuals
81
+ - 0.4.0: Improved visuals and user manuals
82
+ - 0.1.0-0.3.1: Early development versions
83
+
64
84
  ## Screenshots
85
+
65
86
  Primary interface
66
87
  ![AccuSleePy primary interface](accusleepy/gui/images/primary_window.png)
67
88
 
@@ -17,11 +17,11 @@ accusleepy/gui/icons/save.png,sha256=J3EA8iU1BqLYRSsrq_OdoZlqrv2yfL7oV54DklTy_DI
17
17
  accusleepy/gui/icons/up_arrow.png,sha256=V9yF9t1WgjPaUu-mF1YGe_DfaRHg2dUpR_sUVVcvVvY,3329
18
18
  accusleepy/gui/icons/zoom_in.png,sha256=MFWnKZp7Rvh4bLPq4Cqo4sB_jQYedUUtT8-ZO8tNYyc,13589
19
19
  accusleepy/gui/icons/zoom_out.png,sha256=IB8Jecb3i0U4qjWRR46ridjLpvLCSe7PozBaLqQqYSw,13055
20
- accusleepy/gui/images/primary_window.png,sha256=bT-A7ZPndVnJv3cX5DuzDwcZ44alz3GGIy7MxU0rtiA,593548
20
+ accusleepy/gui/images/primary_window.png,sha256=x_ppmv0fKySxXAzbQHCv5JFLdM2ETTxJqUHyPVo5xck,596421
21
21
  accusleepy/gui/images/viewer_window.png,sha256=gKwIXkgsl1rTMfmMeMwNyjEAUL5I6FXk9-hpMR92qTI,970630
22
22
  accusleepy/gui/images/viewer_window_annotated.png,sha256=M5NmoWDHRLS334Rp8SsfOPUUXzPltH1p7aB0BrISgQU,261481
23
- accusleepy/gui/main.py,sha256=GTHsUL9UPosDwzy86ohLj0Tok1OkqYBSl0Ba8Saq2Xs,54210
24
- accusleepy/gui/manual_scoring.py,sha256=l1m7MIY2SgNAYJFe7_hrvQUcZ2w7r5U82iX1dab86LI,40623
23
+ accusleepy/gui/main.py,sha256=QLtxVvBz81CjDeBddJZNDCLd207j9WJga1n45nlsxWI,54384
24
+ accusleepy/gui/manual_scoring.py,sha256=Sy4vwMmMLY_SreXUyxd0t-at2F-1pHkvvz1UGIbzVic,40496
25
25
  accusleepy/gui/mplwidget.py,sha256=f9O3u_96whQGUwpi3o_QGc7yjiETX5vE0oj3ePXTJWE,12279
26
26
  accusleepy/gui/primary_window.py,sha256=RXpDvcb7zy8Ea4Da1VhMG1T6GC54KW3vyGjqqQJN45k,104582
27
27
  accusleepy/gui/primary_window.ui,sha256=09k4xFcjgOL9mlhFlg6mXCc_tgj4_FY9CZ3H03e3z3A,147074
@@ -35,6 +35,6 @@ accusleepy/gui/viewer_window.ui,sha256=D1LwUFR-kZ_GWGZFFtXvGJdFWghLrOWZTblQeLQt9
35
35
  accusleepy/models.py,sha256=Muapsw088AUHqRIbW97Rkbv0oiwCtQvO9tEoBCC-MYg,1476
36
36
  accusleepy/multitaper.py,sha256=V6MJDk0OSWhg2MFhrnt9dvYrHiNsk2T7IxAA7paZVyE,25549
37
37
  accusleepy/signal_processing.py,sha256=-aXnywfp1LBsk3DcbIMmZlgv3f8j6sZ6js0bizZId0o,21718
38
- accusleepy-0.4.3.dist-info/METADATA,sha256=ooPrsNpkjVtzsWovyX30OW5qlcQgOW1bs1P7sHA3UDc,3137
39
- accusleepy-0.4.3.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
40
- accusleepy-0.4.3.dist-info/RECORD,,
38
+ accusleepy-0.4.5.dist-info/METADATA,sha256=qKYYF4smvfZF2l92BjYNpDyT6mB6QTqg10kw4MAxtRU,3875
39
+ accusleepy-0.4.5.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
40
+ accusleepy-0.4.5.dist-info/RECORD,,