Skip to content

Commit 1259877

Browse files
committed
re #4 cleaning up the old ipbes and convei code and data
1 parent 996a303 commit 1259877

19 files changed

+77
-2236
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.env
2+
__pycache__/

app_esa2025/main.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
BASE_DIR = Path(__file__).resolve().parent
4545

4646
app = FastAPI()
47-
app.mount("/static", StaticFiles(directory=str(BASE_DIR / "static")), name="static")
47+
app.mount(
48+
"/static", StaticFiles(directory=str(BASE_DIR / "static")), name="static"
49+
)
4850
templates = Jinja2Templates(directory=str(BASE_DIR / "templates"))
4951
templates.env.auto_reload = True
5052

@@ -98,7 +100,11 @@ async def read_root(request: Request):
98100

99101
@app.get("/get_info/")
100102
def get_info(db: Session = Depends(get_db)):
101-
pf = db.query(ProcessedFile).order_by(ProcessedFile.processed_at.desc()).first()
103+
pf = (
104+
db.query(ProcessedFile)
105+
.order_by(ProcessedFile.processed_at.desc())
106+
.first()
107+
)
102108
if not pf:
103109
return {"dbInfo": "Database not initialized yet."}
104110

@@ -107,7 +113,9 @@ def get_info(db: Session = Depends(get_db)):
107113
if ts.tzinfo is None:
108114
ts = ts.replace(tzinfo=timezone.utc)
109115

110-
return {"dbInfo": f"Database created from {pf.filename} at {ts.isoformat()}"}
116+
return {
117+
"dbInfo": f"Database created from {pf.filename} at {ts.isoformat()}"
118+
}
111119

112120

113121
@app.get("/entities/")
@@ -118,7 +126,9 @@ async def list_entities():
118126
names = [p.name for p in entities if p.name]
119127

120128
# sort by last name (case-insensitive)
121-
sorted_names = sorted(set(names), key=lambda n: n.strip().split()[-1].lower())
129+
sorted_names = sorted(
130+
set(names), key=lambda n: n.strip().split()[-1].lower()
131+
)
122132

123133
return {"entities": sorted_names}
124134
finally:
@@ -169,9 +179,9 @@ async def people_search(req: SearchRequest, db: Session = Depends(get_db)):
169179
raise HTTPException(status_code=400, detail="Empty query")
170180

171181
rows: List[Entity] = db.query(Entity).all()
172-
# TODO: limit 10 for debugging
173-
# rows: List[Entity] = db.query(Entity).limit(10).all()
174-
candidates: List[Tuple[str, str]] = [(r.name, r.bio or "") for r in rows if r.name]
182+
candidates: List[Tuple[str, str]] = [
183+
(r.name, r.bio or "") for r in rows if r.name
184+
]
175185

176186
current_tokens = 0
177187
current_chunk = []
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!.gitignore
3+
!README.md
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Local Data Holding Space
2+
3+
This directory is reserved for **local-only data** used during analysis.
4+
Store any material here that must **not** be committed or deployed, including:
5+
6+
- Raw CVs
7+
- Nominations
8+
- Intermediate outputs from LLMs
9+
- Temporary or intermediate analysis files
10+
- Any other private, sensitive, or non-deployable artifacts
11+
12+
Contents of this directory are intentionally excluded from version control.
13+
Use it as a workspace for local analysis inputs and outputs that should remain private.

docker-compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
services:
2+
3+
agu2025:
4+
hostname: agu2025
5+
build: ./app_agu2025
6+
volumes:
7+
- ./app_agu2025/data:/app/data
8+
- ./app_agu2025:/app
9+
environment:
10+
PYTHONUNBUFFERED: '1'
11+
labels:
12+
- 'traefik.enable=true'
13+
- 'traefik.http.routers.agu2025.rule=Host(`agu2025.craa.ecoshard.org`)'
14+
- 'traefik.http.routers.agu2025.entrypoints=websecure'
15+
- 'traefik.http.routers.agu2025.tls=true'
16+
- 'traefik.http.routers.agu2025.tls.certresolver=letsencrypt'
17+
- 'traefik.http.services.agu2025.loadbalancer.server.port=8000'
18+
depends_on:
19+
- reverse-proxy
20+
networks:
21+
- web
22+
tty: true
23+
stdin_open: true
24+
ports:
25+
- '127.0.0.1:8001:8000'
26+
27+
228
esa2025:
329
hostname: esa2025
430
build: ./app_esa2025

local/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!.gitignore
3+
!README.md

local/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Local Data (Top-Level)
2+
3+
This directory is for **local-only, legacy, or general-purpose data** that is not tied to any specific sub-application.
4+
Use it to store material that must **not** be committed or deployed, including:
5+
6+
- Raw CVs or nominations
7+
- Old or archived input data
8+
- Intermediate outputs from LLMs
9+
- Temporary or intermediate analysis files
10+
- Any other private, sensitive, or non-deployable artifacts
11+
12+
Everything placed here is intentionally excluded from version control.
13+
Use this space for local data that should remain private and separate from the sub-app–specific workflows.

old_convei_scripts/abstract_classifier.py

Lines changed: 0 additions & 111 deletions
This file was deleted.

old_convei_scripts/affiliation_classifier.py

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)