Conversation
…Actiwave and non-Actiwave sources
|
Also, the dashboard shows unexpected behavior when such a task with a duplicate name is loaded. Once the rest task is loaded, when I open another task, it shows a blank segment, although it shows valid segments again when I re-select segments. screen_recording_trimmed.mov |
|
I tried using two EDA files, but both files showed errors like this: Traceback (most recent call last):
File "/Users/yuna.w/Research/CBSL/heartview/physioview/dashboard/callbacks.py", line 1434, in run_pipeline
metrics_by_event = preprocessor.preprocess_event(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yuna.w/Research/CBSL/heartview/physioview/dashboard/_core/preprocessing.py", line 306, in preprocess_event
for event_label, event_data in preprocessed.groupby('Event'):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yuna.w/Research/CBSL/heartview/.venv/lib/python3.12/site-packages/pandas/core/frame.py", line 9190, in groupby
return DataFrameGroupBy(
^^^^^^^^^^^^^^^^^
File "/Users/yuna.w/Research/CBSL/heartview/.venv/lib/python3.12/site-packages/pandas/core/groupby/groupby.py", line 1330, in __init__
grouper, exclusions, obj = get_grouper(
^^^^^^^^^^^^
File "/Users/yuna.w/Research/CBSL/heartview/.venv/lib/python3.12/site-packages/pandas/core/groupby/grouper.py", line 1043, in get_grouper
raise KeyError(gpr)
KeyError: 'Event'There seems to be something wrong with the EDA event processing. |
| preprocessor = _core.Preprocessor( | ||
| dtype, fs, filt_on, peak_detector, event_df, seg_size, | ||
| filter_kwargs) |
There was a problem hiding this comment.
I got this error when I tried to run the pipeline for E4 (both for PPG and EDA).
dash.exceptions.LongCallbackError: An error occurred inside a long callback: dtype must be one of 'ECG', 'EDA', 'PPG'.
Traceback (most recent call last):
File "/Users/yuna.w/Research/CBSL/heartview/.venv/lib/python3.12/site-packages/dash/long_callback/managers/diskcache_manager.py", line 194, in run
user_callback_output = fn(*maybe_progress, *user_callback_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yuna.w/Research/CBSL/heartview/physioview/dashboard/callbacks.py", line 1093, in run_pipeline
preprocessor = _core.Preprocessor(
^^^^^^^^^^^^^^^^^^^
File "/Users/yuna.w/Research/CBSL/heartview/physioview/dashboard/_core/preprocessing.py", line 100, in __init__
raise ValueError(f"dtype must be one of 'ECG', 'EDA', 'PPG'.")
ValueError: dtype must be one of 'ECG', 'EDA', 'PPG'.
The reason is probably because you're passing dtype, not e4_dtype but dtype is None if the data is from E4?
| # === Toggle segmentation settings ======================================== | ||
| @app.callback( | ||
| [Output('segment-data-by-event', 'hidden'), | ||
| Output('segment-data-by-time', 'hidden')], | ||
| Input('segment-by', 'value'), | ||
| prevent_initial_call = True | ||
| ) | ||
| def toggle_data_segmentation(segment_by): | ||
| """Toggle the data segmentation settings by time or event.""" | ||
| if segment_by == 'time': | ||
| return True, False | ||
| elif segment_by == 'event': | ||
| return False, False | ||
|
|
There was a problem hiding this comment.
Isn't it a little confusing to let users choose between "segment by time" and "segment by event", and yet you still show segment size even when they select "segment by event"?
I understand that this is because you still segment the signal into smaller chunks even when you split the data into tasks, but if that's the case, I thought it might be more intuitive to have a separate checkbox to toggle on/off event-based signal splitting.
There was a problem hiding this comment.
Good suggestion! I'll change the event-based segmentation component(s) to a toggle instead.
| ]) | ||
| ]), | ||
| html.Div(id = 'segment-data', children = [ | ||
| html.Div(id = 'segment-data-overview', children = [ |
There was a problem hiding this comment.
I am not entirely sure which code is the culprit, but it seems like the segmenting option is completely hidden when E4 or Actigraph files are imported. Is it intentional?



Link to Issue
Summary
Previously, the PhysioView Dashboard supported preprocessing with only time-based data segmentation. This PR adds support for event-based segmentation and preprocessing. It also includes a significant refactor of the original
dashboard.utils.pymodule. All utility functions are now modularized within thedashboard._coresubpackage.