Skip to content

Fix copies=0 producing wrong VRS object type#621

Merged
korikuzma merged 3 commits into
ga4gh:mainfrom
knQzx:fix/copies-zero-falsy
Apr 2, 2026
Merged

Fix copies=0 producing wrong VRS object type#621
korikuzma merged 3 commits into
ga4gh:mainfrom
knQzx:fix/copies-zero-falsy

Conversation

@knQzx

@knQzx knQzx commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

copies=0 in _from_hgvs falls through to CopyNumberChange branch
because if copies: treats 0 as falsy. changed to if copies is not None:

@knQzx knQzx requested review from a team as code owners March 26, 2026 16:38
@knQzx

knQzx commented Mar 26, 2026

Copy link
Copy Markdown
Contributor Author

found this while reading the translator - copies=0 is valid (homozygous deletion) but gets skipped since 0 is falsy in python

@korikuzma korikuzma 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.

Great catch! Would you be able to add a test for this issue in test_cnv_translator.py ?

@knQzx

knQzx commented Apr 2, 2026

Copy link
Copy Markdown
Contributor Author

thanks for the feedback! added a test for it - checks that copies=0 gives back CopyNumberCount and not CopyNumberChange

@theferrit32 theferrit32 requested a review from korikuzma April 2, 2026 18:56

@korikuzma korikuzma 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.

Awesome! 🚀

@korikuzma korikuzma merged commit 596b07c into ga4gh:main Apr 2, 2026
8 checks passed
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