this includes refinements of the models.py module, and a generalizati…#73
Merged
cmatKhan merged 2 commits intoBrentLab:devfrom Feb 6, 2026
Merged
this includes refinements of the models.py module, and a generalizati…#73cmatKhan merged 2 commits intoBrentLab:devfrom
cmatKhan merged 2 commits intoBrentLab:devfrom
Conversation
…on of the virtual_db config to allow any field in the datacard to be configured, eg regulator_locus_tag
There was a problem hiding this comment.
Pull request overview
This pull request generalizes the VirtualDB configuration to make path resolution more explicit and flexible. The key changes remove the implicit assumption that all configurable fields must be under experimental_conditions with role: experimental_condition, now requiring explicit paths from the datacard root.
Changes:
- Generalized virtual DB config path resolution to require explicit
experimental_conditionsprefix in paths for repo/config-level properties - Refactored models.py to use modern Pydantic v2 patterns (computed fields, field serializers, consolidated validators)
- Updated all tests and documentation to reflect the new explicit path requirements
- Added models_deprecated.py as a backup of the old implementation
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tfbpapi/virtual_db.py | Refactored _extract_repo_level to build root_data from model_extra instead of using experimental_conditions, removed unused DataCardError import |
| tfbpapi/models.py | Added TypeAlias for FactorAliases, consolidated validators, converted to computed_field/cached_property pattern, modernized field serialization |
| tfbpapi/models_deprecated.py | New file containing backup of old models.py implementation |
| tfbpapi/datacard.py | Updated to use default_config property instead of get_default_config() method |
| tfbpapi/tests/test_virtual_db.py | Updated all test configs to use explicit experimental_conditions. prefix in paths |
| tfbpapi/tests/test_models.py | Updated test to use default_config property instead of method |
| tfbpapi/tests/test_metadata_config_models.py | Updated error message assertions to match consolidated validator messages |
| docs/virtual_database_concepts.md | Updated tutorial to document new explicit path requirements, fixed typos |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Feb 6, 2026
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.
The critical change here is a generalization of the virtual DB config. It now requires that experimental_condition be included in the
path, and doesn't require that configurable fields haverole: experimental_condition. This allows forregulator_locus_tagandregulator_symbol, eg, to be configured.The tutorial is updated to reflect this
Edit: This is now a much larger change to the virtualDB backend. No longer using pandas for the query/filter/etc interface. Now using duckdb directly.
The internal reprsentation of hte data has changed. Views are created on the parquet files.
query()remains the main interface to the data, but it now accepts SQL.This closes #67 and all of the sub issues