Conversation
…alues close #442 * Add model_validators to `Range` and `SequenceLocation`
ahwagner
left a comment
There was a problem hiding this comment.
start < end should not be enforced, unless SequenceReference.circular = False. Though it would be nice to raise a warning if end < start and SequenceReference.circular is undefined. A discussion on this topic was first raised in #362, and later moved ga4gh/vrs#477. The VRS documentation doesn't capture this (ope), but it will be necessary to represent variants spanning the origin.
This isn't described in the VRS documentation, opened ga4gh/vrs#537 to address. Just providing a heads-up here as this PR contains some validation code corresponding to this issue.
| start: Optional[Union[Range, int]] = Field( | ||
| None, | ||
| description='The start coordinate or range of the SequenceLocation. The minimum value of this coordinate or range is 0. MUST represent a coordinate or range less than the value of `end`.', | ||
| description='The start coordinate or range of the SequenceLocation. The minimum value of this coordinate or range is 0. MUST represent a coordinate or range less than or equal to the value of `end`.', |
There was a problem hiding this comment.
Like that this needs to be >= 0. There should not be a constraint on start < end for VRS 2.0, but just noted that this wasn't updated in the VRS 2.0 field definitions. Will address presently.
| end: Optional[Union[Range, int]] = Field( | ||
| None, | ||
| description='The end coordinate or range of the SequenceLocation. The minimum value of this coordinate or range is 0. MUST represent a coordinate or range greater than the value of `start`.', | ||
| description='The end coordinate or range of the SequenceLocation. The minimum value of this coordinate or range is 0. MUST represent a coordinate or range greater than or equal to the value of `start`.', |
There was a problem hiding this comment.
Like that this needs to be >= 0. There should not be a constraint on start < end for VRS 2.0, but just noted that this wasn't updated in the VRS 2.0 field definitions. Will address presently.
|
@ahwagner can you re-review? |
…alues
close #442
RangeandSequenceLocation