Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import math
|
|
| 3 |
|
| 4 |
# date=dataset['TIME']
|
| 5 |
from datetime import date, datetime, timedelta
|
| 6 |
-
|
| 7 |
import cartopy.crs as ccrs
|
| 8 |
import cartopy.feature as cfeature
|
| 9 |
import cftime
|
|
@@ -124,8 +124,8 @@ import panel as pn
|
|
| 124 |
import param
|
| 125 |
import xarray as xr
|
| 126 |
|
| 127 |
-
@lru_cache(maxsize=32)
|
| 128 |
-
|
| 129 |
def load_csv(url):
|
| 130 |
fs = fsspec.filesystem("https")
|
| 131 |
with fs.open(url) as f:
|
|
@@ -133,14 +133,14 @@ def load_csv(url):
|
|
| 133 |
df.sort_values(by="year")
|
| 134 |
return df
|
| 135 |
|
| 136 |
-
|
| 137 |
-
|
| 138 |
def load_bathymetry(url):
|
| 139 |
fs = fsspec.filesystem("https")
|
| 140 |
return xr.open_dataset(fs.open(url), decode_times=False, use_cftime=True)
|
| 141 |
|
| 142 |
-
|
| 143 |
-
|
| 144 |
def load_netCDF(file_path):
|
| 145 |
fs = fsspec.filesystem("https")
|
| 146 |
ds= ds = (
|
|
|
|
| 3 |
|
| 4 |
# date=dataset['TIME']
|
| 5 |
from datetime import date, datetime, timedelta
|
| 6 |
+
|
| 7 |
import cartopy.crs as ccrs
|
| 8 |
import cartopy.feature as cfeature
|
| 9 |
import cftime
|
|
|
|
| 124 |
import param
|
| 125 |
import xarray as xr
|
| 126 |
|
| 127 |
+
#@lru_cache(maxsize=32)
|
| 128 |
+
@pn.cache(max_items=32,policy='LRU')
|
| 129 |
def load_csv(url):
|
| 130 |
fs = fsspec.filesystem("https")
|
| 131 |
with fs.open(url) as f:
|
|
|
|
| 133 |
df.sort_values(by="year")
|
| 134 |
return df
|
| 135 |
|
| 136 |
+
|
| 137 |
+
@pn.cache(max_items=4,policy='LRU')
|
| 138 |
def load_bathymetry(url):
|
| 139 |
fs = fsspec.filesystem("https")
|
| 140 |
return xr.open_dataset(fs.open(url), decode_times=False, use_cftime=True)
|
| 141 |
|
| 142 |
+
|
| 143 |
+
@pn.cache(max_items=16,policy='LRU')
|
| 144 |
def load_netCDF(file_path):
|
| 145 |
fs = fsspec.filesystem("https")
|
| 146 |
ds= ds = (
|