Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add enum for as_version + add restrictions to ga4gh_serialize_as_version #431

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

korikuzma
Copy link
Contributor

@korikuzma korikuzma commented Jul 16, 2024

Building off of #382 and #427

  • Add PrevVrsVersion enum to store previous versions of VRS that is supported for computing digests/identifiers
  • Updates function signatures + docstrings for ga4gh digest/serialize/identifier
  • Adds restrictions to ga4gh_serialize_as_version
    • For SequenceLocation: sequenceReference must be provided and must be a valid SequenceReference obj
    • For Allele: Only LiteralSequenceExpression and ReferenceLengthExpression are supported and must provide a sequence nonnull attribute.

…ze_as_version`

Building off of #382 and #427

* Add `PrevVrsVersion` enum to store previous versions of VRS that is supported for computing digests/identifiers
* Updates function signatures + docstrings for ga4gh digest/serialize/identifier
* Adds restrictions to `ga4gh_serialize_as_version`
  * For `SequenceLocation`: `sequenceReference` must be provided and must be a valid `SequenceReference` obj
  * For `Allele`: Only `LiteralSequenceExpression` and `ReferenceLengthExpression` are supported and must provide a `sequence` nonnull attribute.
@korikuzma korikuzma added enhancement New feature or request priority:medium Medium priority labels Jul 16, 2024
@korikuzma korikuzma self-assigned this Jul 16, 2024
@korikuzma korikuzma changed the title feat!: add enum for as_version + add restrictions to `ga4gh_seriali… feat!: add enum for as_version + add restrictions to ga4gh_serialize_as_version Jul 16, 2024
Comment on lines +68 to +72
@classmethod
def validate(cls, version):
if version is not None and version not in cls.__members__.values():
err_msg = f"Expected `PrevVrsVersion`, but got {version}"
raise ValueError(err_msg)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was going back and forth on moving this to a function rather than classmethod. I'm fine with whichever.

@korikuzma korikuzma requested a review from ahwagner July 16, 2024 22:39
@korikuzma korikuzma marked this pull request as ready for review July 16, 2024 22:40
@korikuzma korikuzma requested review from a team as code owners July 16, 2024 22:40
@korikuzma korikuzma changed the title feat!: add enum for as_version + add restrictions to ga4gh_serialize_as_version feat: add enum for as_version + add restrictions to ga4gh_serialize_as_version Jul 17, 2024
Copy link
Member

@ahwagner ahwagner left a comment

Choose a reason for hiding this comment

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

This looks outstanding, thanks @korikuzma!

@ahwagner ahwagner merged commit 8c01d00 into main Jul 17, 2024
6 checks passed
@ahwagner ahwagner deleted the issue-382-cleanup branch July 17, 2024 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:medium Medium priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants