Skip to content

Commit 732edac

Browse files
authored
Merge pull request #1209 from AllenNeuralDynamics/release-v1.3.0
Release v1.3.0
2 parents 04b5341 + 625e601 commit 732edac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+213897
-43503
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,15 @@ where scope (optional) describes the packages affected by the code changes and t
102102
- **test**: Adding missing tests or correcting existing tests
103103
to set up your environment.
104104
105-
When you are ready to open a pull request, please link any relevant issues and request a review. Thanks for contributing!
105+
When you are ready to open a pull request, please link any relevant issues and request a review. Thanks for contributing!
106+
107+
## Release
108+
109+
- From dev, create a branch called release-vX.Y.Z
110+
- Manually increment the version number in the aind_data_schema/__init__.py file to match
111+
- Manually increment the major/minor/patch versions of the core files as needed
112+
- Push the branch and open a PR into main
113+
- After this push, any last minute changes to the release-vX.Y.Z will have to done to via a PR
114+
- After review, use a merge commit to merge into main
115+
- Open a PR from main back into dev so they're synced again
116+
- Create a Github release with the corresponding tag, modify the auto-generated release notes to focus on the major changes that occurred

docs/source/quality_control.md

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Quality control is a collection of **evaluations** based on sets of **metrics**
66

77
`QCEvaluation`s should be generated during pipelines: before raw data upload, during processing, and during analysis by researchers.
88

9-
Each `QualityControl`, `QCEvaluation`, and `QCMetric` includes a `aind_data_schema.quality_control.State` which is a timestamped object indicating that the Overall QC/Evaluation/Metric passes, fails, or is in a pending state waiting for manual annotation.
9+
The overall `QualityControl`, each `QCEvaluation`, and each `QCMetric` can be evaluated to get a `aind_data_schema.quality_control.State` which indicates whether the Overall QC/Evaluation/Metric passes, fails, or is in a pending state waiting for manual annotation.
1010

11-
The state of an evaluation is set automatically to the lowest of its metric's states. A single failed metric sets an entire evaluation to fail. While a single pending metric (with all other metrics passing) sets an entire evaluation to pending. An optional setting `QCEvaluation.allow_failed_metrics` allows you to ignore failures, which can be useful in situations where an evaluation is not critical for quality control.
11+
The state of an evaluation is set automatically to the lowest of its metric's states. A single failed metric sets an entire evaluation to fail. A single pending metric (with all other metrics passing) sets an entire evaluation to pending. An optional setting `QCEvaluation.allow_failed_metrics` allows you to ignore failures, which can be useful in situations where an evaluation is not critical for quality control.
1212

1313
## Details
1414

@@ -30,75 +30,21 @@ Each `QCMetric` is a single value or set of values that can be computed, or obse
3030

3131
`QCMetric`s have a `Status`. The `Status` should depend directly on the `QCMetric.value`, either by a simple function: "value>5", or by a qualitative rule: "Field of view includes visual areas". The `QCMetric.description` field should be used to describe the rule used to set the status. Metrics can be evaluated multiple times, in which case the new status should be appended the `QCMetric.status_history`.
3232

33+
**Q: What is a metric reference?**
34+
3335
Metrics should include a `QCMetric.reference`. References are intended to be publicly accessible images, figures, combined figures with multiple panels, or videos that support the metric or provide information necessary for manual annotation of a metric's status.
3436

37+
See the AIND section for specifics about how references are rendered in the QC Portal.
38+
3539
**Q: What are the status options for metrics?**
3640

37-
In our quality control a metric's status is always `PASS`, `PENDING` (waiting for manual annotation), or `FAIL`. `PENDING` should be used when a user must manually annotated the metric's state.
41+
In our quality control a metric's status is always `PASS`, `PENDING` (waiting for manual annotation), or `FAIL`.
3842

3943
We enforce this minimal set of states to prevent ambiguity and make it easier to build tools that can interpret the status of a data asset.
4044

4145
## Details for AIND users
4246

