The Flood Modeller Python API is a free and open-source python package which provides a bridge between Flood Modeller and the python programming language to extend the capabilities of Flood Modeller in automated workflows
Currently the DAT.insert_unit() is handy for insert a single unit into a DAT file, and can be called in a loop to add more than one. However when adding larger amounts of units it becomes pretty slow as every iteration requires the DAT._update_raw_data() method to be called.
Instead it would be better to have a new method DAT.insert_units() which can be passed a list of units, and inserts them one by one but defers the _update_raw_data() call until the end. It will need some investigation to check this will work as expected.
Currently the
DAT.insert_unit()
is handy for insert a single unit into a DAT file, and can be called in a loop to add more than one. However when adding larger amounts of units it becomes pretty slow as every iteration requires theDAT._update_raw_data()
method to be called.Instead it would be better to have a new method
DAT.insert_units()
which can be passed a list of units, and inserts them one by one but defers the_update_raw_data()
call until the end. It will need some investigation to check this will work as expected.