feat(config): move from hydra to pydantic models - #1221
Draft
project-defiant wants to merge 9 commits into
Draft
Conversation
- Create config/ package with SessionDefaults (Pydantic frozen model) - Move all legacy step config dataclasses to config/defaults.py - Rewrite test_config.py for Pydantic SessionDefaults model - All 15 existing step config dataclasses remain importable from gentropy.config Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add BiosampleIndexDefaults Pydantic model (all fields required) - Update BiosampleIndexStep constructor to accept (config, session) - Rewrite test to construct config and validate step initialization - Add config validation test Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add ColocalisationDefaults Pydantic model with 3 required + 3 optional fields - Update ColocalisationStep constructor to accept (config, session) - Add config validation tests and update existing tests to use config Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Migrate the following steps from dataclass StepConfig to Pydantic config models: credible_set_qc, decode_ingestion (4 configs), intervals (2 configs), study_locus_validation, study_validation, sumstat_qc_step, variant_index (2 configs). Fix duplicate class definition bugs caused by sequential Write tool operations in 4 files: sumstat_qc_step, study_validation, variant_index, intervals. Update all corresponding test files to use (config=Defaults(...), session=...) pattern and add config validation tests. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add co-located Pydantic config models and update step classes to accept (config, session) parameters for: - eqtl_catalogue, finngen_finemapping_ingestion, finngen_studies, finngen_sumstat_preprocess, finngen_ukb_mvp_meta, foldx_ingestion - gnomad_ingestion - gwas_catalog_study_curation, gwas_catalog_study_index, gwas_catalog_sumstat_preprocess, gwas_catalog_top_hits - l2g (4 configs: evidence, associations, feature_matrix, model) - ld_based_clumping, locus_breaker_clumping - lof_curation_ingestion, molecular_complex, pics, pqtl_study - ukb_ppp_eur_sumstat_preprocess, window_based_clumping All files pass ruff check, ruff format, and mypy. 8 test failures are pre-existing (unrelated to these changes). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ation_method - Replace mutable list[] defaults with Field(default_factory=list) in: - study_validation.py (StudyValidationDefaults.invalid_qc_reasons) - study_locus_validation.py (StudyLocusValidationDefaults.invalid_qc_reasons) - intervals.py (IntervalE2GDefaults.invalid_qc_reasons) - intervals.py (IntervalEpiractionDefaults.invalid_qc_reasons) - Add field_validator for colocalisation_method in colocalisation.py to reject invalid values at config validation time (case-insensitive) - Simplify step body normalization code since fields are now always list[str] Agent-Logs-Url: https://github.com/project-defiant/gentropy/sessions/25062353-a56a-4286-a077-a67a6c204c94 Co-authored-by: project-defiant <69353402+project-defiant@users.noreply.github.com>
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.
✨ Context
🛠 What does this PR implement
🙈 Missing
🚦 Before submitting
devbranch?make test)?uv run pre-commit run --all-files)?