Add Laterality enum and region_coverage to ProjectionMeasurementMatrix#2
Open
reneyagmur wants to merge 5 commits intomainfrom
Open
Add Laterality enum and region_coverage to ProjectionMeasurementMatrix#2reneyagmur wants to merge 5 commits intomainfrom
reneyagmur wants to merge 5 commits intomainfrom
Conversation
danielsf
requested changes
Apr 24, 2026
danielsf
left a comment
There was a problem hiding this comment.
Just some changes to the unit tests. Other than that, looks good.
Collaborator
Author
|
@danielsf ready for re-review |
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.
Motivation
Projection matrices can be split into ipsilateral/contralateral by naming convention (e.g.,
wnm_exc_proj_ipsi), but laterality is not captured in the schema, making it unqueryable.Similarly, determining which CCF regions a dataset has projection data in requires loading the full cells × regions matrix and checking for non-zero columns. This is a common cross-dataset query that should be precomputed.
Changes
schemas/base_schema.yamlLateralityenum:IPSILATERAL,CONTRALATERAL,BILATERAL,UNKNOWNlateralityslot withrange: Lateralityschemas/projection_schema.yamllaterality: required field onProjectionMeasurementMatrixregion_coverage: optional multivaluedBrainRegionlist onProjectionMeasurementMatrix— precomputed subset ofregion_indexwhere at least one data item has a non-zero valuesrc/connects_common_connectivity/models.pybash scripts/generate_models.shtests/test_basic.pytest_laterality_enum— all four enum values existtest_projection_measurement_matrix_laterality— required enforcement, valid/invalid enum validationtest_region_coverage_on_pmm— optional field, list type, subset ofregion_indexsrc/connects_common_connectivity/io/io_plans.mdspecifying two planned utility functions:populate_region_coverage(pmm, matrix)— auto-populateregion_coveragefrom a dense values arraycompare_region_coverage(pmms)— shared regions, shared coverage, and exclusive coverage across datasets.devcontainer/environment/postInstallTesting
9 tests pass (
uv run pytest -q).