misleep 0.2.9__tar.gz → 0.2.11__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 (72) hide show
  1. {misleep-0.2.9 → misleep-0.2.11}/PKG-INFO +1 -1
  2. {misleep-0.2.9 → misleep-0.2.11}/misleep/config.ini +4 -5
  3. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/dialog.py +2 -2
  4. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/main_window.py +4 -4
  5. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/utils.py +10 -0
  6. {misleep-0.2.9 → misleep-0.2.11}/misleep.egg-info/PKG-INFO +1 -1
  7. {misleep-0.2.9 → misleep-0.2.11}/setup.py +1 -1
  8. misleep-0.2.9/test/__pycache__/test_annotation_io.cpython-38-pytest-8.3.5.pyc +0 -0
  9. {misleep-0.2.9 → misleep-0.2.11}/LICENSE +0 -0
  10. {misleep-0.2.9 → misleep-0.2.11}/README.md +0 -0
  11. {misleep-0.2.9 → misleep-0.2.11}/misleep/__init__.py +0 -0
  12. {misleep-0.2.9 → misleep-0.2.11}/misleep/__main__.py +0 -0
  13. {misleep-0.2.9 → misleep-0.2.11}/misleep/analysis/__init__.py +0 -0
  14. {misleep-0.2.9 → misleep-0.2.11}/misleep/analysis/auto_stage.py +0 -0
  15. {misleep-0.2.9 → misleep-0.2.11}/misleep/analysis/auto_stage_model/P30_EEG_F_lightgbm.pkl +0 -0
  16. {misleep-0.2.9 → misleep-0.2.11}/misleep/analysis/auto_stage_model/P30_EEG_P_lightgbm.pkl +0 -0
  17. {misleep-0.2.9 → misleep-0.2.11}/misleep/analysis/auto_stage_model/ado_EEG_F_lightgbm.pkl +0 -0
  18. {misleep-0.2.9 → misleep-0.2.11}/misleep/analysis/auto_stage_model/ado_EEG_P_lightgbm.pkl +0 -0
  19. {misleep-0.2.9 → misleep-0.2.11}/misleep/analysis/auto_stage_model/adult_EEG_F_lightgbm.pkl +0 -0
  20. {misleep-0.2.9 → misleep-0.2.11}/misleep/analysis/auto_stage_model/adult_EEG_P_lightgbm.pkl +0 -0
  21. {misleep-0.2.9 → misleep-0.2.11}/misleep/analysis/detection.py +0 -0
  22. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/__init__.py +0 -0
  23. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/about.py +0 -0
  24. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/resources/__init__.py +0 -0
  25. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/resources/entire_logo.png +0 -0
  26. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/resources/logo.png +0 -0
  27. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/resources/misleep.py +0 -0
  28. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/resources/misleep.qrc +0 -0
  29. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/show.py +0 -0
  30. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/spec_window.py +0 -0
  31. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/thread.py +0 -0
  32. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/SWA_detect_dialog_ui.py +0 -0
  33. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/__init__.py +0 -0
  34. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/about_ui.py +0 -0
  35. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/auto_stage_dialog_ui.py +0 -0
  36. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/horizontal_line_dialog_ui.py +0 -0
  37. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/label_dialog_ui.py +0 -0
  38. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/main_window_ui.py +0 -0
  39. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/save_data_dialog_ui.py +0 -0
  40. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/spec_window_ui.py +0 -0
  41. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/spindle_detect_dialog_ui.py +0 -0
  42. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/state_spectral_dialog_ui.py +0 -0
  43. {misleep-0.2.9 → misleep-0.2.11}/misleep/gui/uis/transfer_result_dialog_ui.py +0 -0
  44. {misleep-0.2.9 → misleep-0.2.11}/misleep/io/__init__.py +0 -0
  45. {misleep-0.2.9 → misleep-0.2.11}/misleep/io/annotation_io.py +0 -0
  46. {misleep-0.2.9 → misleep-0.2.11}/misleep/io/base.py +0 -0
  47. {misleep-0.2.9 → misleep-0.2.11}/misleep/io/signal_io.py +0 -0
  48. {misleep-0.2.9 → misleep-0.2.11}/misleep/preprocessing/__init__.py +0 -0
  49. {misleep-0.2.9 → misleep-0.2.11}/misleep/preprocessing/channel.py +0 -0
  50. {misleep-0.2.9 → misleep-0.2.11}/misleep/preprocessing/signals.py +0 -0
  51. {misleep-0.2.9 → misleep-0.2.11}/misleep/preprocessing/spectral.py +0 -0
  52. {misleep-0.2.9 → misleep-0.2.11}/misleep/utils/__init__.py +0 -0
  53. {misleep-0.2.9 → misleep-0.2.11}/misleep/utils/annotation.py +0 -0
  54. {misleep-0.2.9 → misleep-0.2.11}/misleep/utils/logger_handler.py +0 -0
  55. {misleep-0.2.9 → misleep-0.2.11}/misleep/utils/self_antropy.py +0 -0
  56. {misleep-0.2.9 → misleep-0.2.11}/misleep/utils/signals.py +0 -0
  57. {misleep-0.2.9 → misleep-0.2.11}/misleep/viz/__init__.py +0 -0
  58. {misleep-0.2.9 → misleep-0.2.11}/misleep/viz/hypnogram.py +0 -0
  59. {misleep-0.2.9 → misleep-0.2.11}/misleep/viz/signals.py +0 -0
  60. {misleep-0.2.9 → misleep-0.2.11}/misleep/viz/spectral.py +0 -0
  61. {misleep-0.2.9 → misleep-0.2.11}/misleep.egg-info/SOURCES.txt +0 -0
  62. {misleep-0.2.9 → misleep-0.2.11}/misleep.egg-info/dependency_links.txt +0 -0
  63. {misleep-0.2.9 → misleep-0.2.11}/misleep.egg-info/requires.txt +0 -0
  64. {misleep-0.2.9 → misleep-0.2.11}/misleep.egg-info/top_level.txt +0 -0
  65. {misleep-0.2.9 → misleep-0.2.11}/setup.cfg +0 -0
  66. {misleep-0.2.9 → misleep-0.2.11}/test/test_annotation_io.py +0 -0
  67. {misleep-0.2.9 → misleep-0.2.11}/test/test_loadmat73.py +0 -0
  68. {misleep-0.2.9 → misleep-0.2.11}/test/test_midata.py +0 -0
  69. {misleep-0.2.9 → misleep-0.2.11}/test/test_show.py +0 -0
  70. {misleep-0.2.9 → misleep-0.2.11}/test/test_signal_io.py +0 -0
  71. {misleep-0.2.9 → misleep-0.2.11}/test/test_signals_viz.py +0 -0
  72. {misleep-0.2.9 → misleep-0.2.11}/test/test_spectral_viz.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: misleep
3
- Version: 0.2.9
3
+ Version: 0.2.11
4
4
  Summary: MiSleep: Mice Sleep EEG/EMG visualization, scoring and analysis.
5
5
  Home-page: https://github.com/BryanWang0702/MiSleep/
6
6
  Download-URL: https://github.com/BryanWang0702/MiSleep/
@@ -1,7 +1,7 @@
1
1
  [gui]
2
- version = v0.2.9
3
- updatetime = 2025/4/23
4
- marker = ['half_signal', 'first REM', 'WindEEG', 'W-R ', 'maker']
2
+ version = v0.2.11
3
+ updatetime = 2025/7/14
4
+ marker = ['half_signal', 'first REM', 'WindEEG', 'W-R', 'maker']
5
5
  startend = ['burst-supression', 'REM', 'Wake', 'Spindle', 'SWA', 'start end label', 'start end label']
6
6
  statemap = {"1": "NREM", "2": "REM", "3": "Wake", "4": "INIT", "5": "IS", "6": "MicroArousal"}
7
7
  statecolor = {"1": "orange", "2": "skyblue", "3": "red", "4": "white", "5": "green", "6": "pink"}
@@ -9,5 +9,4 @@ startendcolor = {"NREM": "orange", "REM": "skyblue", "Wake": "red"}
9
9
  statecolorbgalpha = 0.1
10
10
  markerlinecolor = "red"
