Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result comparison #2138

Open
visr opened this issue Mar 10, 2025 · 0 comments
Open

Result comparison #2138

visr opened this issue Mar 10, 2025 · 0 comments

Comments

@visr
Copy link
Member

visr commented Mar 10, 2025

The integration tests compare the output states of the HWS model. For #2136 I needed a quick way to eyeball the differences on the map. Sharing my throw-away script here before throwing it away such that I don't have to rewrite it later.

import ribasim
import pandas as pd
import geopandas as gpd

new_path = r"hws_2024_7_0\results\basin_state.arrow"
old_path = r"hws_2024_7_0\benchmark\basin_state.arrow"
gpkg = r"hws_2024_7_0\database.gpkg"

# compute the differences
new = pd.read_feather(new).set_index("node_id")
old = pd.read_feather(old).set_index("node_id")
dif = new - old

# load the spatial Node layer and add the differences
node = gpd.read_file(gpkg, layer="Node", fid_as_index=True)
basin = node[node.node_type == "Basin"]
basin["dif"] = dif
basin["new"] = new
basin["old"] = old

basin.to_file(
    r"hws_2024_7_0\results\basin_dif.gpkg",
    driver="GPKG",
    index=True,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

No branches or pull requests

1 participant