Skip to content

copilot fix#102

Merged
Hendrik-code merged 1 commit intomainfrom
dev_hendrik
Mar 3, 2026
Merged

copilot fix#102
Hendrik-code merged 1 commit intomainfrom
dev_hendrik

Conversation

@Hendrik-code
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 3, 2026 12:12
@Hendrik-code Hendrik-code merged commit e51a488 into main Mar 3, 2026
4 of 5 checks passed
@Hendrik-code Hendrik-code deleted the dev_hendrik branch March 3, 2026 12:13
Copy link
Contributor

Copilot AI left a comment

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 makes a small adjustment to assert_affine()’s error-printing logic in the NIfTI/POI abstraction layer, avoiding mutation of the text parameter while logging mismatches.

Changes:

  • Stop reassigning text inside the found_errors loop by introducing a separate per-error message variable.
  • Log each mismatch using the newly constructed message string.

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

Comment on lines +308 to +309
text2 = f"{text}; {err}" if text else f"{err}"
log.print(f"{text2}", ltype=Log_Type.FAIL, verbose=verbose)
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

text2 is a non-descriptive name for the constructed log message; consider renaming to something like msg/log_msg to make intent clear and avoid confusion with the text parameter used later in the AssertionError.

Suggested change
text2 = f"{text}; {err}" if text else f"{err}"
log.print(f"{text2}", ltype=Log_Type.FAIL, verbose=verbose)
log_msg = f"{text}; {err}" if text else f"{err}"
log.print(log_msg, ltype=Log_Type.FAIL, verbose=verbose)

Copilot uses AI. Check for mistakes.
text = f"{text}; {err}" if text else f"{err}"
log.print(f"{text}", ltype=Log_Type.FAIL, verbose=verbose)
text2 = f"{text}; {err}" if text else f"{err}"
log.print(f"{text2}", ltype=Log_Type.FAIL, verbose=verbose)
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

log.print(f"{text2}", ...) wraps an existing string in an f-string without interpolation; pass text2 directly to avoid redundant formatting.

Suggested change
log.print(f"{text2}", ltype=Log_Type.FAIL, verbose=verbose)
log.print(text2, ltype=Log_Type.FAIL, verbose=verbose)

Copilot uses AI. Check for mistakes.
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