figpack 0.2.25__py3-none-any.whl → 0.2.27__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.
@@ -9,7 +9,7 @@
9
9
  // Allow script injection from trusted domains (see src/main.tsx)
10
10
  window.script_injection_allowed_domains = ['https://manage.figpack.org', 'https://figpack.org'];
11
11
  </script>
12
- <script type="module" crossorigin src="./assets/index-CLEO_r6_.js"></script>
12
+ <script type="module" crossorigin src="./assets/index-DnHZdWys.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="./assets/index-V5m_wCvw.css">
14
14
  </head>
15
15
  <body>
@@ -135,6 +135,8 @@ class TimeseriesGraph(FigpackView):
135
135
  channel_names: Optional[List[str]] = None,
136
136
  colors: Optional[List[str]] = None,
137
137
  width: float = 1.0,
138
+ channel_spacing: Optional[float] = None,
139
+ auto_channel_spacing: Optional[float] = None,
138
140
  ) -> None:
139
141
  """
140
142
  Add a uniform timeseries to the graph with optional multi-channel support
@@ -147,6 +149,8 @@ class TimeseriesGraph(FigpackView):
147
149
  channel_names: Optional list of channel names
148
150
  colors: Optional list of colors for each channel
149
151
  width: Line width
152
+ channel_spacing: Vertical spacing between channels
153
+ auto_channel_spacing: sets channel spacing to this multiple of the estimated RMS noise level
150
154
  """
151
155
  self._series.append(
152
156
  TGUniformSeries(
@@ -157,6 +161,8 @@ class TimeseriesGraph(FigpackView):
157
161
  channel_names=channel_names,
158
162
  colors=colors,
159
163
  width=width,
164
+ channel_spacing=channel_spacing,
165
+ auto_channel_spacing=auto_channel_spacing,
160
166
  )
161
167
  )
162
168
 
@@ -312,6 +318,8 @@ class TGUniformSeries:
312
318
  channel_names: Optional[List[str]] = None,
313
319
  colors: Optional[List[str]] = None,
314
320
  width: float = 1.0,
321
+ channel_spacing: Optional[float] = None,
322
+ auto_channel_spacing: Optional[float] = None,
315
323
  ):
316
324
  assert sampling_frequency_hz > 0, "Sampling frequency must be positive"
317
325
 
@@ -332,6 +340,19 @@ class TGUniformSeries:
332
340
  self.sampling_frequency_hz = sampling_frequency_hz
333
341
  self.data = data.astype(np.float32) # Ensure float32 for efficiency
334
342
 
343
+ if auto_channel_spacing is not None:
344
+ if channel_spacing is not None:
345
+ raise ValueError(
346
+ "Specify either channel_spacing or auto_channel_spacing, not both."
347
+ )
348
+ # Estimate RMS noise level across all channels using median absolute deviation
349
+ mad = np.median(np.abs(self.data - np.median(self.data, axis=0)), axis=0)
350
+ rms_estimate = mad / 0.6745 # Convert MAD to RMS estimate
351
+ channel_spacing = auto_channel_spacing * np.median(rms_estimate)
352
+ if channel_spacing <= 0:
353
+ channel_spacing = 1.0 # Fallback to default spacing if estimate fails
354
+ self.channel_spacing = channel_spacing
355
+
335
356
  # Set channel names
336
357
  if channel_names is None:
337
358
  if n_channels == 1:
@@ -512,6 +533,9 @@ class TGUniformSeries:
512
533
  group.attrs["n_timepoints"] = n_timepoints
513
534
  group.attrs["n_channels"] = n_channels
514
535
 
536
+ if self.channel_spacing is not None:
537
+ group.attrs["channel_spacing"] = self.channel_spacing
538
+
515
539
  # Store original data with optimal chunking
516
540
  original_chunks = self._calculate_optimal_chunk_size(self.data.shape)
