Spaces:
Build error
Build error
Kelbec
commited on
Commit
•
81ae6a8
1
Parent(s):
8c05209
dcascade dev and new params
Browse files- Dockerfile +1 -1
- pages/01_dcascade.py +11 -4
Dockerfile
CHANGED
@@ -9,7 +9,7 @@ RUN mamba install -c conda-forge leafmap geopandas localtileserver -y && \
|
|
9 |
USER root
|
10 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
11 |
RUN conda install -c conda-forge gdal
|
12 |
-
RUN pip install git+https://${GITHUB_TOKEN}@github.com/saferplaces/dcascade_py.git@
|
13 |
RUN pip install keplergl
|
14 |
COPY requirements.txt .
|
15 |
RUN pip install -r requirements.txt
|
|
|
9 |
USER root
|
10 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
11 |
RUN conda install -c conda-forge gdal
|
12 |
+
RUN pip install git+https://${GITHUB_TOKEN}@github.com/saferplaces/dcascade_py.git@development
|
13 |
RUN pip install keplergl
|
14 |
COPY requirements.txt .
|
15 |
RUN pip install -r requirements.txt
|
pages/01_dcascade.py
CHANGED
@@ -8,7 +8,7 @@ import leafmap.kepler as leafmap
|
|
8 |
import solara
|
9 |
from leafmap.toolbar import change_basemap
|
10 |
from solara.components.file_drop import FileInfo
|
11 |
-
from
|
12 |
|
13 |
zoom = solara.reactive(2)
|
14 |
center = solara.reactive((20, 0))
|
@@ -165,6 +165,9 @@ def Page():
|
|
165 |
partitionings = ["Direct", "Bed material fraction (BMF)", "Transport capacity function (TCF)", "Shear stress correction approach"]
|
166 |
partitioning = solara.reactive("Shear stress correction approach")
|
167 |
timescale = solara.reactive("20")
|
|
|
|
|
|
|
168 |
continuous_update = solara.reactive(True)
|
169 |
|
170 |
|
@@ -175,7 +178,6 @@ def Page():
|
|
175 |
f = file["file_obj"]
|
176 |
set_content(f.read())
|
177 |
set_uploaded(False)
|
178 |
-
print(file)
|
179 |
|
180 |
def upload_file():
|
181 |
if content:
|
@@ -184,7 +186,6 @@ def Page():
|
|
184 |
with open(file_path,"wb") as file:
|
185 |
file.write(content)
|
186 |
if filename.endswith(".zip"):
|
187 |
-
print(filename)
|
188 |
shutil.unpack_archive(os.getcwd()+"/public/"+filename,os.getcwd()+"/public")
|
189 |
os.remove(os.getcwd()+"/public/"+filename)
|
190 |
|
@@ -236,7 +237,7 @@ def Page():
|
|
236 |
out_shp = out+".shp"
|
237 |
out_prj = out+".prj"
|
238 |
shutil.copyfile(river,out_prj)
|
239 |
-
|
240 |
set_map_loaded(True)
|
241 |
|
242 |
with solara.Div() as main:
|
@@ -284,6 +285,12 @@ def Page():
|
|
284 |
solara.Select(label="Partitioning ", value=partitioning, values=partitionings)
|
285 |
# solara.Markdown(f"**Selected**: {partitioning.value}")
|
286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
with solara.Card("Select files"):
|
288 |
solara.Markdown("Select **river** and **q** files from file explorer below, the uploaded files can be found in /public folder. To select files click on the explorer the click on *SELECT RIVER FILE* or *SELECT Q FILE* based on the file selected.")
|
289 |
with solara.ColumnsResponsive(3, large=6):
|
|
|
8 |
import solara
|
9 |
from leafmap.toolbar import change_basemap
|
10 |
from solara.components.file_drop import FileInfo
|
11 |
+
from dcascade_py import dcascade_py
|
12 |
|
13 |
zoom = solara.reactive(2)
|
14 |
center = solara.reactive((20, 0))
|
|
|
165 |
partitionings = ["Direct", "Bed material fraction (BMF)", "Transport capacity function (TCF)", "Shear stress correction approach"]
|
166 |
partitioning = solara.reactive("Shear stress correction approach")
|
167 |
timescale = solara.reactive("20")
|
168 |
+
sed_range = solara.reactive("-8,4")
|
169 |
+
class_size = solara.reactive(2.5)
|
170 |
+
deposit = solara.reactive(50.0)
|
171 |
continuous_update = solara.reactive(True)
|
172 |
|
173 |
|
|
|
178 |
f = file["file_obj"]
|
179 |
set_content(f.read())
|
180 |
set_uploaded(False)
|
|
|
181 |
|
182 |
def upload_file():
|
183 |
if content:
|
|
|
186 |
with open(file_path,"wb") as file:
|
187 |
file.write(content)
|
188 |
if filename.endswith(".zip"):
|
|
|
189 |
shutil.unpack_archive(os.getcwd()+"/public/"+filename,os.getcwd()+"/public")
|
190 |
os.remove(os.getcwd()+"/public/"+filename)
|
191 |
|
|
|
237 |
out_shp = out+".shp"
|
238 |
out_prj = out+".prj"
|
239 |
shutil.copyfile(river,out_prj)
|
240 |
+
dcascade_py(river, q, sed_range=sed_range.value, class_size=class_size.value, deposit=deposit.value, timescale=sel_timescale, formula=sel_form, partitioning=sel_part, out=out_shp, version=False, verbose=False, debug=False, credits=False)
|
241 |
set_map_loaded(True)
|
242 |
|
243 |
with solara.Div() as main:
|
|
|
285 |
solara.Select(label="Partitioning ", value=partitioning, values=partitionings)
|
286 |
# solara.Markdown(f"**Selected**: {partitioning.value}")
|
287 |
|
288 |
+
solara.InputText(label="Sed range ", value=sed_range)
|
289 |
+
|
290 |
+
solara.InputFloat(label="Class size ", value=class_size)
|
291 |
+
|
292 |
+
solara.InputFloat(label="Deposit ", value=deposit)
|
293 |
+
|
294 |
with solara.Card("Select files"):
|
295 |
solara.Markdown("Select **river** and **q** files from file explorer below, the uploaded files can be found in /public folder. To select files click on the explorer the click on *SELECT RIVER FILE* or *SELECT Q FILE* based on the file selected.")
|
296 |
with solara.ColumnsResponsive(3, large=6):
|