Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -124,22 +124,19 @@ import panel as pn
|
|
| 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:
|
| 132 |
df = pd.read_csv(f,index_col=None)
|
| 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")
|
|
@@ -553,5 +550,4 @@ sidebar = [
|
|
| 553 |
template = pn.template.FastListTemplate(
|
| 554 |
title="SADCP data Viewer", sidebar=sidebar, main=[tabs]
|
| 555 |
)
|
| 556 |
-
template.
|
| 557 |
-
|
|
|
|
| 124 |
import param
|
| 125 |
import xarray as xr
|
| 126 |
|
|
|
|
| 127 |
@pn.cache(max_items=32,policy='LRU')
|
| 128 |
def load_csv(url):
|
| 129 |
fs = fsspec.filesystem("https")
|
| 130 |
with fs.open(url) as f:
|
| 131 |
df = pd.read_csv(f,index_col=None)
|
| 132 |
+
df.sort_values(by="year") #inplace=True)
|
| 133 |
return df
|
|
|
|
| 134 |
|
| 135 |
@pn.cache(max_items=4,policy='LRU')
|
| 136 |
def load_bathymetry(url):
|
| 137 |
fs = fsspec.filesystem("https")
|
| 138 |
return xr.open_dataset(fs.open(url), decode_times=False, use_cftime=True)
|
| 139 |
|
|
|
|
| 140 |
@pn.cache(max_items=16,policy='LRU')
|
| 141 |
def load_netCDF(file_path):
|
| 142 |
fs = fsspec.filesystem("https")
|
|
|
|
| 550 |
template = pn.template.FastListTemplate(
|
| 551 |
title="SADCP data Viewer", sidebar=sidebar, main=[tabs]
|
| 552 |
)
|
| 553 |
+
template.seervable()
|
|
|