lunapi 1.2.3__cp39-cp39-win_amd64.whl → 1.3.1__cp39-cp39-win_amd64.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
lunapi/lunapi0.cpp CHANGED
@@ -50,6 +50,39 @@ PYBIND11_MODULE(lunapi0, m) {
50
50
  m.def( "version" ,
51
51
  &lunapi_t::version ,
52
52
  "Version of Luna" );
53
+
54
+ m.def( "fetch_doms" ,
55
+ &lunapi_t::fetch_doms ,
56
+ "Fetch all command domains" );
57
+ m.def( "fetch_cmds" ,
58
+ &lunapi_t::fetch_cmds ,
59
+ "Fetch all commands" );
60
+ m.def( "fetch_params" ,
61
+ &lunapi_t::fetch_params ,
62
+ "Fetch all parameters for a command" );
63
+ m.def( "fetch_tbls" ,
64
+ &lunapi_t::fetch_tbls ,
65
+ "Fetch all tables for a command" );
66
+ m.def( "fetch_vars" ,
67
+ &lunapi_t::fetch_vars ,
68
+ "Fetch all variables for a command/table" );
69
+
70
+ m.def( "fetch_desc_dom" ,
71
+ &lunapi_t::fetch_desc_dom ,
72
+ "Description for a domain" );
73
+ m.def( "fetch_desc_cmd" ,
74
+ &lunapi_t::fetch_desc_cmd ,
75
+ "Description for a command" );
76
+ m.def( "fetch_desc_param" ,
77
+ &lunapi_t::fetch_desc_param ,
78
+ "Description for a command/parameter" );
79
+ m.def( "fetch_desc_tbl" ,
80
+ &lunapi_t::fetch_desc_tbl ,
81
+ "Description for a command/table" );
82
+ m.def( "fetch_desc_var" ,
83
+ &lunapi_t::fetch_desc_var ,
84
+ "Description for a command/table/variable" );
85
+
53
86
 
54
87
  //
55
88
  // lunapi_t engine class
@@ -63,6 +96,9 @@ PYBIND11_MODULE(lunapi0, m) {
63
96
  .def( "build_sample_list" ,
64
97
  &lunapi_t::build_sample_list,
65
98
  "Load a sample list from a file" )
99
+ .def( "set_sample_list",
100
+ &lunapi_t::set_sample_list,
101
+ "Set sample list directly" )
66
102
  .def( "get_sample_list" ,
67
103
  &lunapi_t::sample_list,
68
104
  "Return the loaded sample list" )
@@ -77,7 +113,7 @@ PYBIND11_MODULE(lunapi0, m) {
77
113
  .def( "is_silenced" , &lunapi_t::is_silenced )
78
114
 
79
115
  .def( "flush" , &lunapi_t::flush )
80
-
116
+ .def( "reinit" , &lunapi_t::re_init )
81
117
  .def( "reset" , &lunapi_t::reset )
82
118
 
83
119
  .def( "include" ,
@@ -165,6 +201,9 @@ PYBIND11_MODULE(lunapi0, m) {
165
201
 
166
202
  .def("tables",py::overload_cast<>(&lunapi_t::results,py::const_) ,
167
203
  "Return a result table (defined by a command/strata pair) from a prior eval()" );
204
+
205
+
206
+
168
207
 
169
208
  //
170
209
  // lunapi_inst_t : individual instance (EDF/annotation pair)
@@ -306,6 +345,7 @@ PYBIND11_MODULE(lunapi0, m) {
306
345
  .def( "get_time_scale", &segsrv_t::get_time_scale )
307
346
  .def( "set_scaling", &segsrv_t::set_scaling )
308
347
  .def( "fix_physical_scale", &segsrv_t::fix_physical_scale )
348
+ .def( "empirical_physical_scale", &segsrv_t::empirical_physical_scale )
309
349
  .def( "free_physical_scale", &segsrv_t::free_physical_scale )
310
350
  .def( "get_scaled_signal", &segsrv_t::get_scaled_signal )
311
351
  .def( "get_gaps" , &segsrv_t::get_gaps )
@@ -341,6 +381,9 @@ PYBIND11_MODULE(lunapi0, m) {
341
381
  .def( "compile_evts" , &segsrv_t::compile_evts )
342
382
  .def( "get_evnts_xaxes" , &segsrv_t::get_evnts_xaxes )
343
383
  .def( "get_evnts_yaxes" , &segsrv_t::get_evnts_yaxes )
384
+ .def( "set_evnt_format6" , &segsrv_t::set_annot_format6 )
385
+ .def( "get_evnts_xaxes_ends" , &segsrv_t::get_evnts_xaxes_ends )
386
+ .def( "get_evnts_yaxes_ends" , &segsrv_t::get_evnts_yaxes_ends )
344
387
  .def( "fetch_all_annots", &segsrv_t::fetch_all_evts )
345
388
  .def( "fetch_annots" , &segsrv_t::fetch_evts );
346
389
 
lunapi/lunapi1.py CHANGED
@@ -1,7 +1,7 @@
1
1
  """lunapi1 module: a high-level wrapper around lunapi0 module functions"""
2
2
 
3
3
  # Luna Python interface (lunapi)
4
- # v1.2.3, 28-May-2025
4
+ # v1.3.1, 16-Sep-2025
5
5
 
6
6
  import lunapi.lunapi0 as _luna
7
7
 
@@ -33,7 +33,7 @@ class resources:
33
33
  POPS_LIB = 's2'
34
34
  MODEL_PATH = '/build/luna-models/'
35
35
 
36
- lp_version = "v1.2.3"
36
+ lp_version = "v1.3.1"
37
37
 
38
38
  # C++ singleton class (engine & sample list)
39
39
  # lunapi_t --> luna
@@ -177,6 +177,10 @@ class proj:
177
177
  """ Drop Luna problem flag """
178
178
  proj.eng.reset()
179
179
 
180
+ def reinit(self):
181
+ """ Re-initialize project """
182
+ proj.eng.reinit()
183
+
180
184
  #------------------------------------------------------------------------
181
185
 
182
186
  def inst( self, n ):
@@ -1196,6 +1200,47 @@ class inst:
1196
1200
  # --------------------------------------------------------------------------------
1197
1201
 
1198
1202
 
1203
+ def fetch_doms():
1204
+ """Fetch all command domains"""
1205
+ return _luna.fetch_doms( True )
1206
+
1207
+ def fetch_cmds( dom ):
1208
+ """Fetch all commands"""
1209
+ return _luna.fetch_cmds( dom, True )
1210
+
1211
+ def fetch_params( cmd ):
1212
+ """Fetch all command parameters"""
1213
+ return _luna.fetch_params( cmd, True )
1214
+
1215
+ def fetch_tbls( cmd ):
1216
+ """Fetch all command tables"""
1217
+ return _luna.fetch_tbls( cmd, True )
1218
+
1219
+ def fetch_vars( cmd, tbl ):
1220
+ """Fetch all command/table variables"""
1221
+ return _luna.fetch_vars( cmd, tbl, True )
1222
+
1223
+ def fetch_desc_dom( dom ):
1224
+ """Description for a domain"""
1225
+ return _luna.fetch_desc_dom( dom )
1226
+
1227
+ def fetch_desc_cmd( cmd ):
1228
+ """Description for a command"""
1229
+ return _luna.fetch_desc_cmd( cmd )
1230
+
1231
+ def fetch_desc_param( cmd , param ):
1232
+ """Description for a command/parameter"""
1233
+ return _luna.fetch_desc_param( cmd, param )
1234
+
1235
+ def fetch_desc_tbl( cmd , tbl ):
1236
+ """Description for a command/table"""
1237
+ return _luna.fetch_desc_tbl( cmd, tbl )
1238
+
1239
+ def fetch_desc_var( cmd, tbl, var ):
1240
+ """Fetch all command/table variable"""
1241
+ return _luna.fetch_desc_var( cmd, tbl, var )
1242
+
1243
+
1199
1244
  # --------------------------------------------------------------------------------
1200
1245
  def cmdfile( f ):
1201
1246
  """load and parse a Luna command script from a file"""
@@ -1622,8 +1667,8 @@ class segsrv:
1622
1667
  def get_gaps(self):
1623
1668
  return self.segsrv.get_gaps()
1624
1669
 
1625
- def set_scaling(self, nchs, nanns = 0 , yscale = 1 , ygroup = 1 , yheader = 0.05 , yfooter = 0.05 , scaling_fixed_annot = 0.1 ):
1626
- self.segsrv.set_scaling( nchs, nanns, yscale, ygroup, yheader, yfooter, scaling_fixed_annot )
1670
+ def set_scaling(self, nchs, nanns = 0 , yscale = 1 , ygroup = 1 , yheader = 0.05 , yfooter = 0.05 , scaling_fixed_annot = 0.1 , clip = True):
1671
+ self.segsrv.set_scaling( nchs, nanns, yscale, ygroup, yheader, yfooter, scaling_fixed_annot , clip )
1627
1672
 
1628
1673
  def get_scaled_signal(self, ch, n1):
1629
1674
  return self.segsrv.get_scaled_signal( ch , n1 )
@@ -1631,8 +1676,11 @@ class segsrv:
1631
1676
  def fix_physical_scale(self,ch,lwr,upr):
1632
1677
  self.segsrv.fix_physical_scale( ch, lwr, upr )
1633
1678
 
1679
+ def empirical_physical_scale(self,ch):
1680
+ self.segsrv.empirical_physical_scale( ch )
1681
+
1634
1682
  def free_physical_scale( self, ch ):
1635
- self.segsrv.free_physical_scal( ch )
1683
+ self.segsrv.free_physical_scale( ch )
1636
1684
 
1637
1685
  def set_epoch_size( self, s ):
1638
1686
  self.segsrv.set_epoch_size( s )
@@ -1726,6 +1774,14 @@ class segsrv:
1726
1774
  def get_annots_yaxes(self,ann):
1727
1775
  return self.segsrv.get_evnts_yaxes( ann )
1728
1776
 
1777
+ def set_annot_format6(self,b):
1778
+ self.segsrv.set_evnt_format6(b)
1779
+
1780
+ def get_annots_xaxes_ends(self,ann):
1781
+ return self.segsrv.get_evnts_xaxes_ends( ann )
1782
+
1783
+ def get_annots_yaxes_ends(self,ann):
1784
+ return self.segsrv.get_evnts_yaxes_ends( ann )
1729
1785
 
1730
1786
 
1731
1787
 
@@ -1813,7 +1869,6 @@ def scope( p,
1813
1869
  for key, value in anncols.items(): apalette[ key ] = value
1814
1870
 
1815
1871
 
1816
-
1817
1872
  # define widgets
1818
1873
 
1819
1874
  wlay1 = widgets.Layout( width='95%' )
@@ -2180,8 +2235,8 @@ def scope( p,
2180
2235
  g.data[ gidx ].visible = True
2181
2236
 
2182
2237
  def rescale(change):
2183
- ss.set_scaling( len(chbox.value) , len( anbox.value) , 2**float(yscale.value) , float(yspace.value) , header_height, footer_height , annot_height )
2184
- redraw()
2238
+ ss.set_scaling( len(chbox.value) , len( anbox.value) , 2**float(yscale.value) , float(yspace.value) , header_height, footer_height , annot_height )
2239
+ redraw()
2185
2240
 
2186
2241
  def update_bandpower(change):
2187
2242
  if pow_sel.value is None: return
@@ -2418,7 +2473,7 @@ class moonbeam:
2418
2473
  self.pull_file( self.curr_edf )
2419
2474
 
2420
2475
  # EDFZ .idx
2421
- if re.search('\.edf\.gz$',self.curr_edf,re.IGNORECASE) or re.search('\.edfz$',self.curr_edf,re.IGNORECASE):
2476
+ if re.search(r'\.edf\.gz$',self.curr_edf,re.IGNORECASE) or re.search(r'\.edfz$',self.curr_edf,re.IGNORECASE):
2422
2477
  self.pull_file( self.curr_edf + '.idx' )
2423
2478
 
2424
2479
  # annots (optional)
@@ -2487,3 +2542,5 @@ class moonbeam:
2487
2542
  df = pd.concat( [ df1 , df2 ] )
2488
2543
  return df
2489
2544
 
2545
+
2546
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: lunapi
3
- Version: 1.2.3
3
+ Version: 1.3.1
4
4
  Summary: Python interface to the Luna toolset for sleep signal analysis
5
5
  Keywords: Sleep,EEG,PSG,Luna,Signal processing
6
6
  Author-Email: Shaun Purcell <smpurcell@bwh.harvard.edu>, Senthil Palanivelu <spalanivelu@mgh.harvard.edu>, Nataliia Kozhemiako <nkozhemiako@bwh.harvard.edu>
@@ -0,0 +1,11 @@
1
+ lunapi/__init__.py,sha256=nS9DWcqZhxTvOJl7tDfbgO7XxZpDiFLjHJNfL8uPBQg,365
2
+ lunapi/libfftw3-3.dll,sha256=ABqDXS8lrAZhWA1n21YiFXwoSBwGp_PvRa2TmDm_VKE,2712765
3
+ lunapi/libfftw3f-3.dll,sha256=QsoY__Nd0SiQ4ER4vJkABbOWnLdE9oQ5dr1DbM1_Ckw,2772692
4
+ lunapi/libfftw3l-3.dll,sha256=znj80YZuel6-w_3VCzx81YxzgFnRaHetAWSbclu3Kpo,1247967
5
+ lunapi/lunapi0.cp39-win_amd64.pyd,sha256=Xa7xCQQb5VliNPKxOM_08s0IYgZk_0a4U4UbDaA6Szk,14144512
6
+ lunapi/lunapi0.cpp,sha256=Mf9jKOMnhP_2yw3-NahjXQMTIeBCPbAVutv36fy4D_o,14862
7
+ lunapi/lunapi1.py,sha256=-kAI1rOPuoy4cf1OT0qfLzmHAn_PT6DMYhCiKWv8Tk4,96626
8
+ lunapi-1.3.1.dist-info/METADATA,sha256=uWaw2hLPqyIKYrSqBxMVk6ij13Q2fSOidrgm6lCYLNc,1519
9
+ lunapi-1.3.1.dist-info/WHEEL,sha256=9tsL4JT94eZPTkcS3bNng2riasYJMxXndrO9CxUfJHs,104
10
+ lunapi-1.3.1.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
11
+ lunapi-1.3.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: scikit-build-core 0.11.4
2
+ Generator: scikit-build-core 0.11.6
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp39-cp39-win_amd64
5
5
 
@@ -1,11 +0,0 @@
1
- lunapi/__init__.py,sha256=nS9DWcqZhxTvOJl7tDfbgO7XxZpDiFLjHJNfL8uPBQg,365
2
- lunapi/libfftw3-3.dll,sha256=ABqDXS8lrAZhWA1n21YiFXwoSBwGp_PvRa2TmDm_VKE,2712765
3
- lunapi/libfftw3f-3.dll,sha256=QsoY__Nd0SiQ4ER4vJkABbOWnLdE9oQ5dr1DbM1_Ckw,2772692
4
- lunapi/libfftw3l-3.dll,sha256=znj80YZuel6-w_3VCzx81YxzgFnRaHetAWSbclu3Kpo,1247967
5
- lunapi/lunapi0.cp39-win_amd64.pyd,sha256=fu33ebmVlo-u1K7ymI_pNmwEriGIANr7bm453hhTq4o,13982720
6
- lunapi/lunapi0.cpp,sha256=VkKdaWPBjBABoiJwZnwzMos3wcxq_4WE4arYKxubLYI,13401
7
- lunapi/lunapi1.py,sha256=qmqc0TnQZnq-af73CNExuE0ZrFFRdjiwp0wTjPjy1vg,95026
8
- lunapi-1.2.3.dist-info/METADATA,sha256=CJCsb2ZSt6h8oYb2K_Hx4khWZBrxZQauka_HcDp4O54,1519
9
- lunapi-1.2.3.dist-info/WHEEL,sha256=nQatVKo2rw08GSeN7K3PdwAKbUWShD3jKtph6XueFF0,104
10
- lunapi-1.2.3.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
11
- lunapi-1.2.3.dist-info/RECORD,,