Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ecomodeller committed Jan 10, 2025
1 parent bbe8850 commit 6cbcfde
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ test = [
"geopandas",
]

app = ["streamlit>=1.41.1"]

notebooks = ["nbformat", "nbconvert", "jupyter", "plotly", "shapely", "seaborn"]

[project.urls]
Expand Down
27 changes: 17 additions & 10 deletions web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
import tempfile
import streamlit as st
import mikeio
import fmskill
import modelskill
import matplotlib

"""
# FMskill Drag and Drop
# ModelSkill Drag and Drop
"""

tmp_folder = tempfile.mkdtemp()

with st.sidebar:

obs = st.file_uploader("Observation", type="dfs0")

if obs:
Expand All @@ -33,15 +33,22 @@
items = [item.name for item in dfs.items]
mod_item = st.selectbox(label="Item", options=items)

if mod and obs:
metrics = st.multiselect(
"Metrics",
["bias", "rmse", "mae", "cc", "r2"],
default=["bias", "rmse", "mae", "cc", "r2"],
)

c = fmskill.compare(fn_obs, fn_mod, obs_item=obs_item, mod_item=mod_item)
if mod and obs:
c = modelskill.match(fn_obs, fn_mod, obs_item=obs_item, mod_item=mod_item)

df = c.skill().to_dataframe()
df = c.skill(metrics=metrics).to_dataframe()
st.dataframe(df)

fig_ts = c.plot_timeseries(backend="plotly", return_fig=True)
st.plotly_chart(fig_ts)
c.plot.timeseries()
fig = matplotlib.pyplot.gcf()
st.pyplot(fig)

fig_sc = c.scatter(backend="plotly", return_fig=True)
st.plotly_chart(fig_sc)
c.plot.scatter()
fig_sc = matplotlib.pyplot.gcf()
st.pyplot(fig_sc)

0 comments on commit 6cbcfde

Please sign in to comment.