Skip to content

Address PR review comments: remove debug code, fix variable shadowing, improve error handling#62

Merged
theodchrn merged 5 commits intodev/exploreResultsfrom
copilot/sub-pr-61
Feb 5, 2026
Merged

Address PR review comments: remove debug code, fix variable shadowing, improve error handling#62
theodchrn merged 5 commits intodev/exploreResultsfrom
copilot/sub-pr-61

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

Addresses 26 review comments from PR #61 identifying linting issues, debug code, and code quality improvements.

Core Fixes

Variable shadowing and naming

  • Renamed dirdirectory in loop to avoid shadowing builtin
  • Renamed shankshank_name in conditional to clarify reuse pattern
  • Removed unused assignments: str(win), row["mouse"], row["manipe"], orphaned os.path.abspath() calls

Error handling improvements

  • Replaced bare except Exception with specific except (IndexError, KeyError)
  • Added None check before speedMask.copy() to prevent AttributeError
  • Added explanatory comments to empty except clauses in linearizer and rawdata_parser

Debug artifacts

  • Removed print(outputs_sleep) and unused variable assignment
  • Removed --dry-run flag from rsync command
  • Removed commented --flat_prior flag

Data access fix

# Before: incorrect subscript access
timeStepPred = self.data_helper[epochMask]

# After: correct nested dictionary access  
timeStepPred = self.data_helper.fullBehavior["positionTime"][epochMask]

Review Comments Not Actionable

Several review comments were incorrect:

  • get_true_target() call is valid (windowSizeMS has default)
  • ValueError in paper_figures.py correctly exits (doesn't continue to unsafe code)
  • Return value assignment in global_classes.py already captures both values
  • "Unreachable" statements in gui_elements.py are reachable (inside try-except)
  • spikeinterface import is used (not unused)

All changes validated with ruff linting and CodeQL security scan (0 alerts).


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 5, 2026 11:26
…ming

Co-authored-by: theodchrn <48409582+theodchrn@users.noreply.github.com>
…g builtin

Co-authored-by: theodchrn <48409582+theodchrn@users.noreply.github.com>
…nused code

Co-authored-by: theodchrn <48409582+theodchrn@users.noreply.github.com>
Co-authored-by: theodchrn <48409582+theodchrn@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests and delete lint errors Address PR review comments: remove debug code, fix variable shadowing, improve error handling Feb 5, 2026
Copilot AI requested a review from theodchrn February 5, 2026 11:35
@theodchrn theodchrn marked this pull request as ready for review February 5, 2026 14:47
@theodchrn theodchrn merged commit f754b45 into dev/exploreResults Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants