spectre-core 0.0.6__py3-none-any.whl → 0.0.7__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,13 +9,10 @@ from matplotlib.figure import Figure
9
9
  from matplotlib.axes import Axes
10
10
 
11
11
  from spectre_core.spectrograms.spectrogram import Spectrogram
12
- from spectre_core.plotting.base import BasePanel
12
+ from spectre_core.plotting.base import BasePanel, CutsPanel
13
+ from spectre_core.plotting.format import DEFAULT_FORMATS
13
14
  from spectre_core.plotting.factory import get_panel
14
- from spectre_core.plotting.library.time_cuts.panel import Panel as TimeCutsPanel
15
- from spectre_core.plotting.library.frequency_cuts.panel import Panel as FrequencyCutsPanel
16
15
  from spectre_core.plotting.library.spectrogram.panel import Panel as SpectrogramPanel
17
- from spectre_core.plotting.base import CutsPanel
18
- from spectre_core.plotting.format import DEFAULT_FORMATS
19
16
 
20
17
  class PanelStack:
21
18
  def __init__(self, time_type: str, figsize: Tuple[int, int] = (10, 10)):
@@ -240,8 +240,8 @@ class SPECTREReceiver(BaseReceiver):
240
240
  "window_kwargs": dict, # keyword arguments for window function, must be in order as in scipy documentation.
241
241
  "window_size": int, # number of samples in STFFT window
242
242
  "hop": int, # STFFT window hops by so many samples
243
- "chunk_key": str, # tag will map to the chunk with this key
244
- "event_handler_key": str, # tag will map to event handler with this key during post processing
243
+ "chunk_key": str, # maps to the corresponding chunk class
244
+ "event_handler_key": str, # maps to the event handler used in post processing
245
245
  },
246
246
  "sweep": {
247
247
  "min_freq": float, # [Hz]
@@ -260,8 +260,8 @@ class SPECTREReceiver(BaseReceiver):
260
260
  "window_kwargs": dict, # keyword arguments for window function, must be in order as in scipy documentation.
261
261
  "window_size": int, # number of samples in STFFT window
262
262
  "hop": int, # keyword arguments for the scipy STFFT class
263
- "chunk_key": str, # tag will map to the chunk with this key
264
- "event_handler_key": str, # tag will map to event handler with this key during post processing
263
+ "chunk_key": str, # maps to the corresponding chunk class
264
+ "event_handler_key": str, # maps to the event handler used in post processing
265
265
  }
266
266
  }
267
267
 
@@ -33,41 +33,42 @@ class Receiver(SPECTREReceiver):
33
33
  def _set_type_templates(self) -> None:
34
34
  self._type_templates = {
35
35
  "cosine-signal-1": {
36
- 'samp_rate': int, # [Hz]
37
- 'frequency': float, # [Hz]
38
- 'amplitude': float, # unitless
39
- 'chunk_size': int, # [s]
40
- 'joining_time': int, # [s]
41
- 'time_resolution': float, # [s]
42
- 'frequency_resolution': float, # [Hz]
43
- 'window_type': str, # the window type for the STFFT
44
- 'window_kwargs': dict, # keyword arguments for scipy get window function. Must be in order as in scipy documentation.
45
- 'window_size': int, # number of samples for the window
46
- 'hop': int, # STFFT hop shifts window by so many samples
47
- 'chunk_key': str, # tag will map to the chunk with this key
48
- 'event_handler_key': str # tag will map to event handler with this key during post processing
36
+ "samp_rate": int, # [Hz]
37
+ "frequency": float, # [Hz]
38
+ "amplitude": float, # unitless
39
+ "chunk_size": int, # [s]
40
+ "joining_time": int, # [s]
41
+ "time_resolution": float, # [s]
42
+ "frequency_resolution": float, # [Hz]
43
+ "window_type": str, # the window type for the STFFT
44
+ "window_kwargs": dict, # keyword arguments for scipy get window function. Must be in order as in scipy documentation.
45
+ "window_size": int, # number of samples for the window
46
+ "hop": int, # STFFT hop shifts window by so many samples
47
+ "chunk_key": str, # maps to the corresponding chunk class
48
+ "event_handler_key": str, # maps to the event handler used in post processing
49
49
  },
50
50
  "tagged-staircase": {
51
- 'samp_rate': int, # [Hz]
52
- 'min_samples_per_step': int, # [samples]
53
- 'max_samples_per_step': int, # [samples]
54
- 'freq_step': float, # [Hz]
55
- 'step_increment': int, # [samples]
56
- 'chunk_size': int, # [s]
57
- 'joining_time': int, # [s]
58
- 'time_resolution': float, # [s]
59
- 'frequency_resolution': float, # [Hz]
60
- 'window_type': str, # the window type for the STFFT
61
- 'window_kwargs': dict, # keyword arguments for scipy get window function. Must be in order as in scipy documentation.
62
- 'window_size': int, # number of samples for the window
63
- 'hop': int, # keyword arguments for scipy STFFT class
64
- 'chunk_key': str, # tag will map to the chunk with this key
65
- 'event_handler_key': str, # tag will map to event handler with this key during post processing
51
+ "samp_rate": int, # [Hz]
52
+ "min_samples_per_step": int, # [samples]
53
+ "max_samples_per_step": int, # [samples]
54
+ "freq_step": float, # [Hz]
55
+ "step_increment": int, # [samples]
56
+ "chunk_size": int, # [s]
57
+ "joining_time": int, # [s]
58
+ "time_resolution": float, # [s]
59
+ "frequency_resolution": float, # [Hz]
60
+ "window_type": str, # the window type for the STFFT
61
+ "window_kwargs": dict, # keyword arguments for scipy get window function. Must be in order as in scipy documentation.
62
+ "window_size": int, # number of samples for the window
63
+ "hop": int, # keyword arguments for scipy STFFT class
64
+ "chunk_key": str, # maps to the corresponding chunk class
65
+ "event_handler_key": str, # maps to the event handler used in post processing
66
66
  }
67
67
  }
68
68
 
69
69
  def _set_specifications(self) -> None:
70
70
  self._specifications = {
71
+ "samp_rate_lower_bound": 64000
71
72
  }
72
73
 
73
74
 
@@ -105,6 +106,9 @@ class Receiver(SPECTREReceiver):
105
106
  validators.chunk_key(chunk_key, "fixed")
106
107
  validators.event_handler_key(event_handler_key, "fixed")
107
108
 
109
+ if samp_rate < self.specifications.get("samp_rate_lower_bound"):
110
+ raise ValueError(f"Sample rate must be greater than or equal to {self.specifications.get('samp_rate_lower_bound')}")
111
+
108
112
  if time_resolution != 0:
109
113
  raise ValueError(f"Time resolution must be zero. Received: {time_resolution}")
110
114
 
@@ -12,7 +12,7 @@ from watchdog.observers import Observer
12
12
  from spectre_core.watchdog.factory import get_event_handler_from_tag
13
13
  from spectre_core.cfg import CHUNKS_DIR_PATH
14
14
 
15
- class Watcher:
15
+ class PostProcessor:
16
16
  def __init__(self,
17
17
  tag: str):
18
18
  self._observer: Observer = Observer()
@@ -25,7 +25,7 @@ class Watcher:
25
25
 
26
26
 
27
27
  def start(self):
28
- _LOGGER.info("Starting watcher...")
28
+ _LOGGER.info("Starting post processor...")
29
29
 
30
30
  # Schedule and start the observer
31
31
  self._observer.schedule(self._event_handler,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spectre-core
3
- Version: 0.0.6
3
+ Version: 0.0.7
4
4
  Summary: The core Python package used by the spectre program.
5
5
  Maintainer-email: Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -23,14 +23,14 @@ spectre_core/plotting/base.py,sha256=4HhPPP7BNe5_SUAl1Ee52_QP62Zzh3kmNJwLzCHKG3c
23
23
  spectre_core/plotting/factory.py,sha256=pYil7PbTs3e08ek6nq-y8mSEtNu7DI6uloiCwsuIoOw,940
24
24
  spectre_core/plotting/format.py,sha256=Et-uc4juDl_2spLRZOzqaUVBP8-J3LPnV5M6CllM74E,512
25
25
  spectre_core/plotting/panel_register.py,sha256=rsmG2hXnvVOy6vfWsEZlZQAXej7bRtqtvjnXObyUCg4,351
26
- spectre_core/plotting/panel_stack.py,sha256=qeuYm6Rk61FqIXO17aceoCwG0s2xjJ1Sm9wWiGCtFt0,5401
26
+ spectre_core/plotting/panel_stack.py,sha256=PxtoXp9WzSe38gG6dILoM__X_BxwNdydXRpzs3knsF0,5191
27
27
  spectre_core/plotting/library/__init__.py,sha256=lQhj4kme2eKb-JSrHvLWkAjI7eVqexOxxUguo8LUXno,270
28
28
  spectre_core/plotting/library/frequency_cuts/panel.py,sha256=LtCWNad4Z1gxBOxi_Ni1d6KZxsgoR5Mbm2tWXN7VDqI,2772
29
29
  spectre_core/plotting/library/integral_over_frequency/panel.py,sha256=tvro2MCtY4Q0q7WdMUz9eW5Cvrweeqqse20q3x4D4fM,1274
30
30
  spectre_core/plotting/library/spectrogram/panel.py,sha256=CAaPz7sDYoWZ3-4Jb1kVRu9bvJYaBRiXvoMkV7QXWqk,3556
31
31
  spectre_core/plotting/library/time_cuts/panel.py,sha256=u9Sbnwy6ex61y5Jl-D77HlYvuuXdK8_YB-o2gCovCTY,2947
32
32
  spectre_core/receivers/__init__.py,sha256=kKfhqrGs9sSPGLbrpTqScv816iPZOvT3ry3zSMcqLkM,227
33
- spectre_core/receivers/base.py,sha256=rKfKULYW1m7b3jDHBjnQMJ9F74Z6GTrQCnpXj6Nn0vc,16050
33
+ spectre_core/receivers/base.py,sha256=UW2L28juLWyzI6t6Ub6Ws-K4J9U4HT4JSgdVtuiYP8k,16012
34
34
  spectre_core/receivers/factory.py,sha256=aE-Yw_cnlkhRe5HxK0JqhDzd2AwZcKmB2QkAKwaq27Y,873
35
35
  spectre_core/receivers/receiver_register.py,sha256=xHcRnT-3NQxyIWL3nyT3P9qT14Wl5liM9HbflOvOUAM,617
36
36
  spectre_core/receivers/validators.py,sha256=aP8nbRWZxU5pOwBIXTojXuHd3i9yksHW_vIBn4cbKug,8481
@@ -46,7 +46,7 @@ spectre_core/receivers/library/rspduo/gr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
46
46
  spectre_core/receivers/library/rspduo/gr/tuner_1_fixed.py,sha256=YaRS9oNRry-6eZPIsFjNlKcZqhNcQw3X9N8Dw877aeM,3603
47
47
  spectre_core/receivers/library/rspduo/gr/tuner_1_sweep.py,sha256=0WDfR1R6uOnIEb_4aPQN-O5Gh62utZrvRukPEF3xzDU,5113
48
48
  spectre_core/receivers/library/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
- spectre_core/receivers/library/test/receiver.py,sha256=i78ucPZmlRYVqwqrw29kiIhN_VC2KCifig8Xc0JtbRw,8137
49
+ spectre_core/receivers/library/test/receiver.py,sha256=ihfmUFFFEcyjMnMrqP4ajgB1mdC0vWEe9LFkNYHZn_Y,8346
50
50
  spectre_core/receivers/library/test/gr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  spectre_core/receivers/library/test/gr/cosine_signal_1.py,sha256=6XgYjYMh-QNPs_UUGUQcU_VQFr6BG4OLdsW-M-RU5Ww,2943
52
52
  spectre_core/receivers/library/test/gr/tagged_staircase.py,sha256=5rJHbB-3vdXjqT8DrcAGUSebaAqZ5RQtYHBWgH9iU2E,3465
@@ -59,14 +59,14 @@ spectre_core/watchdog/__init__.py,sha256=gGjyC7MeCfarB9Yu0RycZs-Wh_of7Cbp_wIyovY
59
59
  spectre_core/watchdog/base.py,sha256=xDvWtt7fXeBQoZpR-ZxopAAKNHRa8YNSmfR63bYsSlU,4178
60
60
  spectre_core/watchdog/event_handler_register.py,sha256=DwlkU92IFkZ1_qvGfhep_OfuqTOIR_efY5qFpn1perw,498
61
61
  spectre_core/watchdog/factory.py,sha256=Uqx4nIZPVRxx7hRgm1M-1p2Sc7m3ObkIKWIC_ru9ObU,1115
62
- spectre_core/watchdog/watcher.py,sha256=eRAuWAw-0JvfcH3b7qn6lRZVLhmPwubCduRCrV2gLhk,1660
62
+ spectre_core/watchdog/post_processor.py,sha256=rZwe4u_T-7F7_q485PtUUZMAxPPec35zXV81MyERIjg,1673
63
63
  spectre_core/watchdog/library/__init__.py,sha256=vEwAnAV-sv7WcNYOdnjr1JVqZYr29Wr2cv01eoxwdmg,282
64
64
  spectre_core/watchdog/library/fixed/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
65
  spectre_core/watchdog/library/fixed/event_handler.py,sha256=yWWS80LukB-cTrKBsF4-pRvw2obkX2MzQ5ZGytOtmAg,1387
66
66
  spectre_core/watchdog/library/sweep/event_handler.py,sha256=wDISZiQXBeqLDPxgEMo0a2QAXqQVOO7fng3yhZWSR74,2188
67
67
  spectre_core/web_fetch/callisto.py,sha256=874osjbp61qFwRgV584fpSp7E-xz8g1FEelbNBKhCsw,3632
68
- spectre_core-0.0.6.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
69
- spectre_core-0.0.6.dist-info/METADATA,sha256=H98Gx3Db495h9gCE7ZkgfP2rUoc0VmnQYCRr4bfieAc,42149
70
- spectre_core-0.0.6.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
71
- spectre_core-0.0.6.dist-info/top_level.txt,sha256=-UsyjpFohXgZpgcZ9QbVeXhsIyF3Am8RxNFNDV_Ta2Y,13
72
- spectre_core-0.0.6.dist-info/RECORD,,
68
+ spectre_core-0.0.7.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
69
+ spectre_core-0.0.7.dist-info/METADATA,sha256=mSmKzIO9I8ps1yKp-jJjZ_D_OhDQH_lUKfgzeW2-VFc,42149
70
+ spectre_core-0.0.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
71
+ spectre_core-0.0.7.dist-info/top_level.txt,sha256=-UsyjpFohXgZpgcZ9QbVeXhsIyF3Am8RxNFNDV_Ta2Y,13
72
+ spectre_core-0.0.7.dist-info/RECORD,,