Skip to content

Replace equality comparison with identity comparison for None checks#93

Merged
akhanf merged 2 commits intoclean-targetsfrom
copilot/sub-pr-92
Dec 19, 2025
Merged

Replace equality comparison with identity comparison for None checks#93
akhanf merged 2 commits intoclean-targetsfrom
copilot/sub-pr-92

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

Addresses PEP 8 compliance feedback from #92 discussion thread regarding None comparisons.

Changes

  • Updated two None comparisons in Snakefile to use identity operator (is None) instead of equality operator (== None)
    • Line 44: stain_for_reg validation
    • Line 55: atlas_segs configuration check
# Before
if stain_for_reg == None:
    raise ValueError(f"a stain for registration was not found in {stains}")

if config["atlas_segs"] == None:
    atlas_segs = all_atlas_segs

# After
if stain_for_reg is None:
    raise ValueError(f"a stain for registration was not found in {stains}")

if config["atlas_segs"] is None:
    atlas_segs = all_atlas_segs

Identity comparison with singleton objects is both more efficient and semantically correct per PEP 8.


💡 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.

Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Copilot AI changed the title [WIP] Update target rules cleanup to address review feedback Replace equality comparison with identity comparison for None checks Dec 19, 2025
Copilot AI requested a review from akhanf December 19, 2025 18:36
@akhanf akhanf marked this pull request as ready for review December 19, 2025 18:36
@akhanf akhanf merged commit ec0c2e2 into clean-targets Dec 19, 2025
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