Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
aa56b67
Add eFP/ePlant gene ID validation, microarray probeset support, and m…
rmobmina Jun 25, 2026
a577ee3
Integrate Vincent's regex registry, fix master JSON species, refactor…
rmobmina Jul 17, 2026
afd8c63
Remove scratch CSVs, MDs, and one-off analysis files from repo root
rmobmina Jul 17, 2026
77b1d51
Remove personal attribution headers from source and test files
rmobmina Jul 23, 2026
ec8f3ac
Make combined_master.json build deterministic
rmobmina Jul 23, 2026
f72481e
Fix failing tests: generalize mfinder skip, drop orphaned eplant test
rmobmina Jul 23, 2026
16ecfb0
Remove dead-on-arrival DB imports from config/init.sh
rmobmina Jul 23, 2026
d61efa2
Add eFP "To the Experiment" link audit script
rmobmina Jul 23, 2026
ac83b9c
Merge remote-tracking branch 'upstream/dev' into cleaned-endpoint
rmobmina Jul 23, 2026
e15c770
Unify per-species gene ID validation onto Vincent's regex registry
rmobmina Jul 23, 2026
654ba01
Fix CI: real fixture data never loading, rpds-py incompatible with 3.10
rmobmina Jul 23, 2026
ec5acbf
Remove api/random_rows_json/ from version control
rmobmina Jul 23, 2026
deb0bd1
Add SUPeR Viewer UMAP + pseudobulk gene expression endpoints
rmobmina Jul 27, 2026
9f4b8b0
Add data-retrieval coverage for the UMAP and pseudobulk expression en…
rmobmina Jul 27, 2026
73e6afd
Remove build/scrape/reporting tooling not needed by the running API
rmobmina Jul 27, 2026
196342e
Populate real sample-group data for the 7 SUPeR Viewer pseudobulk dat…
rmobmina Jul 27, 2026
f158077
Clean up PR: drop local ePlant XML data, fold master_data_utils into …
rmobmina Jul 28, 2026
e7c5f96
Add api/random_rows_json/ fallback dataset for local eFP seed queries
rmobmina Jul 30, 2026
9aee55b
Revert unrelated init.sh/SNP scope creep; simplify regex loading and …
rmobmina Aug 5, 2026
d65a345
Update: checked the schemas against prod, verified the SQL schemas an…
VinLau Aug 5, 2026
e5e5709
Merge pull request #1 from VinLau/feature/reena-steven-integrated-end…
rmobmina Aug 5, 2026
2bf6d2c
Adapt to VinLau's combined_master.json field rename; restore 10 dropp…
rmobmina Aug 5, 2026
1aa5aeb
Move SUPeR Viewer UMAP + pseudobulk endpoints to feature/steven-changes
rmobmina Aug 5, 2026
b31f367
Address PR 328 review: simplify regex validation, drop bootstrap/fall…
rmobmina Aug 6, 2026
6047eef
Replace per-species is_XXX_gene_valid() wrappers with direct is_efp_g…
rmobmina Aug 7, 2026
3050b4c
Fix flake8 E302 in test_efp_data.py
rmobmina Aug 10, 2026
7f420a0
Fix cacao gene ID validation bypass and simplify eFP query service
rmobmina Aug 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions api/models/bar_utils.py

This file was deleted.

49 changes: 3 additions & 46 deletions api/models/efp_dynamic.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
"""
Reena Obmina | BCB330 Project 2025-2026 | University of Toronto

Dynamic SQLAlchemy model generation for all eFP databases.

At import time, one ORM model class is generated per database entry in
SIMPLE_EFP_DATABASE_SCHEMAS and stored in SIMPLE_EFP_SAMPLE_MODELS.
This replaces ~1,984 lines of hand-written boilerplate with a single registry.
"""
"""Generates one SQLAlchemy model class per database in SIMPLE_EFP_DATABASE_SCHEMAS at import time, instead of hand-writing each one."""

from __future__ import annotations

Expand All @@ -20,23 +12,7 @@


def _to_sqla_type(column_spec):
"""
Map a column specification dictionary to a SQLAlchemy column type.

Converts the simple type descriptors used in schema definitions to the
appropriate SQLAlchemy type objects for ORM model generation.

:param column_spec: Column specification with 'type', 'length', and 'unsigned' keys
:type column_spec: Dict[str, Any]
:return: SQLAlchemy column type (String, Integer, Float, or Text)
:rtype: sqlalchemy.types.TypeEngine
:raises ValueError: If column type is not one of: string, integer, float, text

Example::

col_spec = {"type": "string", "length": 24}
sqla_type = _to_sqla_type(col_spec) # Returns String(24)
"""
"""Map a schema column spec ('type', 'length', 'unsigned') to a SQLAlchemy column type."""
col_type = column_spec.get("type")
if col_type == "string":
return String(column_spec["length"])
Expand All @@ -52,26 +28,7 @@ def _to_sqla_type(column_spec):


def _generate_model(bind_key: str, spec) -> db.Model:
"""
Build a concrete SQLAlchemy model class for the given schema specification.

Dynamically creates an ORM model with the specified table name, bind key,
and columns based on the schema definition. The generated model class can
be used like any Flask-SQLAlchemy model.

:param bind_key: Database bind key (e.g., 'cannabis', 'embryo')
:type bind_key: str
:param spec: Database schema specification from SIMPLE_EFP_DATABASE_SCHEMAS
:type spec: Dict[str, Any]
:return: Dynamically generated SQLAlchemy model class
:rtype: db.Model

Example::

schema = SIMPLE_EFP_DATABASE_SCHEMAS['cannabis']
CannabisModel = _generate_model('cannabis', schema)
# Returns class: CannabisSampleData(db.Model)
"""
"""Build a concrete SQLAlchemy model class for the given database's schema spec."""
attrs = {"__bind_key__": bind_key, "__tablename__": spec["table_name"]}

for column in spec["columns"]:
Expand Down
Loading
Loading