Skip to content

Commit 2754c82

Browse files
committed
Make meta optional
1 parent 2fa84f7 commit 2754c82

7 files changed

Lines changed: 73 additions & 14 deletions

File tree

autonima.egg-info/PKG-INFO

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ Requires-Dist: mypy>=1.0; extra == "dev"
4343
Requires-Dist: pre-commit>=3.0; extra == "dev"
4444
Provides-Extra: llm
4545
Requires-Dist: openai>=1.0; extra == "llm"
46+
Provides-Extra: readability
47+
Requires-Dist: readabilipy>=0.2.0; extra == "readability"
48+
Provides-Extra: meta
49+
Requires-Dist: nimare>=0.1.0; extra == "meta"
4650
Dynamic: author
4751
Dynamic: classifier
4852
Dynamic: description
@@ -90,6 +94,12 @@ Autonima enables end-to-end automation of systematic review steps:
9094
* Produces a final set of included studies for meta-analysis.
9195
* Uses function calling with Pydantic schemas for structured output.
9296

97+
5. **Enhanced HTML Cleaning**
98+
99+
* Uses Mozilla's Readability algorithm via `readabilipy` to extract clean text content from HTML.
100+
* Falls back to basic HTML cleaning when `readabilipy` is not available.
101+
* Install with `pip install -e .[readability]` (requires Node.js).
102+
93103
---
94104

95105
## 📊 Benchmarking
@@ -127,6 +137,11 @@ cd autonima
127137
# install
128138
pip install -e .
129139

140+
# install with enhanced HTML cleaning (requires Node.js)
141+
pip install -e .[readability]
142+
143+
> Note: The enhanced HTML cleaning feature requires Node.js to be installed on your system.
144+
130145
# run an example review pipeline
131146
python examples/run_pipeline.py --config examples/sample_config.yaml
132147
```

autonima.egg-info/SOURCES.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ autonima/__init__.py
44
autonima/__main__.py
55
autonima/cli.py
66
autonima/config.py
7+
autonima/meta.py
78
autonima/pipeline.py
89
autonima/utils.py
910
autonima.egg-info/PKG-INFO
@@ -12,6 +13,14 @@ autonima.egg-info/dependency_links.txt
1213
autonima.egg-info/entry_points.txt
1314
autonima.egg-info/requires.txt
1415
autonima.egg-info/top_level.txt
16+
autonima/coordinates/__init__.py
17+
autonima/coordinates/nimads_models.py
18+
autonima/coordinates/openai_client.py
19+
autonima/coordinates/parser.py
20+
autonima/coordinates/processor.py
21+
autonima/coordinates/schema.py
22+
autonima/llm/__init__.py
23+
autonima/llm/client.py
1524
autonima/models/__init__.py
1625
autonima/models/types.py
1726
autonima/retrieval/__init__.py

autonima.egg-info/requires.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ pre-commit>=3.0
2121

2222
[llm]
2323
openai>=1.0
24+
25+
[meta]
26+
nimare>=0.1.0
27+
28+
[readability]
29+
readabilipy>=0.2.0

autonima/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@
3434
from .llm.client import GenericLLMClient
3535

3636
# Import meta-analysis module components
37-
from .meta import run_meta_analyses
37+
try:
38+
from .meta import run_meta_analyses
39+
HAS_META = True
40+
except ImportError:
41+
HAS_META = False
3842

3943
__all__ = [
4044
"AutonimaPipeline",
@@ -47,6 +51,8 @@
4751
"ParseAnalysesOutput",
4852
"parse_tables",
4953
"CoordinateParsingClient",
50-
"GenericLLMClient",
51-
"run_meta_analyses"
52-
]
54+
"GenericLLMClient"
55+
]
56+
57+
if HAS_META:
58+
__all__.append("run_meta_analyses")

autonima/cli.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,19 @@ def meta(output_folder: str, estimator: str, estimator_args: str,
262262
import json
263263
from pathlib import Path
264264

265+
# Try to import NiMARE dependencies
266+
try:
267+
from .meta import run_meta_analyses
268+
except ImportError as e:
269+
log_error_with_debug(
270+
logger,
271+
"NiMARE is not installed. Please install with: pip install autonima[meta]"
272+
)
273+
if debug:
274+
import pdb
275+
pdb.post_mortem()
276+
sys.exit(1)
277+
265278
# Parse estimator and corrector arguments
266279
try:
267280
estimator_args_dict = json.loads(estimator_args)
@@ -273,9 +286,6 @@ def meta(output_folder: str, estimator: str, estimator_args: str,
273286
pdb.post_mortem()
274287
sys.exit(1)
275288

276-
# Import the meta-analysis function
277-
from .meta import run_meta_analyses
278-
279289
# Run meta-analyses
280290
results = run_meta_analyses(
281291
output_folder,

autonima/meta.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@
55
from pathlib import Path
66
import json
77
import importlib
8-
from nimare.correct import FDRCorrector, FWECorrector
9-
from nimare.workflows import CBMAWorkflow
10-
from nimare.meta.cbma import MKDADensity, ALE, KDA
11-
from nimare.nimads import Studyset, Annotation
12-
from nimare.reports.base import run_reports
8+
9+
# Try to import NiMARE dependencies
10+
try:
11+
from nimare.correct import FDRCorrector, FWECorrector
12+
from nimare.workflows import CBMAWorkflow
13+
from nimare.meta.cbma import MKDADensity, ALE, KDA
14+
from nimare.nimads import Studyset, Annotation
15+
from nimare.reports.base import run_reports
16+
NIMARE_AVAILABLE = True
17+
except ImportError:
18+
NIMARE_AVAILABLE = False
19+
20+
if not NIMARE_AVAILABLE:
21+
raise ImportError(
22+
"NiMARE is not installed. Please install with: pip install autonima[meta]"
23+
)
1324

1425

1526
def create_estimator(estimator_name, estimator_args):

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ def get_version():
5353
"biopython>=1.81",
5454
"pandas>=2.0",
5555
"matplotlib>=3.5",
56-
"pubget>=0.0.8",
57-
"nimare>=0.1.0"
56+
"pubget>=0.0.8"
5857
],
5958
extras_require={
6059
"dev": [
@@ -70,6 +69,9 @@ def get_version():
7069
],
7170
"readability": [
7271
"readabilipy>=0.2.0"
72+
],
73+
"meta": [
74+
"nimare>=0.1.0"
7375
]
7476
},
7577
entry_points={

0 commit comments

Comments
 (0)