Deltares / Ribasim-NL

Ribasim water resources modeling in the Netherlands
https://ribasim.nl/
MIT License
4 stars 0 forks source link

Find tables in Ribasim-model (for re-index/concat) #69

Open d2hydro opened 6 months ago

d2hydro commented 6 months ago

While merging Ribasim-models we want to find all tables with node_id columns. Currently these are hard-coded in the variable CLASS_TABLES.

If ribasim itself doesn't have merge functions in March, we want to read the tables from models, using, a version of, the code below:

This should work:

CLASS_TABLES = {}
for node in model.nodes().values():
    CLASS_TABLES[node.get_input_type()] = node.fields()

Downside is that it requires a model instance. But the results doesn't depend on the model.

Originally posted by @visr in https://github.com/Deltares/Ribasim-NL/issues/67#issuecomment-1957932327