File size: 753 Bytes
2a7c020
10b0429
 
2a7c020
 
 
 
10b0429
2a7c020
10b0429
 
 
2a7c020
10b0429
 
2a7c020
10b0429
 
2a7c020
10b0429
 
 
 
 
bd604e5
10b0429
 
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
"""
Hugging Face Spaces wrapper for Analytics page
This wrapper imports and runs the page from the visualization folder.
"""

import sys
from pathlib import Path
import os

# Add the project root and visualization directory to Python path
project_root = Path(__file__).parent.parent
visualization_dir = project_root / "visualization"

sys.path.insert(0, str(visualization_dir))
sys.path.insert(0, str(project_root))

# Change to visualization directory for relative imports
os.chdir(visualization_dir)

# Import the actual page module
import importlib.util
spec = importlib.util.spec_from_file_location(
    "analytics",
    visualization_dir / "pages" / "4_Analytics.py"
)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)