Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -18,12 +18,11 @@ import cartopy.feature as cfeature
|
|
18 |
import plotly.graph_objects as go
|
19 |
import plotly.express as px
|
20 |
from plotly.subplots import make_subplots
|
21 |
-
|
22 |
from sklearn.manifold import TSNE
|
23 |
from sklearn.cluster import DBSCAN
|
24 |
from sklearn.preprocessing import StandardScaler
|
25 |
from scipy.interpolate import interp1d
|
26 |
-
|
27 |
import requests
|
28 |
import tempfile
|
29 |
import shutil
|
@@ -48,7 +47,13 @@ logging.basicConfig(
|
|
48 |
parser = argparse.ArgumentParser(description='Typhoon Analysis Dashboard')
|
49 |
parser.add_argument('--data_path', type=str, default=os.getcwd(), help='Path to the data directory')
|
50 |
args = parser.parse_args()
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
# Data paths
|
54 |
ONI_DATA_PATH = os.path.join(DATA_PATH, 'oni_data.csv')
|
|
|
18 |
import plotly.graph_objects as go
|
19 |
import plotly.express as px
|
20 |
from plotly.subplots import make_subplots
|
|
|
21 |
from sklearn.manifold import TSNE
|
22 |
from sklearn.cluster import DBSCAN
|
23 |
from sklearn.preprocessing import StandardScaler
|
24 |
from scipy.interpolate import interp1d
|
25 |
+
import statsmodels.api as sm
|
26 |
import requests
|
27 |
import tempfile
|
28 |
import shutil
|
|
|
47 |
parser = argparse.ArgumentParser(description='Typhoon Analysis Dashboard')
|
48 |
parser.add_argument('--data_path', type=str, default=os.getcwd(), help='Path to the data directory')
|
49 |
args = parser.parse_args()
|
50 |
+
|
51 |
+
# Update data paths for Huggingface Spaces
|
52 |
+
TEMP_DIR = tempfile.gettempdir()
|
53 |
+
DATA_PATH = os.environ.get('DATA_PATH', TEMP_DIR)
|
54 |
+
|
55 |
+
# Ensure directory exists
|
56 |
+
os.makedirs(DATA_PATH, exist_ok=True)
|
57 |
|
58 |
# Data paths
|
59 |
ONI_DATA_PATH = os.path.join(DATA_PATH, 'oni_data.csv')
|