feat: Add components method to Variant class#40
Merged
Conversation
9f3611d to
427f22c
Compare
Adds a `components` method to the Variant class which is a tuple of fully qualified variant strings that comprises the current variant object. The `format_variant` function was refactored into a new function `_format_component_variants`, which returns a list of the component variants of a Variant object. In turn, the __repr__ function uses this class function to return the variant string representation. The `components` method returns the result of this new internal formatting function, with the prefix and transcript identifier prepended to each variant string. For multi-variants, each tuple element is parsable into a single-variant Variant object which comprises the original multi-variant. For single- variants, the single element tuple contains the original variant string.
427f22c to
99b1b29
Compare
488adce to
dff5572
Compare
afrubin
approved these changes
May 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
componentsmethod to the Variant class which is a tuple of fully qualified variant strings that comprises the current variant object. Theformat_variantfunction was refactored into a new function_format_component_variants, which returns a list of the component variants of a Variant object. In turn, the repr function uses this class function to return the variant string representation. Thecomponentsmethod returns the result of this new internal formatting function, with the prefix and transcript identifier prepended to each variant string.For multi-variants, each tuple element is parsable into a single-variant Variant object which comprises the original multi-variant. For single- variants, the single element tuple contains the original variant string.
Closes #39.