Skip to content

Commit ec1497c

Browse files
committed
Attempting fixes
1 parent 2bd2c16 commit ec1497c

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

streamlit_app/pages/volatility_surface.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@
4848
logger.addHandler(h)
4949

5050
# ---------------------------
51-
# Ensure src of project is importable (robust)
51+
# Ensure src of project is importable
5252
# ---------------------------
53-
# Candidate locations to find your project 'src' folder on Streamlit Cloud or local dev
53+
# The script is running from /path/to/streamlit_app/pages/volatility_surface.py
54+
# The src folder is at /path/to/src
55+
# So we need to go up from pages/ to streamlit_app/, then up again to the project root (where src is).
5456
CANDIDATE_SRC = [
55-
Path(__file__).resolve().parent / ".." / "src", # Go up from pages/ to streamlit_app/, then to src/
56-
Path(__file__).resolve().parent.parent / "src", # Go up two levels from pages/ (e.g., if running from a deeper structure)
57+
Path(__file__).resolve().parent.parent / "src", # Go up two levels from pages/ -> streamlit_app -> src/
58+
Path(__file__).resolve().parent / ".." / "src", # Go up from pages/ to streamlit_app/, then to src/ (this might also work depending on sys.path)
5759
Path.cwd() / "src",
5860
Path("src"),
5961
# Your machine path example (keeps safe if not present)
@@ -70,7 +72,7 @@
7072

7173
if SRC_DIR is None:
7274
logger.warning("Could not find 'src' directory in candidate paths. Project models may not be available.")
73-
# --- FIX: Initialize PROJECT_MODELS_AVAILABLE to False if src not found ---
75+
# Initialize PROJECT_MODELS_AVAILABLE to False if src not found
7476
PROJECT_MODELS_AVAILABLE = False
7577
_project_import_error = "SRC directory not found."
7678
ProjectMLPModel = ProjectRFModel = ProjectSVRModel = ProjectXGBModel = None
@@ -102,7 +104,6 @@
102104
logger.warning("Project models not importable: %s", _project_import_error)
103105
ProjectMLPModel = ProjectRFModel = ProjectSVRModel = ProjectXGBModel = None
104106

105-
106107
# ---------------------------
107108
# App constants & storage
108109
# ---------------------------

0 commit comments

Comments
 (0)