-
Notifications
You must be signed in to change notification settings - Fork 0
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
Control: add Driel and Haringvlietsluizen #57
Comments
@visr, following our discussion December, "fractional flow as to receive a flow_rate" I assume such flow-rate comes best from a Q(h) and not from a "gravitation node" (manning or linear resistance) as these nodes need a downstream level. Taken from HydroLogic example: |
@visr, something is wrong with the control-state. Can you help me further? The model is here: https://we.tl/t-JMNBV65NWq |
I ran this script to update the model, which is the upgrade code from Deltares/Ribasim#992, followed by a read-then-write using the latest version of Ribasim Python. After that it works. import sqlite3
import pandas as pd
# Connect to the SQLite database
database_path = "database.gpkg"
conn = sqlite3.connect(database_path)
tables = ["TabulatedRatingCurve / static", "TabulatedRatingCurve / time"]
for table in tables:
# Read the table into a pandas DataFrame
try:
df = pd.read_sql_query(f"SELECT * FROM '{table}'", conn)
except:
continue
# Rename the column in the DataFrame
df_renamed = df.rename(columns={"discharge": "flow_rate"})
# Write the DataFrame back to the SQLite table
df_renamed.to_sql(table, conn, if_exists="replace", index=False)
# Close the connection
conn.close()
# write
import ribasim
m = ribasim.Model(filepath="hws.toml")
m.write("hws.toml") I suspect that the fix was the ordering of the tables: Deltares/Ribasim#903. |
Check, for a full fix:
Model with Driel-control is uploaded to: https://deltares.thegood.cloud/f/62081 |
Issue closed with model-release: 2024.2.1: https://deltares.thegood.cloud/f/62174 |
Driel
Haringvlietsluizen
The text was updated successfully, but these errors were encountered: