Doric extractor: informative errors for empty channels and artifacts#279
Doric extractor: informative errors for empty channels and artifacts#279
Conversation
… in Doric extractor Agent-Logs-Url: https://github.com/LernerLab/GuPPy/sessions/35b09bd1-aea2-44e6-9dc2-4892d7bfaa03 Co-authored-by: pauladkisson <34703136+pauladkisson@users.noreply.github.com>
Agent-Logs-Url: https://github.com/LernerLab/GuPPy/sessions/35b09bd1-aea2-44e6-9dc2-4892d7bfaa03 Co-authored-by: pauladkisson <34703136+pauladkisson@users.noreply.github.com>
pauladkisson
left a comment
There was a problem hiding this comment.
I'd also like these errors to propagate up to the user experience in the GUI rather than just being in the terminal output, which users are not really going to want to look at.
| for event in events: | ||
| if event not in df.columns: | ||
| available = ", ".join(df.columns.tolist()) | ||
| if event in ("Raw", "Unknown 7"): |
There was a problem hiding this comment.
Yikes! Hard-coded event names? This needs to work for all Doric files, not just the ones in stubbed testing data.
There was a problem hiding this comment.
Fixed in commit 9f56e9c. Removed the if event in ("Raw", "Unknown 7") branch — all missing columns now get a single unified message that mentions these names only as illustrative examples: "If this column is an export artifact (e.g. 'Raw', 'Unknown 7'), please reselect actual analog channels...". This works for any Doric file regardless of the actual column names present.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…es in sidebar Agent-Logs-Url: https://github.com/LernerLab/GuPPy/sessions/7902b499-bbe3-44fa-b60a-fcd09362ed6a Co-authored-by: pauladkisson <34703136+pauladkisson@users.noreply.github.com>
Agent-Logs-Url: https://github.com/LernerLab/GuPPy/sessions/7902b499-bbe3-44fa-b60a-fcd09362ed6a Co-authored-by: pauladkisson <34703136+pauladkisson@users.noreply.github.com>
Done in commit 9f56e9c. Errors now surface visually in the sidebar via red Markdown panes ( |
|
@copilot I just merged content from a separate pull request where I ran into a similar issue and implemented a fix where it surfaced the errors in a nice little pop-up that I thought was really good. I think this makes a good chunk of the code in this PR no longer necessary. Could you please remove the changes that are superseded by the fix? |
…erged main Agent-Logs-Url: https://github.com/LernerLab/GuPPy/sessions/8d5ecd21-b8f2-4787-873f-ec6fc8b8a0cf Co-authored-by: pauladkisson <34703136+pauladkisson@users.noreply.github.com>
Done in commit 72a9c07. Removed the superseded sidebar Markdown error panes ( |
Empty
AOut1/AOut2channels and missing CSV columns crash the Doric extractor with crypticIndexError/KeyError. This replaces those with actionableValueErrors that surface in the terminal and via the GUI's pop-up notification system.Changes
Extractor errors
_access_data_doricV6: Guardlen(idx) == 0beforeidx = idx[0]in both control/signal and TTL branches — raisesValueErrornaming the channel and suggesting the user deselect it in step 2._access_data_doricV1: Pre-checkevent not in keysbefore HDF5 group access — same informative message._read_doric_csv: Pre-checkevent not in df.columns— raises with file path and available columns. All missing columns get a unified message that mentions export artifacts (e.g.Raw,Unknown 7) as examples, so it works for any Doric file.GUI error propagation
Errors surface via the existing
pn.state.notifications.error()pop-up mechanism.transients.pynow writes the error message toPB_ERROR_FILEbefore signalling-1(consistent withread_raw_data.py,preprocess.py, andpsth.py), so transient-analysis errors also appear in the pop-up.Tests
Six unit tests cover all new extractor error paths: V6 empty control/signal channel, V6 empty TTL channel, V1 missing channel, CSV missing column, and CSV export artifact messages.