Conversation
…r reflect its function.
PR Review: Modularize FrontendThis is a substantial and well-motivated refactor. The separation of concerns across Architecture & Design (Positive)
Issues & Concerns1.
|
| Category | Finding | Severity |
|---|---|---|
| Bug | results_hm/results_psth shared class-level dicts |
Medium |
| Bug | Socket leak + infinite loop in scanPortsAndFind |
Medium |
| Bug | arr[i] post-loop reference in update_selector |
Low |
| Code quality | pn.extension() called at module level multiple times |
Medium |
| Code quality | == True comparison with numpy bool |
Low |
| Code quality | Dead save_opts variable assignments |
Low |
| Code quality | Magic 3 for downsampling repeated 5x |
Low |
| Code quality | Commented-out # abspath = [] line |
Low |
| Design | ~/pbSteps.txt IPC pattern (pre-existing) |
Low (note) |
The refactor direction is sound. Addressing the shared mutable class attrs (#7) and the socket issues (#1, #13) before merge would be worthwhile.
Fixes #173
General goals include
decoupling dedicated front-end to tkinter or Panel code from an orchestration layer that ties everything together
Refactoring highly stateful blocks of code into classes
Refactoring highly functional blocks of code into pure functions
Reorganizing frontend blocks into dedicated modules
Making functional relationships between coding sections as explicit as possible (ex. explicit parameters instead of implicit closures where possible)
De-duplicate code where applicable
SavingInputParameters.py --> home.py (home)
SavingInputParameters.py --> save_parameters.py (step 1)
saveStoresList.py --> storenames.py (step 2)
readTevTsq.py --> read_raw_data.py (step 3)
preprocess.py (step 4)
computePsth.py --> psth.py (step 5)
findTransientsFreqAndAmp.py --> transients.py (step 5)
visualizePlot.py --> visualize.py (step 6)