41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
import argparse
|
|
import json
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
sys.path.insert(0, str(ROOT / "backend"))
|
|
|
|
from app.db.session import SessionLocal # noqa: E402 - imported after backend path bootstrap
|
|
from app.services.demo_workflow_service import ( # noqa: E402 - imported after backend path bootstrap
|
|
DemoWorkflowService,
|
|
)
|
|
|
|
|
|
def main() -> int:
|
|
parser = argparse.ArgumentParser(description="Seed the explicit GeoIntel offline demo workflow.")
|
|
parser.add_argument("--json", action="store_true", help="Print machine-readable JSON.")
|
|
args = parser.parse_args()
|
|
|
|
with SessionLocal() as db:
|
|
result = DemoWorkflowService.seed(db)
|
|
|
|
payload = result.model_dump(mode="json")
|
|
if args.json:
|
|
print(json.dumps(payload, sort_keys=True))
|
|
else:
|
|
print(f"Demo workflow status: {payload['status']}")
|
|
print(f"Project: {payload['project_id']}")
|
|
print(f"Area: {payload['area_id']}")
|
|
print(f"Reference dataset: {payload['reference_dataset_id']}")
|
|
print(f"Candidate dataset: {payload['candidate_dataset_id']}")
|
|
print(f"Quality check: {payload['quality_check_id']}")
|
|
print(payload["message"])
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|