Repository navigation
Expand file tree
/
Copy pathconfig.py
More file actions
148 lines (133 loc) · 5.02 KB
/
Copy pathconfig.py
File metadata and controls
148 lines (133 loc) · 5.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
"""Centralized configuration constants for the act_inf_metaanalysis pipeline.
This module defines all file paths, default parameter values, and system-wide
settings used throughout the analysis scripts. Import from this module instead
of hardcoding literal values to ensure consistency and maintainability.
Project layout
--------------
output/
├── data/ Analysis JSON results and intermediate artifacts
│ ├── corpus.jsonl
│ ├── subfield_classification.json
│ ├── temporal_analysis.json
│ ├── tfidf_data.json
│ ├── topics.json
│ ├── citation_network.json
│ ├── citation_graph.gml
│ ├── nanopublications.jsonl
│ ├── hypothesis_scores.json
│ ├── hypothesis_trends.json
│ └── fulltext_assessment.json
├── figures/ Publication-ready PNG figures
└── docs/manuscript/ Rendered markdown with variables injected
Pipeline defaults
-----------------
These constants control the default behavior of the thin orchestrator
scripts in scripts/. Individual scripts may override them via CLI flags.
"""
from __future__ import annotations
from pathlib import Path
# ---------------------------------------------------------------------------
# Project structure
# ---------------------------------------------------------------------------
PROJECT_ROOT = Path(__file__).parent.parent.resolve()
PROJECT_NAME = "act_inf_metaanalysis"
# Output directories
OUTPUT_DIR = PROJECT_ROOT / "output"
DATA_DIR = OUTPUT_DIR / "data"
FIGURES_DIR = OUTPUT_DIR / "figures"
# Key artifact paths
CORPUS_PATH = DATA_DIR / "corpus.jsonl"
MANUSCRIPT_DIR = PROJECT_ROOT / "docs" / "manuscript"
# ---------------------------------------------------------------------------
# Analysis defaults (02_meta_analysis_pipeline.py)
# ---------------------------------------------------------------------------
DEFAULT_N_TOPICS = 8
DEFAULT_MAX_FEATURES = 500
DEFAULT_MIN_YEAR = 2000 # Pre-2000 papers excluded from text/temporal analysis
DEFAULT_SEED = 42 # RNG seed for NMF reproducibility
# Publication-facing analysis defaults. The project configuration remains the
# source of truth; these values are safe fallbacks for standalone invocation.
DEFAULT_COMPLETE_YEAR_POLICY = "exclude_current_partial_year_from_cagr"
DEFAULT_TOPIC_STABILITY_SEEDS: tuple[int, ...] = (0, 1, 2, 3, 4, 5, 42)
PIPELINE_VERSION = "2.0.6"
PROMPT_VERSION = "v2.0.6"
# ---------------------------------------------------------------------------
# Knowledge graph defaults (03_build_knowledge_graph.py)
# ---------------------------------------------------------------------------
KG_MIN_YEAR = 1960 # Pre-1960 papers excluded from KG construction
DEFAULT_LLM_MODEL = "gemma3:4b"
# Matches `project_config.llm_extraction.base_url` in docs/manuscript/config.yaml
# (the published snapshot's live Ollama endpoint); kept as a fallback default.
DEFAULT_LLM_URL = "http://localhost:11435"
DEFAULT_CHECKPOINT_INTERVAL = 50
# Literature search defaults (01_literature_search.py)
DEFAULT_ARXIV_QUERIES: list[str] = [
'all:"active inference"',
'all:"free energy principle"',
'all:"predictive coding" AND all:"free energy"',
'all:"expected free energy"',
'all:"variational free energy" AND all:"inference"',
]
DEFAULT_RELEVANCE_KEYWORDS: list[str] = [
"active inference",
"free energy principle",
"predictive coding",
"free energy",
"variational",
"fep",
"bayesian brain",
"markov blanket",
"generative model",
"predictive processing",
]
# ---------------------------------------------------------------------------
# Figure generation defaults (04_generate_figures.py)
# ---------------------------------------------------------------------------
# Default DPI when saving figures. Individual scripts may override via --dpi.
# See VIZ_CONFIG for full styling palette (font sizes, colors, etc.).
DEFAULT_DPI = 300
# ---------------------------------------------------------------------------
# Visualization styling (imported from visualization.style)
# ---------------------------------------------------------------------------
# Figure size in inches
FIGURE_SIZE = (12, 7)
# DPI used by VIZ_CONFIG (overridden by script --dpi flag)
DPI = 150
# Font sizes (enforced via apply_visual_style())
FONT_SIZE = 18
TICK_SIZE = 16
TITLE_SIZE = 22
__all__ = [
# Paths
"PROJECT_ROOT",
"PROJECT_NAME",
"OUTPUT_DIR",
"DATA_DIR",
"FIGURES_DIR",
"CORPUS_PATH",
"MANUSCRIPT_DIR",
# Analysis defaults
"DEFAULT_N_TOPICS",
"DEFAULT_MAX_FEATURES",
"DEFAULT_MIN_YEAR",
"DEFAULT_SEED",
"DEFAULT_COMPLETE_YEAR_POLICY",
"DEFAULT_TOPIC_STABILITY_SEEDS",
"PIPELINE_VERSION",
"PROMPT_VERSION",
# Knowledge graph defaults
"KG_MIN_YEAR",
"DEFAULT_LLM_MODEL",
"DEFAULT_LLM_URL",
"DEFAULT_CHECKPOINT_INTERVAL",
"DEFAULT_ARXIV_QUERIES",
"DEFAULT_RELEVANCE_KEYWORDS",
# Figure defaults
"DEFAULT_DPI",
# Visualization styling
"FIGURE_SIZE",
"DPI",
"FONT_SIZE",
"TICK_SIZE",
"TITLE_SIZE",
]