11
11
  startendlinecolor = "blue"
12
- openpath = D:
13
-
12
+ openpath = D:
@@ -27,7 +27,7 @@ from misleep.utils.signals import signal_filter
27
27
  from misleep.utils.annotation import lst2group
28
28
  from misleep.analysis.detection import SWA_detection, spindle_detection
29
29
  from misleep.analysis.auto_stage import auto_stage_gbm
30
- from misleep.gui.utils import cal_draw_spectrum
30
+ from misleep.gui.utils import cal_draw_spectrum, get_base_path
31
31
  from misleep.preprocessing.signals import reject_artifact
32
32
  import pandas as pd
33
33
  from copy import deepcopy
@@ -221,7 +221,7 @@ class transferResult_dialog(QDialog, Ui_TransferResultDialog):
221
221
  df, analyse_df, start_end_df, marker_df = transfer_result(mianno=mianno, ac_time=ac_time)
222
222
 
223
223
  fd, _ = QFileDialog.getSaveFileName(self, "Save transfered result",
224
- f"{config['gui']['openpath']}",
224
+ f"{get_base_path(config['gui']['openpath'])}",
225
225
  "*.xlsx;;")
226
226
  if fd == '':
227
227
  return
@@ -388,19 +388,19 @@ class main_window(QMainWindow, Ui_MiSleep):
388
388
 
389
389
  def load_anno(self):
390
390
  """Triggered by actionLoad_Annotation"""
391
- anno_path, _ = QFileDialog.getSaveFileName(
391
+ anno_path, _ = QFileDialog.getOpenFileName(
392
392
  self, "Select annotation file",
393
393
  f"{self.config['gui']['openpath']}",
394
394
  "txt Files (*.txt *.TXT)"
395
395
  )
396
396
 
397
+ if anno_path == "":
398
+ return
397
399
  if not os.path.exists(anno_path):
398
400
  # Create the file if it doesn't exist
399
401
  with open(anno_path, 'w') as file:
400
402
  file.write("")
401
403
 
402
- if anno_path == "":
403
- return
404
404
  self.anno_path = anno_path
405
405
  _mianno = self.mianno
406
406
 
@@ -1664,7 +1664,7 @@ class main_window(QMainWindow, Ui_MiSleep):
1664
1664
  For when I only want to save a file but not cover the current labels
1665
1665
  """
1666
1666
  if self.anno_path == "":
1667
- anno_path, _ = QFileDialog.getSaveFileName(
1667
+ anno_path, _ = QFileDialog.getOpenFileName(
1668
1668
  self, "Select annotation file",
1669
1669
  f"{self.config['gui']['openpath']}",
1670
1670
  "txt Files (*.txt *.TXT)"
@@ -187,3 +187,13 @@ def identify_startend_color(dict_, state_name, end=False):
187
187
  return dict_[state_name]
188
188
  else:
189
189
  return "blue"
190
+
191
+ def get_base_path(file_path):
192
+ """
193
+ Remove the final .txt or .xlsx part from a file path and return the directory.
194
+ """
195
+ import os
196
+ base, ext = os.path.splitext(file_path)
197
+ if ext in ['.txt', '.xlsx', '.mat', '.edf', '.csv']:
198
+ return base
199
+ return file_path
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: misleep
3
- Version: 0.2.9
3
+ Version: 0.2.11
4
4
  Summary: MiSleep: Mice Sleep EEG/EMG visualization, scoring and analysis.
5
5
  Home-page: https://github.com/BryanWang0702/MiSleep/
6
6
  Download-URL: https://github.com/BryanWang0702/MiSleep/
@@ -11,7 +11,7 @@ MAINTAINER_EMAIL = "swang@gmail.com"
11
11
  URL = "https://github.com/BryanWang0702/MiSleep/"
12
12
  LICENSE = "BSD (3-clause)"
13
13
  DOWNLOAD_URL = "https://github.com/BryanWang0702/MiSleep/"
14
- VERSION = "0.2.9"
14
+ VERSION = "0.2.11"
15
15
 
16
16
  INSTALL_REQUIRES = [
17
17
  "numpy>=1.18.1",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes