Skip to content

Commit 6bcfd48

Browse files
committed
remove unused functions
1 parent d1e84e1 commit 6bcfd48

2 files changed

Lines changed: 0 additions & 71 deletions

File tree

src/explorepy/explore.py

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from scipy import signal as scipy_signal
2525

2626
import explorepy
27-
from explorepy._exceptions import ImpedanceModeActiveError
2827
from explorepy.command import (
2928
MemoryFormat,
3029
SetBinaryTime,
@@ -751,57 +750,3 @@ def is_bt_link_unstable(self):
751750

752751
def get_channel_mask(self):
753752
return SettingsManager(self.device_name).get_adc_mask()
754-
755-
def is_asr_processor_available(self):
756-
try:
757-
return self.stream_processor.ensure_asr_processor_available()
758-
except ImpedanceModeActiveError:
759-
return False
760-
761-
def calibrate_asr(self, length=-1.0):
762-
if self.is_asr_processor_available():
763-
self.stream_processor.asr_processor.start_calibration(length)
764-
765-
def is_asr_calibration_data_available(self):
766-
if self.is_asr_processor_available():
767-
return self.stream_processor.asr_processor.calibration_data_available
768-
else:
769-
return False
770-
771-
def is_asr_calibrating(self):
772-
if self.is_asr_processor_available():
773-
return self.stream_processor.asr_processor.is_calibrating
774-
else:
775-
return False
776-
777-
def is_asr_running(self):
778-
if self.is_asr_processor_available():
779-
return self.stream_processor.asr_processor.is_cleaning
780-
else:
781-
return False
782-
783-
def start_asr(self, window=None):
784-
if self.is_asr_processor_available():
785-
if self.stream_processor.asr_processor.calibration_data_available:
786-
self.stream_processor.asr_processor.start_cleaning(window)
787-
788-
def stop_asr(self):
789-
if self.is_asr_processor_available():
790-
if self.stream_processor.asr_processor.calibration_data_available:
791-
self.stream_processor.asr_processor.stop_cleaning()
792-
793-
def set_asr_cutoff(self, new_cutoff: float):
794-
if self.is_asr_processor_available():
795-
self.stream_processor.asr_processor.cutoff = new_cutoff
796-
797-
def get_asr_cutoff(self):
798-
if self.is_asr_processor_available():
799-
return self.stream_processor.asr_processor.cutoff
800-
801-
def set_asr_refresh_window(self, new_window):
802-
if self.is_asr_processor_available():
803-
self.stream_processor.asr_processor.refresh_window = new_window
804-
805-
def get_asr_refresh_window(self):
806-
if self.is_asr_processor_available():
807-
return self.stream_processor.asr_processor.refresh_window

src/explorepy/stream_processor.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
import numpy as np
1717

18-
from explorepy._exceptions import ImpedanceModeActiveError
19-
from explorepy.asr_processor import AsrProcessor
2018
from explorepy.command import (
2119
DeviceConfiguration,
2220
ZMeasurementDisable,
@@ -26,7 +24,6 @@
2624
from explorepy.packet import (
2725
EEG,
2826
CalibrationInfoBase,
29-
CleanEEG,
3027
CommandRCV,
3128
CommandStatus,
3229
DeviceInfo,
@@ -58,7 +55,6 @@ class StreamProcessor:
5855

5956
def __init__(self, debug=False):
6057
self.parser = None
61-
self.asr_processor = None
6258
self.filters = []
6359
self.device_info = {}
6460
self.old_device_info = {}
@@ -339,12 +335,6 @@ def process(self, packet):
339335
self.dispatch(topic=TOPICS.filtered_ExG, packet=packet)
340336

341337
self.dispatch(topic=TOPICS.filtered_ExG, packet=packet)
342-
if not self._is_imp_mode and self.imp_calculator is None:
343-
if self.asr_processor.cleaned_data_available:
344-
clean_packet = CleanEEG(timestamp=self.asr_processor.cleaned_data_ts,
345-
payload=self.asr_processor.cleaned_data)
346-
self.dispatch(topic=TOPICS.asr_ExG, packet=clean_packet)
347-
self.asr_processor.clear_cleaned_data()
348338
elif isinstance(packet, DeviceInfo):
349339
self.old_device_info = self.device_info.copy()
350340
print(self.old_device_info)
@@ -354,7 +344,6 @@ def process(self, packet):
354344
self.device_info["device_name"])
355345
settings_manager.update_device_settings(packet.get_info())
356346
self.dispatch(topic=TOPICS.device_info, packet=packet)
357-
self.asr_processor = AsrProcessor(self, TOPICS.raw_ExG)
358347
elif isinstance(packet, CommandRCV):
359348
self.dispatch(topic=TOPICS.cmd_ack, packet=packet)
360349
elif isinstance(packet, CommandStatus):
@@ -620,8 +609,3 @@ def get_power_line_freq(self):
620609
None
621610
)
622611
return match.get_cutoff_freq() if match else None
623-
624-
def ensure_asr_processor_available(self):
625-
if self.is_imp_running():
626-
raise ImpedanceModeActiveError()
627-
return self.asr_processor is not None and self.asr_processor.is_initialized

0 commit comments

Comments
 (0)