Skip to content

[ENH] better immlib errors#141

Merged
arokem merged 2 commits into
tractometry:mainfrom
36000:immlib_errors
Jan 10, 2026
Merged

[ENH] better immlib errors#141
arokem merged 2 commits into
tractometry:mainfrom
36000:immlib_errors

Conversation

@36000

@36000 36000 commented Jan 10, 2026

Copy link
Copy Markdown
Collaborator

This re-orders immlib errors to be easier to read. It also adds more swap for the nightly reco80 test

Copilot AI review requested due to automatic review settings January 10, 2026 18:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves error handling for immlib/pcollections LazyError exceptions by introducing a centralized unwrapping function, and increases swap space for the nightly reco80 test to address memory constraints.

Changes:

  • Introduces val_from_plan() function to unwrap LazyError exceptions and surface underlying errors
  • Replaces direct dictionary access and lambda functions with val_from_plan() for better error reporting
  • Increases GitHub Actions swap space from 16G to 32G for nightly reco80 test

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
AFQ/api/utils.py Adds val_from_plan() function and LazyError import to centralize error unwrapping logic
AFQ/api/participant.py Updates export() to use val_from_plan() for better error messages
AFQ/api/group.py Replaces direct dictionary access and lambda with val_from_plan() calls
.github/workflows/nightly_reco80_test.yml Doubles swap space allocation from 16G to 32G

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AFQ/api/participant.py
@36000 36000 added this to the pyAFQ 3.0 milestone Jan 10, 2026
@36000

36000 commented Jan 10, 2026

Copy link
Copy Markdown
Collaborator Author

@arokem this is ready for review/merge

@arokem

arokem commented Jan 10, 2026

Copy link
Copy Markdown
Member

cc @noahbenson: just to let you know that we've found the immlib errors a bit confusing, because the original error appears rather high in the stack-trace. This means that debugging immlib errors can be confusing if you are used to looking at Python stack traces, which usually have their root cause close to the bottom. Ultimately, this might be something that you'd want to integrate into immlib itself (?)

@arokem arokem left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@arokem
arokem merged commit 80c55e8 into tractometry:main Jan 10, 2026
9 checks passed
@arokem arokem mentioned this pull request Jan 10, 2026
@noahbenson

Copy link
Copy Markdown

@arokem 👍🏻
John and I had a conversation about this here; I'm considering including a tweak for this in immlib itself.

@arokem

arokem commented Jan 12, 2026

Copy link
Copy Markdown
Member

Oh - awesome! Thanks for your help with this.

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.

4 participants