Skip to content

this includes refinements of the models.py module, and a generalizati…#73

Merged
cmatKhan merged 2 commits intoBrentLab:devfrom
cmatKhan:huggingface
Feb 6, 2026
Merged

this includes refinements of the models.py module, and a generalizati…#73
cmatKhan merged 2 commits intoBrentLab:devfrom
cmatKhan:huggingface

Conversation

@cmatKhan
Copy link
Member

@cmatKhan cmatKhan commented Feb 4, 2026

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 have role: experimental_condition. This allows for regulator_locus_tag and regulator_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

…on of the virtual_db config to allow any field in the datacard to be configured, eg regulator_locus_tag
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_conditions prefix 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.

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.

1 participant