43-
### Uploading QC
44-
45-
#### Preferred workflow
46-
47-
**Metadata**
48-
49-
If you are building `QCEvaluation` and `QCMetric` objects prior to raw data upload or in a capsule alongside your processing or analysis, your workflow is:
50-
51-
```
52-
from aind_data_schema.core.quality_control import QualityControl
53-
54-
# Build your QCEvaluations and metrics
55-
evaluations = [QCEvaluation(), ...]
56-
57-
# Build your QualityControl object
58-
qc = QualityControl(evaluations=evaluations)
59-
60-
qc.write_standard_file()
61-
```
62-
63-
The indexer will pick up this file alongside the other metadata files and handle it appropriately.
64-
65-
**References**
66-
67-
Each `QCMetric` you build should have an attached reference. Our preference is that you post these images to [FigURL](https://github.com/flatironinstitute/figurl/blob/main/doc/intro.md) and put the generated URL into the reference.
68-
69-
We recommend that you write PNG files for images and static multi-panel figures, MP4 files for videos, and Altair charts for interactive figures.
70-
71-
#### Alternate workflows
72-
73-
**Metadata**
74-
75-
We'll post documentation on how to append `QCEvaluations` to pre-existing quality_control.json files, via DocDB using the `aind-data-access-api`, in the future. For now, you can refer to the code snippet in the [`aind-qc-capsule-example`](https://github.com/AllenNeuralDynamics/aind-qc-capsule-example/).
76-
77-
**References**
78-
79-
You can also place the references in the data asset itself, to do this include the relative path "qc_images/your_image.png" to that asset inside of the results folder.
80-
81-
### QC Portal
82-
83-
The QC Portal is a browser application that allows users to view and interact with the AIND QC metadata and to annotate ``PENDING`` metrics with qualitative evaluations. The portal is maintained by scientific computing, reach out to us with any questions or concerns.
84-
85-
The portal works by pulling the metadata object from the Document Database (DocDB). When you make changes to metrics or add notes the **submit** button will be enabled, submitting pushes your updates to the DocDB along with a timestamp and your name.
86-
87-
**Q: When does the state get set for the QCEvaluation and QualityControl objects?**
88-
89-
The QC portal automatically calls ``QualityControl.evaluate_status()`` whenever you submit changes to the metrics. This first evaluates the individual `QCEvaluation` objects, and then evaluates the overall status.
90-
91-
**Q: How do reference URLs get pulled into the QC Portal?**
92-
93-
Each metric is associated with a reference figure (PDF preferred), image (png preferred), or video (mp4 preferred). The QC portal can interpret four ways of setting the reference field:
94-
95-
- Provide a relative path to a file in this data asset's S3 bucket, i.e. "figures/my_figure.png". The mount/asset name should not be included.
96-
- Provide a url to a FigURL figure
97-
- Provide the name of one of the interactive plots, e.g. "ecephys-drift-map"
98-
99-
**Q: I saw fancy things like dropdowns in the QC Portal, how do I do that?**
100-
101-
By default the QC portal displays dictionaries as tables where the values can be edited. We also support a few special cases to allow a bit more flexibility or to constrain the actions that manual annotators can take. Install the [`aind-qcportal-schema`](https://github.com/AllenNeuralDynamics/aind-qcportal-schema/blob/dev/src/aind_qcportal_schema/metric_value.py) package and set the `value` field to the corresponding pydantic object to use these.
47+
Instructions for uploading QC for viewing in the QC portal can be found [here](https://github.com/AllenNeuralDynamics/aind-qc-portal).
10248

10349
### Multi-asset QC
10450

@@ -110,4 +56,4 @@ You should follow the preferred/alternate workflows described above. If your mul
11056

11157
**Q: I want to be able to store data about each of the evaluated assets in this metric**
11258

113-
Take a look at the `MultiAssetMetric` class in `aind-qc-portal-schema`. It allows you to pass a list of values which will be matched up with the `evaluated_assets` names. You can also include options which will appear as dropdowns or checkboxes.
59+
Take a look at the `MultiAssetMetric` class in `aind-qc-portal-schema`. It allows you to pass a list of values which will be matched up with the `evaluated_assets` names. You can also include options which will appear as dropdowns or checkboxes.

examples/aibs_smartspim_instrument.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/instrument.py",
3-
"schema_version": "1.0.3",
3+
"schema_version": "1.0.4",
44
"instrument_id": "440_SmartSPIM2_20231004",
55
"modification_date": "2023-10-04",
66
"instrument_type": "SmartSPIM",

examples/aibs_smartspim_procedures.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/procedures.py",
3-
"schema_version": "1.1.3",
3+
"schema_version": "1.2.1",
44
"subject_id": "651286",
55
"subject_procedures": [
66
{

examples/aind_smartspim_instrument.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/instrument.py",
3-
"schema_version": "1.0.3",
3+
"schema_version": "1.0.4",
44
"instrument_id": "440_SmartSPIM1_20231004",
55
"modification_date": "2023-10-04",
66
"instrument_type": "SmartSPIM",

examples/bergamo_ophys_session.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/session.py",
3-
"schema_version": "1.0.3",
3+
"schema_version": "1.1.1",
44
"protocol_id": [],
55
"experimenter_full_name": [
66
"John Doe"
@@ -53,7 +53,12 @@
5353
"index": 0,
5454
"imaging_depth": 150,
5555
"imaging_depth_unit": "micrometer",
56-
"targeted_structure": "M1",
56+
"targeted_structure": {
57+
"atlas": "CCFv3",
58+
"name": "Primary motor area",
59+
"acronym": "MOp",
60+
"id": "985"
61+
},
5762
"fov_coordinate_ml": "1.5",
5863
"fov_coordinate_ap": "1.5",
5964
"fov_coordinate_unit": "micrometer",

examples/bergamo_ophys_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
FieldOfView(
5656
index=0,
5757
imaging_depth=150,
58-
targeted_structure="M1",
58+
targeted_structure="MOp",
5959
fov_coordinate_ml=1.5,
6060
fov_coordinate_ap=1.5,
6161
fov_reference="Bregma",

examples/data_description.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/data_description.py",
3-
"schema_version": "1.0.3",
3+
"schema_version": "1.0.4",
44
"license": "CC-BY-4.0",
55
"platform": {
66
"name": "Electrophysiology platform",

examples/ephys_rig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/rig.py",
3-
"schema_version": "1.0.3",
3+
"schema_version": "1.0.4",
44
"rig_id": "323_EPHYS1_20231003",
55
"modification_date": "2023-10-03",
66
"mouse_platform": {

examples/ephys_session.json

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/session.py",
3-
"schema_version": "1.0.3",
3+
"schema_version": "1.1.1",
44
"protocol_id": [],
55
"experimenter_full_name": [
66
"Max Quibble",
@@ -37,7 +37,12 @@
3737
"coordinate_transform": "behavior/calibration_info_np2_2023_04_24.npy",
3838
"calibration_date": "2023-04-25T00:00:00Z",
3939
"notes": "Moved Y to avoid blood vessel, X to avoid edge. Mouse made some noise during the recording with a sudden shift in signals. Lots of motion. Maybe some implant motion.",
40-
"primary_targeted_structure": "LGd",
40+
"primary_targeted_structure": {
41+
"atlas": "CCFv3",
42+
"name": "Dorsal part of the lateral geniculate complex",
43+
"acronym": "LGd",
44+
"id": "170"
45+
},
4146
"other_targeted_structure": null,
4247
"targeted_ccf_coordinates": [
4348
{
@@ -70,7 +75,12 @@
7075
"coordinate_transform": "behavior/calibration_info_np2_2023_04_24.py",
7176
"calibration_date": "2023-04-25T00:00:00Z",
7277
"notes": "Trouble penetrating. Lots of compression, needed to move probe. Small amount of surface bleeding/bruising. Initial Target: X;10070.3\tY:7476.6",
73-
"primary_targeted_structure": "LC",
78+
"primary_targeted_structure": {
79+
"atlas": "CCFv3",
80+
"name": "Locus ceruleus",
81+
"acronym": "LC",
82+
"id": "147"
83+
},
7484
"other_targeted_structure": null,
7585
"targeted_ccf_coordinates": [
7686
{
@@ -172,7 +182,12 @@
172182
"coordinate_transform": "behavior/calibration_info_np2_2023_04_24.npy",
173183
"calibration_date": "2023-04-25T00:00:00Z",
174184
"notes": "Moved Y to avoid blood vessel, X to avoid edge. Mouse made some noise during the recording with a sudden shift in signals. Lots of motion. Maybe some implant motion.",
175-
"primary_targeted_structure": "LGd",
185+
"primary_targeted_structure": {
186+
"atlas": "CCFv3",
187+
"name": "Dorsal part of the lateral geniculate complex",
188+
"acronym": "LGd",
189+
"id": "170"
190+
},
176191
"other_targeted_structure": null,
177192
"targeted_ccf_coordinates": [
178193
{
@@ -205,7 +220,12 @@
205220
"coordinate_transform": "behavior/calibration_info_np2_2023_04_24.py",
206221
"calibration_date": "2023-04-25T00:00:00Z",
207222
"notes": "Trouble penetrating. Lots of compression, needed to move probe. Small amount of surface bleeding/bruising. Initial Target: X;10070.3\tY:7476.6",
208-
"primary_targeted_structure": "LC",
223+
"primary_targeted_structure": {
224+
"atlas": "CCFv3",
225+
"name": "Locus ceruleus",
226+
"acronym": "LC",
227+
"id": "147"
228+
},
209229
"other_targeted_structure": null,
210230
"targeted_ccf_coordinates": [
211231
{

0 commit comments

Comments
 (0)