517
541
  group.create_dataset(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: figpack
3
- Version: 0.2.25
3
+ Version: 0.2.27
4
4
  Summary: A Python package for creating shareable, interactive visualizations in the browser
5
5
  Author-email: Jeremy Magland <jmagland@flatironinstitute.org>
6
6
  License: Apache-2.0
@@ -1,4 +1,4 @@
1
- figpack/__init__.py,sha256=OpGLj0C6_sAoNOR9uGz5TWFkG9ms1GoXv54mh349LAw,358
1
+ figpack/__init__.py,sha256=zxhqr0lde2J_mnAi73-7r4CZptcqrtGZIZB7Tj5AJos,358
2
2
  figpack/cli.py,sha256=s1mGQuFSntxiIvU6OWwHVlM9Cj-l1zMQ3OzFFe1-5ZE,11089
3
3
  figpack/extensions.py,sha256=mILB4_F1RHkca4I7t88zh74IX8VCmfT7XFZZT4XYdNw,13009
4
4
  figpack/core/__init__.py,sha256=7zU6O1piTk07aeCfbU81QqTgSHIO2n5MZ4LFNmsrtfs,192
@@ -14,8 +14,8 @@ figpack/core/extension_view.py,sha256=FSBXdhFEWicLi0jhkuRdS-a8CNsULrEqqIKtYfV3tm
14
14
  figpack/core/figpack_extension.py,sha256=KSJKlnLYueFnGa8QFMpbIF3CDMwnIZJOqsI0smz6cUc,2252
15
15
  figpack/core/figpack_view.py,sha256=rD94SehOcb_OVlZJuVK9UdH-dOJ-Mjlvg5cX1JEoH0w,6853
16
16
  figpack/core/zarr.py,sha256=LTWOIX6vuH25STYTQS9_apfnfYXmATAEQkil3z9eYKE,1634
17
- figpack/figpack-figure-dist/index.html,sha256=1_rZQVk_M3zMcSb6VmiqSyH3yqHiirvOw5XDNE-gJDQ,688
18
- figpack/figpack-figure-dist/assets/index-CLEO_r6_.js,sha256=4qrioRNRLnfC3Kd0coraHxna05w3sK5lHnebHWv26a0,1108269
17
+ figpack/figpack-figure-dist/index.html,sha256=RA68WkQC-75AbzX32U3SGbbipP9NpkAMSXJWrfVCPkI,688
18
+ figpack/figpack-figure-dist/assets/index-DnHZdWys.js,sha256=YxHgJeAv3feDI2INjrt9_7a86niyJ8eL7gqaRxU-Zs4,1108653
19
19
  figpack/figpack-figure-dist/assets/index-V5m_wCvw.css,sha256=WRtQLW6SNlTlLtepSOt89t1z41SD7XzYUyRldqowjMM,7286
20
20
  figpack/figpack-figure-dist/assets/neurosift-logo-CLsuwLMO.png,sha256=g5m-TwrGh5f6-9rXtWV-znH4B0nHgc__0GWclRDLUHs,9307
21
21
  figpack/views/Box.py,sha256=oN_OJH2pK_hH26k0eFCFjlfuJssVqKvw20GxYK1HX7g,2419
@@ -33,15 +33,15 @@ figpack/views/Spectrogram.py,sha256=jcm26ucHedKDnBA5xnAUu9tW-g-ZutT-kw1EIhYm66E,
33
33
  figpack/views/Splitter.py,sha256=BR2L-8aqicTubS1rSzsQ3XnhoJcX5GcfEnVWtEWEs0w,2016
34
34
  figpack/views/TabLayout.py,sha256=AqdHPLcP2-caWjxbkC8r8m60z8n_eyZrIBGOOPSVNCs,1908
35
35
  figpack/views/TabLayoutItem.py,sha256=xmHA0JsW_6naJze4_mQuP_Fy0Nm17p2N7w_AsmVRp8k,880
36
- figpack/views/TimeseriesGraph.py,sha256=QL2eVqzB5QiGkIO5-vVf6PD9E0AHffI6VJeWvxsQ9HM,17691
36
+ figpack/views/TimeseriesGraph.py,sha256=ygbgB83CIc5z_FN6gedWB_KIGh9Zo6LwrCafJqWckfU,19011
37
37
  figpack/views/__init__.py,sha256=V09R6vFRzhY7ANevWomM7muFfUieXZEjGimPiMHpey4,641
38
38
  figpack/views/PlotlyExtension/PlotlyExtension.py,sha256=LOFSqbm46UZ7HsHTDxUPnNB33ydYQvEkRVK-TSKkzK4,2149
39
39
  figpack/views/PlotlyExtension/__init__.py,sha256=80Wy1mDMWyagjuR99ECxJePIYpRQ6TSyHkB0uZoBZ_0,70
40
40
  figpack/views/PlotlyExtension/_plotly_extension.py,sha256=yZjG1NMGlQedeeLdV6TQWpi_NTm5Wfk5eWbXEdZbbFE,1455
41
41
  figpack/views/PlotlyExtension/plotly_view.js,sha256=9BjgOPkqGl87SSonnb48nFeQV3UTIi1trpSPxd9qlKo,3055
42
- figpack-0.2.25.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
43
- figpack-0.2.25.dist-info/METADATA,sha256=mPALb1Itn7zBXxIEV8QzVwXQv9SQlmUpHAhhR-Hfj04,4618
44
- figpack-0.2.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
- figpack-0.2.25.dist-info/entry_points.txt,sha256=l6d3siH2LxXa8qJGbjAqpIZtI5AkMSyDeoRDCzdrUto,45
46
- figpack-0.2.25.dist-info/top_level.txt,sha256=lMKGaC5xWmAYBx9Ac1iMokm42KFnJFjmkP2ldyvOo-c,8
47
- figpack-0.2.25.dist-info/RECORD,,
42
+ figpack-0.2.27.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
43
+ figpack-0.2.27.dist-info/METADATA,sha256=1_RNdRpyaQQaJD0ZoqyWjWNAn2WcgrIdlfDLfFGYtes,4618
44
+ figpack-0.2.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
+ figpack-0.2.27.dist-info/entry_points.txt,sha256=l6d3siH2LxXa8qJGbjAqpIZtI5AkMSyDeoRDCzdrUto,45
46
+ figpack-0.2.27.dist-info/top_level.txt,sha256=lMKGaC5xWmAYBx9Ac1iMokm42KFnJFjmkP2ldyvOo-c,8
47
+ figpack-0.2.27.dist-info/RECORD,,