Deltares / HYDROLIB-core

Core code around the I/O of the DHYDRO-suite
https://deltares.github.io/HYDROLIB-core/
MIT License
24 stars 4 forks source link

FMModel takes 15 minutes to load #330

Open LisaWeijers opened 2 years ago

LisaWeijers commented 2 years ago

Bug description I created a model with D-Hydamo for a project. I'm going to use Hydrolib-core to change the bottom levels (profile optimizer). However, the model takes extremely long to load as FMModel: 15 minutes. Exporting it after making changes takes another 10 to 20 minutes.

I happen to have a few versions of this model: one directly from D-Hydamo (with major mistakes like culverts at 999 m NAP) and one as a dsproj (with the major mistakes deleted). Otherwise, I don't think there are any big differences between these two. However, the first one can load as FMModel in a matter of seconds, but the dsproj version (the correct model) takes 15 minutes.

I have two questions: Why does this happen? & How can this be fixed?

To Reproduce Link to the models: https://royalhaskoningdhv.box.com/s/z172o46pl400n477e20rr94ylqplxg6j

from hydrolib.core.io.mdu.models import FMModel
from pathlib import Path

# base model with mistakes
p = Path(r'c:\Users\BH8407 TKI5 DH VC WIP\03_Info\00_Example_DHydro_model\AaOfWeerijs\test_9_aa_of_weerijs.mdu')
fm = FMModel(p)
print(fm.show_tree())

# dsproj model
p = Path(r'c:\Users\BH8407 TKI5 DH VC WIP\03_Info\00_Example_DHydro_model\training_model_AW_doorgerekend.dsproj_data\Export_aa_of_weerijs\input\Export_aa_of_weerijs.mdu')
fm = FMModel(p)

print(fm.show_tree())
LisaWeijers commented 2 years ago

I'll be on holiday starting 2 september, so if there are any questions and developments after that time, make sure to contact @rinekeh as well ;)

LisaWeijers commented 2 years ago

Forgot to mention: Hydrolib core version used is 0.3.0

LisaWeijers commented 1 year ago

@arthurvd Hey! I just wanted to email you about this, and saw that you updated this. Do you have any clue why this happens?

arthurvd commented 1 year ago

@LisaWeijers : this is quite unfortunate, I lost the input files, and the above file sender link has expired. Apologies! We're doing a lot of developments recently on HYDROLIB-core, so would you still have this example model for us? Or perhaps something similar that we can use for performance testing?

priscavdsluis commented 1 year ago

I tested the performance with the eindhoven model and that one takes roughly 30 seconds to load. I am curious to test the performance with the original model from this issue.

rinekeh commented 1 year ago

I will try to find the original model early next week.