Skip to content

refactor: document CCV classification, look up method type by value - #80

Merged
korikuzma merged 1 commit into
ballot-updatesfrom
cleanup-ccv-doc-and-methodtype-lookup
Sep 30, 2026
Merged

korikuzma merged 1 commit into
ballot-updatesfrom
cleanup-ccv-doc-and-methodtype-lookup

Conversation

@larrybabb

Copy link
Copy Markdown
Contributor

Two remaining cleanups from the review of #78. (The third — the duplicated iriReference member in ExperimentalVariantFunctionalImpactProposition.object — was already fixed on ballot-updates in "fix dup", so it's not included here.)

1. VariantOncogenicityStatement.classification was undocumented

The field used Field(...,) with no description, so the Field() wrapper added nothing over a bare annotation and the field shipped undocumented (unlike its ACMG/AAC siblings and the base Statement.classification). Added a CCV-appropriate description mirroring the sibling profiles.

2. Method type resolved by mangled member NAME instead of value

_validate_method_type_evidence_outcome did cls.MethodType[method_type.upper()], looking the enum up by member name. That only works because every MethodType value happens to equal its lowercased member name — a coupling that silently breaks the day a value diverges from its identifier. specifiedBy.methodType holds the enum value, so it's now resolved with cls.MethodType(method_type) (value lookup), keeping the same friendly error message.

Verification

  • ruff / ruff-format pre-commit hooks pass.
  • Value lookup resolves all 17 ACMG + 8 CCV method-type values (verified against the enum source); unknown strings raise ValueError, which the surrounding except still converts to the friendly message.

Note: local dependency versions are stale (vrs 2.0.0 / cat_vrs 0.5.0, no ga4gh.core.metadata), so the full model suite could not be executed here — CI on the updated deps should confirm.

🤖 Generated with Claude Code

Two cleanups from the #78 review (the duplicate proposition union was
already fixed on this branch by "fix dup"):

- ccv: give VariantOncogenicityStatement.classification a description so
  its Field(...) documents the field like every sibling.
- validators: resolve the method type by enum VALUE
  (cls.MethodType(method_type)) instead of by mangled member NAME
  (cls.MethodType[method_type.upper()]). The name-based lookup only worked
  because every value equals its lowercased member name; methodType holds
  the value, so look it up by value.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@korikuzma
korikuzma merged commit 8f9b0b1 into ballot-updates Sep 30, 2026
8 checks passed
@korikuzma
korikuzma deleted the cleanup-ccv-doc-and-methodtype-lookup branch September 30, 2026 10:07
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