compose-runner 0.14.4__tar.gz → 0.14.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {compose_runner-0.14.4 → compose_runner-0.14.6}/PKG-INFO +2 -2
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/_version.py +2 -2
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/run.py +25 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_mkdachis_comparison_workflow.yaml +1 -1
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_apply_filter.py +64 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/pyproject.toml +1 -1
- {compose_runner-0.14.4 → compose_runner-0.14.6}/.gitignore +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/Dockerfile +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/LICENSE +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/README.md +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/aws_lambda/.dockerignore +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/aws_lambda/Dockerfile +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/__init__.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/aws_lambda/__init__.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/aws_lambda/common.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/aws_lambda/cost_check_handler.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/aws_lambda/log_poll_handler.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/aws_lambda/results_handler.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/aws_lambda/run_handler.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/aws_lambda/status_handler.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/cli.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/coverage.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/ecs_task.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/images.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/metadata.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/sentry.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_cli/test_cli.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_lambda_handlers/test_select_task_size_uses_large_for_montecarlo.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_lambda_handlers/test_select_task_size_uses_standard_for_fdr.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_download_bundle.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_download_bundle_dev_meta_analysis_shape.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_download_bundle_dev_string_id_shape.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_download_bundle_production_cached_snapshot_shape.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_incorrect_id.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_missing_column_workflow.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_mkdachis_no_corrector_workflow.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_run_database_workflow.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_run_group_comparison_workflow.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_run_string_group_comparison_workflow.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/cassettes/test_run/test_run_workflow.yaml +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/conftest.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_cli.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_coverage.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_ecs_task.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_ibma_dispatch.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_ibma_end_to_end.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_images.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_lambda_handlers.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_metadata.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_reference_studyset.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_run.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/infra/cdk/app.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/infra/cdk/cdk.json +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/infra/cdk/requirements.txt +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/infra/cdk/stacks/__init__.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/infra/cdk/stacks/compose_runner_stack.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/infra/cdk/stacks/image_repositories_stack.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/infra/cdk/tests/test_compose_runner_stack.py +0 -0
- {compose_runner-0.14.4 → compose_runner-0.14.6}/scripts/simulate_ibma_bundle.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: compose-runner
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.6
|
|
4
4
|
Summary: A package for running neurosynth-compose analyses
|
|
5
5
|
Project-URL: Repository, https://github.com/neurostuff/compose-runner
|
|
6
6
|
Author-email: James Kent <jamesdkent21@gmail.com>
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Requires-Dist: click
|
|
13
13
|
Requires-Dist: neurostore-sdk>=1.1
|
|
14
14
|
Requires-Dist: neurosynth-compose-sdk>=1.2
|
|
15
|
-
Requires-Dist: nimare[parquet]==0.
|
|
15
|
+
Requires-Dist: nimare[parquet]==0.22.0
|
|
16
16
|
Requires-Dist: numpy
|
|
17
17
|
Requires-Dist: requests
|
|
18
18
|
Requires-Dist: sentry-sdk
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.14.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 14,
|
|
21
|
+
__version__ = version = '0.14.6'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 14, 6)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -94,6 +94,17 @@ def _annotation_column(studyset, column):
|
|
|
94
94
|
return ids, frame[column]
|
|
95
95
|
|
|
96
96
|
|
|
97
|
+
def _names(values, label):
|
|
98
|
+
"""Which of an array column's values list ``label``.
|
|
99
|
+
|
|
100
|
+
An array note is a list of strings (the Cognitive Construct Atlas lists each
|
|
101
|
+
analysis's constructs in one column, since a boolean column per construct
|
|
102
|
+
would put every construct in every analysis's note). An un-noted analysis is
|
|
103
|
+
NaN, which lists nothing.
|
|
104
|
+
"""
|
|
105
|
+
return values.map(lambda v: isinstance(v, (list, tuple)) and label in v).astype(bool)
|
|
106
|
+
|
|
107
|
+
|
|
97
108
|
def _truthy(values):
|
|
98
109
|
"""Which of an annotation column's values Python would call true.
|
|
99
110
|
|
|
@@ -579,6 +590,11 @@ class Runner:
|
|
|
579
590
|
can be single or multiple conditions
|
|
580
591
|
- string: filter by string column
|
|
581
592
|
can be single or multiple conditions
|
|
593
|
+
- array: filter by an array (list of strings) column: the first
|
|
594
|
+
group lists the condition weighted 1; with two conditions the
|
|
595
|
+
second group lists the condition weighted -1 and not the
|
|
596
|
+
first (a label every analysis of a collection carries, such
|
|
597
|
+
as "atlas", makes it the rest of that collection)
|
|
582
598
|
- database_studyset: use a reference studyset
|
|
583
599
|
only useful for multiple conditions
|
|
584
600
|
|
|
@@ -618,6 +634,9 @@ class Runner:
|
|
|
618
634
|
|
|
619
635
|
elif column_type == "string":
|
|
620
636
|
analysis_ids = list(analysis_id[note_value == weight_conditions[1]])
|
|
637
|
+
elif column_type == "array":
|
|
638
|
+
included = _names(note_value, weight_conditions[1])
|
|
639
|
+
analysis_ids = list(analysis_id[included])
|
|
621
640
|
else:
|
|
622
641
|
raise ValueError(f"Column type {column_type} not supported.")
|
|
623
642
|
|
|
@@ -630,6 +649,8 @@ class Runner:
|
|
|
630
649
|
+ (
|
|
631
650
|
"is true."
|
|
632
651
|
if column_type == "boolean"
|
|
652
|
+
else f"names {weight_conditions[1]!r}."
|
|
653
|
+
if column_type == "array"
|
|
633
654
|
else f"equals {weight_conditions[1]!r}."
|
|
634
655
|
)
|
|
635
656
|
)
|
|
@@ -648,6 +669,10 @@ class Runner:
|
|
|
648
669
|
elif len(conditions) == 2 and not database_studyset:
|
|
649
670
|
if column_type == "boolean":
|
|
650
671
|
second_analysis_ids = list(analysis_id[~included])
|
|
672
|
+
elif column_type == "array":
|
|
673
|
+
second_analysis_ids = list(
|
|
674
|
+
analysis_id[_names(note_value, weight_conditions[-1]) & ~included]
|
|
675
|
+
)
|
|
651
676
|
else:
|
|
652
677
|
second_analysis_ids = list(
|
|
653
678
|
analysis_id[note_value == weight_conditions[-1]]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
|
-
name: compose_runner-0.14.
|
|
2
|
+
name: compose_runner-0.14.6/compose_runner/tests/cassettes/test_run/test_mkdachis_comparison_workflow.yaml
|
|
3
3
|
size: 55379247 bytes
|
|
4
4
|
sha256: e92bdb17173db2bd38627489940735d5ae1a8acd5364a58bcf9db5976e4b499a
|
|
@@ -163,3 +163,67 @@ def test_an_unsupported_column_type_is_rejected():
|
|
|
163
163
|
|
|
164
164
|
with pytest.raises(ValueError, match="not supported"):
|
|
165
165
|
runner.apply_filter(studyset, combine=False)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def test_array_column_selects_the_analyses_whose_list_names_the_condition():
|
|
169
|
+
"""An array note lists labels (the Cognitive Construct Atlas lists each analysis's constructs in one column)."""
|
|
170
|
+
runner, studyset = _runner(
|
|
171
|
+
{"filter": "constructs", "conditions": ["working memory"], "weights": [1]},
|
|
172
|
+
{"constructs": "array"},
|
|
173
|
+
[
|
|
174
|
+
_note("a1", ["working memory", "memory"], key="constructs"),
|
|
175
|
+
_note("a2", ["attention"], key="constructs"),
|
|
176
|
+
_note("a3", ["memory"], key="constructs"),
|
|
177
|
+
],
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
first, second = runner.apply_filter(studyset, combine=False)
|
|
181
|
+
|
|
182
|
+
assert list(first.ids) == ["s1-a1"]
|
|
183
|
+
assert second is None
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def test_array_column_with_two_conditions_compares_the_two_labels():
|
|
187
|
+
"""The second group names the second label and not the first: with a label every atlas analysis lists, it is
|
|
188
|
+
the rest of the atlas, leaving out analyses of the same studies that are not in it (a3, un-noted; a2, unlisted)."""
|
|
189
|
+
runner, studyset = _runner(
|
|
190
|
+
{"filter": "constructs", "conditions": ["memory", "atlas"], "weights": [1, -1]},
|
|
191
|
+
{"constructs": {"type": "array", "order": 0}},
|
|
192
|
+
[
|
|
193
|
+
_note("a1", ["atlas", "working memory", "memory"], key="constructs"),
|
|
194
|
+
_note("a2", [], key="constructs"),
|
|
195
|
+
],
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
first, second = runner.apply_filter(studyset, combine=False)
|
|
199
|
+
|
|
200
|
+
assert list(first.ids) == ["s1-a1"]
|
|
201
|
+
assert list(second.ids) == []
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def test_array_column_second_group_leaves_out_the_first():
|
|
205
|
+
runner, studyset = _runner(
|
|
206
|
+
{"filter": "constructs", "conditions": ["memory", "atlas"], "weights": [1, -1]},
|
|
207
|
+
{"constructs": "array"},
|
|
208
|
+
[
|
|
209
|
+
_note("a1", ["atlas", "memory"], key="constructs"),
|
|
210
|
+
_note("a2", ["atlas", "attention"], key="constructs"),
|
|
211
|
+
_note("a3", ["attention"], key="constructs"),
|
|
212
|
+
],
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
first, second = runner.apply_filter(studyset, combine=False)
|
|
216
|
+
|
|
217
|
+
assert list(first.ids) == ["s1-a1"]
|
|
218
|
+
assert list(second.ids) == ["s1-a2"]
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def test_an_array_column_no_list_names_selects_nothing():
|
|
222
|
+
runner, studyset = _runner(
|
|
223
|
+
{"filter": "constructs", "conditions": ["pain"], "weights": [1]},
|
|
224
|
+
{"constructs": "array"},
|
|
225
|
+
[_note("a1", ["memory"], key="constructs")],
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
with pytest.raises(ValueError, match="No analysis is selected.*names 'pain'"):
|
|
229
|
+
runner.apply_filter(studyset, combine=False)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/aws_lambda/cost_check_handler.py
RENAMED
|
File without changes
|
{compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/aws_lambda/log_poll_handler.py
RENAMED
|
File without changes
|
{compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/aws_lambda/results_handler.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_ibma_end_to_end.py
RENAMED
|
File without changes
|
|
File without changes
|
{compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_lambda_handlers.py
RENAMED
|
File without changes
|
|
File without changes
|
{compose_runner-0.14.4 → compose_runner-0.14.6}/compose_runner/tests/test_reference_studyset.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{compose_runner-0.14.4 → compose_runner-0.14.6}/infra/cdk/stacks/image_repositories_stack.py
RENAMED
|
File without changes
|
{compose_runner-0.14.4 → compose_runner-0.14.6}/infra/cdk/tests/test_compose_runner_stack.py
RENAMED
|
File without changes
|
|
File without changes
|