You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: allow passing strings to default_grouping, also build docs (#1648)
* refactor: allow un-tupled string to make life easier
* docs: update
* fix: actually allow str |
* tests: fix tests, and properly handle input data that looks like new data
* docs: improve how allow_tag_failures is explained
* chore: lint
* fix: overenthusiastic defensiveness
Copy file name to clipboardExpand all lines: docs/base/core/quality_control.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,15 +39,15 @@ tags = {
39
39
}
40
40
```
41
41
42
-
Use the `QualityControl.default_grouping` list to define how users should organize a visualization by default. In almost all cases *modality should be the top-level grouping*. For example, building on the example above you might group by: `[["modality"], ["probe", "video"], ["shank"]]` to get a tree split by modality first (which naturally splits ephys and behavior-videos tags into two groups), then by which probe or video a metric belongs to, and finally only for probes the individual shanks are split into groups.
42
+
Use the `QualityControl.default_grouping` list to define how users should organize a visualization by default. In almost all cases *modality should be the top-level grouping*. For example, building on the example above you might group by: `["modality", ("probe", "video"), "shank"]` to get a tree split by modality first (which naturally splits ephys and behavior-videos tags into two groups), then by which probe or video a metric belongs to, and finally only for probes the individual shanks are split into groups.
43
43
44
44
### QualityControl.evaluate_status()
45
45
46
46
You can evaluate the state of a set of metrics filtered by any combination of modalities, stages, and tags on a specific date (by default, today). When evaluating the [Status](#status) of a group of metrics the following rules apply:
47
47
48
-
First, any metric that is failing and also has a matching tag *value* in the `QualityControl.allow_tag_failures` list is set to pass. This allows you to specify that certain metrics are not critical to a data asset.
48
+
First, any metric that has a tag *value* in the `QualityControl.allow_tag_failures` list is ignored. This allows you to specify that certain metrics are not critical to a data asset.
49
49
50
-
Then, given the status of all the metrics in the group:
50
+
Then, given the status of all the remaining metrics in the group:
51
51
52
52
1. If any metric is still failing, the evaluation fails
53
53
2. If any metric is pending and the rest pass the evaluation is pending
Copy file name to clipboardExpand all lines: docs/source/quality_control.md
+22-7Lines changed: 22 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,15 +24,30 @@ If you find yourself computing a value for something smaller than an entire moda
24
24
25
25
### Tags
26
26
27
-
`tags` are any string that naturally groups sets of metrics together. Good tags are things like: "Probe A", "Motion correction", and "Pose tracking". The stage and modality are automatically treated as tags, you do not need to include them in the tags list.
27
+
`tags` are groups of descriptors that define how metrics are organized hierarchically, making it easier to visualize metrics. Good tag keys (groups) are things like "probe" and good tag values are things like "Probe A" or just "A".
28
+
29
+
```{python}
30
+
# For an electrophysiology metric
31
+
tags = {
32
+
"probe": "A",
33
+
"shank": "0",
34
+
}
35
+
36
+
# For a behavioral video metric
37
+
tags = {
38
+
"video": "left body",
39
+
}
40
+
```
41
+
42
+
Use the `QualityControl.default_grouping` list to define how users should organize a visualization by default. In almost all cases *modality should be the top-level grouping*. For example, building on the example above you might group by: `["modality", ("probe", "video"), "shank"]` to get a tree split by modality first (which naturally splits ephys and behavior-videos tags into two groups), then by which probe or video a metric belongs to, and finally only for probes the individual shanks are split into groups.
28
43
29
44
### QualityControl.evaluate_status()
30
45
31
46
You can evaluate the state of a set of metrics filtered by any combination of modalities, stages, and tags on a specific date (by default, today). When evaluating the [Status](#status) of a group of metrics the following rules apply:
32
47
33
-
First, any metric that is failing and also has a matching tag (or tuple of tags) in the `QualityControl.allow_tag_failures` list is set to pass. This allows you to specify that certain metrics are not critical to a data asset.
48
+
First, any metric that has a tag *value*in the `QualityControl.allow_tag_failures` list is ignored. This allows you to specify that certain metrics are not critical to a data asset.
34
49
35
-
Then, given the status of all the metrics in the group:
50
+
Then, given the status of all the remaining metrics in the group:
36
51
37
52
1. If any metric is still failing, the evaluation fails
38
53
2. If any metric is pending and the rest pass the evaluation is pending
@@ -72,8 +87,8 @@ Collection of quality control metrics evaluated on a data asset to determine pas
72
87
|`metrics`| List[[QCMetric](quality_control.md#qcmetric) or [CurationMetric](quality_control.md#curationmetric)]| Evaluations |
73
88
|`key_experimenters`|`Optional[List[str]]`| Key experimenters (Experimenters who are responsible for quality control of this data asset) |
74
89
|`notes`|`Optional[str]`| Notes |
75
-
|`default_grouping`|`List[str]`| Default grouping (Default tag grouping for this QualityControl object, used in visualizations) |
76
-
|`allow_tag_failures`|`List[str or tuple]`| Allow tag failures (List of tags that are allowed to fail without failing the overall QC) |
90
+
|`default_grouping`|`List[str or tuple[str, ...]]`| Default grouping (Tag *keys* that should be used to group metrics hierarchically for visualization) |
91
+
|`allow_tag_failures`|`List[str]`| Allow tag failures (List of tag *values* that are allowed to fail without failing the overall QC) |
77
92
|`status`|`Optional[dict]`| Status mapping (Mapping of tags, modalities, and stages to their evaluated status, automatically computed) |
78
93
79
94
@@ -104,7 +119,7 @@ Description of a curation metric
104
119
|`status_history`| List[[QCStatus](quality_control.md#qcstatus)]| Metric status history |
|`reference`|`Optional[str]`| Metric reference image URL or plot type |
107
-
|`tags`|`List[str]`| Tags (Tags group QCMetric objects to allow for grouping and filtering) |
122
+
|`tags`|`Dict[str, str]`| Tags (Tags group QCMetric objects. Unique keys define groups of tags, for example {'probe': 'probeA'}.) |
108
123
|`evaluated_assets`|`Optional[List[str]]`| List of asset names that this metric depends on (Set to None except when a metric's calculation required data coming from a different data asset.) |
109
124
110
125
@@ -121,7 +136,7 @@ Description of a single quality control metric
121
136
|`status_history`| List[[QCStatus](quality_control.md#qcstatus)]| Metric status history |
|`reference`|`Optional[str]`| Metric reference image URL or plot type |
124
-
|`tags`|`List[str]`| Tags (Tags group QCMetric objects to allow for grouping and filtering) |
139
+
|`tags`|`Dict[str, str]`| Tags (Tags group QCMetric objects. Unique keys define groups of tags, for example {'probe': 'probeA'}.) |
125
140
|`evaluated_assets`|`Optional[List[str]]`| List of asset names that this metric depends on (Set to None except when a metric's calculation required data coming from a different data asset.) |
0 commit comments