[com4]: allow executing FlowPy from a different repo with cfg overwrite#1298
[com4]: allow executing FlowPy from a different repo with cfg overwrite#1298PaulaSp3 wants to merge 10 commits into
Conversation
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (2)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
There was a problem hiding this comment.
Good addition - should work as a quick hack and not break any current usage of the script.
For a more permanent solution I would suggest at least to address the following points:
- instead of just returning
uidat every exit point of the function we can return sth. like a named tuple or dictionary with the uid and a function exit status, that lets the caller know if the function executed com4FlowPy successfully or did not run the model - because input was incorrect, result folders already exist --> see extra comment below - write a small test that confirms the expected behavior of the functionality for different scenarios
in addition we could use this to think about how we want to handle the situation of already existing results with the same uid, which is currently also not solved well. Maybe we could:
- add an additional check, that also looks if the existing result folder with the
uidis populated with valid resultFiles instead of just checking if the folder already exists (now this could also result from a previously started, but aborted model run) --> this would fix Issue #1135 - add an additional function parameter
overwritewhere the user can specify e.g.default--> don't run simulation if results with sameuidalready there;overwriteif sims should be performed any way
11abad5 to
6bdcf91
Compare
6bdcf91 to
52f01ef
Compare

update:
the return of the
runCom4FlowPy.main()function is a dictionary containing:a simulation is executed, when there are no files in the results folder (with the same uid as the simulation that should be done)
a flag
overwriteResultsis added,Trueresult files are created although they already exist with same uidadded test