Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Useful extras:
pip install -e .[llm] # screening and other LLM-backed workflows
pip install -e .[meta] # `autonima meta`
pip install -e .[readability] # enhanced HTML extraction
pip install -e .[ui] # `autonima ui` local web app
pip install -e .[docs] # local docs build
```

Expand Down Expand Up @@ -60,6 +61,12 @@ Run meta-analysis on the generated NiMADS outputs:
autonima meta runs/my_review/outputs
```

Launch the local web UI:

```bash
autonima ui --workspace .
```

## Minimal Config Example

```yaml
Expand Down
10 changes: 10 additions & 0 deletions autonima.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Requires-Dist: mkdocs>=1.6; extra == "docs"
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
Requires-Dist: mkdocs-click>=0.8; extra == "docs"
Requires-Dist: pymdown-extensions>=10.0; extra == "docs"
Provides-Extra: ui
Requires-Dist: fastapi>=0.115; extra == "ui"
Requires-Dist: uvicorn>=0.30; extra == "ui"
Dynamic: author
Dynamic: classifier
Dynamic: description
Expand Down Expand Up @@ -88,6 +91,7 @@ Useful extras:
pip install -e .[llm] # screening and other LLM-backed workflows
pip install -e .[meta] # `autonima meta`
pip install -e .[readability] # enhanced HTML extraction
pip install -e .[ui] # `autonima ui` local web app
pip install -e .[docs] # local docs build
```

Expand Down Expand Up @@ -128,6 +132,12 @@ Run meta-analysis on the generated NiMADS outputs:
autonima meta runs/my_review/outputs
```

Launch the local web UI:

```bash
autonima ui --workspace .
```

## Minimal Config Example

```yaml
Expand Down
15 changes: 14 additions & 1 deletion autonima.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ autonima/templates/sample_config.yml
autonima/utils/__init__.py
autonima/utils/base.py
autonima/utils/criteria.py
autonima/webui/__init__.py
autonima/webui/app.py
autonima/webui/progress.py
autonima/webui/runs.py
autonima/webui/secrets.py
autonima/webui/state.py
autonima/webui/static/app.jsx
autonima/webui/static/index.html
autonima/webui/static/styles.css
tests/test_annotation_incremental_caching.py
tests/test_annotation_multi_analysis_validation.py
tests/test_annotation_retry.py
Expand All @@ -56,12 +65,16 @@ tests/test_docs.py
tests/test_fulltext_incomplete_outputs.py
tests/test_fulltext_loading.py
tests/test_fulltext_screening.py
tests/test_llm_client.py
tests/test_multi_annotation.py
tests/test_nimads_annotations.py
tests/test_objective_in_prompt.py
tests/test_parallel_screening.py
tests/test_pipeline_retrieval.py
tests/test_pipeline_stage_cutoff.py
tests/test_pubmed.py
tests/test_retrieval.py
tests/test_screening.py
tests/test_simplified_screening.py
tests/test_simplified_screening.py
tests/test_webui.py
tests/test_webui_api.py
4 changes: 4 additions & 0 deletions autonima.egg-info/requires.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ nimare>=0.1.0

[readability]
readabilipy>=0.2.0

[ui]
fastapi>=0.115
uvicorn>=0.30
38 changes: 36 additions & 2 deletions autonima/annotation/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,15 @@ def process_studies(
self._save_results_by_study(all_decisions, output_dir, existing_cached_results)
self.annotation_results = all_decisions

# Return all cached results (existing + new)
return self._load_cached_results(output_dir) or []
# Return only results eligible for this execution. Cached decisions
# for studies that no longer pass current screening can remain on disk
# for reuse, but must not flow into current outputs.
return self._filter_cached_results_for_current_run(
self._load_cached_results(output_dir) or [],
included_studies=included_studies or [],
all_studies=all_studies or [],
all_abstract_studies=all_abstract_studies or [],
)

def _create_all_analyses_annotations(
self,
Expand Down Expand Up @@ -402,6 +409,33 @@ def _get_studies_with_complete_results(
studies_with_complete_results.add(study_id)

return studies_with_complete_results

def _filter_cached_results_for_current_run(
self,
results: List[AnnotationDecision],
included_studies: List[Study],
all_studies: List[Study],
all_abstract_studies: List[Study],
) -> List[AnnotationDecision]:
"""Filter cached annotation decisions to the current eligibility graph."""
included_ids = {study.pmid for study in included_studies}
all_ids = {study.pmid for study in all_studies}
abstract_ids = {study.pmid for study in all_abstract_studies}
custom_names = {annotation.name for annotation in self.config.annotations}

filtered: List[AnnotationDecision] = []
for result in results:
name = result.annotation_name
if name == "all_studies" and result.study_id in all_ids:
filtered.append(result)
elif name == "all_abstract" and result.study_id in abstract_ids:
filtered.append(result)
elif name == "all_analyses" and result.study_id in included_ids:
filtered.append(result)
elif name in custom_names and result.study_id in included_ids:
filtered.append(result)

return filtered

def _get_annotations_with_complete_results_for_study(
self,
Expand Down
1 change: 1 addition & 0 deletions autonima/annotation/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class AnnotationDecision(BaseModel):
# NEW: Track which criteria were applied
inclusion_criteria_applied: List[str] = []
exclusion_criteria_applied: List[str] = []
cache_signature: Optional[Dict[str, Any]] = None


class TableMetadata(BaseModel):
Expand Down
Loading
Loading