Skip to content

[com4]: allow executing FlowPy from a different repo with cfg overwrite#1298

Open
PaulaSp3 wants to merge 10 commits into
masterfrom
PS_FP_changeCfgRead
Open

[com4]: allow executing FlowPy from a different repo with cfg overwrite#1298
PaulaSp3 wants to merge 10 commits into
masterfrom
PS_FP_changeCfgRead

Conversation

@PaulaSp3

@PaulaSp3 PaulaSp3 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

update:

  • the return of the runCom4FlowPy.main() function is a dictionary containing:

    • "uid": id of simulation
    • "simulation": boolean: is the simulation is run
    • "resultOverwritten": boolean: are result files overwritten
    • "message": explanation to simulation status
  • 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 overwriteResults is added,

    • if it is True result files are created although they already exist with same uid
    • (now, the file name contains the time stamp of the simulation, so the new result files do not overwrite the existing, they are added; do we want that or overwriting them? -> e.g. with deleting the timestamp in the file name or deleting the already existing result folder, and creating a new one within the simulation)
  • added test

@PaulaSp3 PaulaSp3 requested a review from ahuber-bfw June 22, 2026 15:26
@PaulaSp3 PaulaSp3 self-assigned this Jun 22, 2026
@PaulaSp3 PaulaSp3 added the flowPyDev Ideas for future development label Jun 22, 2026
@qltysh

qltysh Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Qlty


Coverage Impact

⬆️ Merging this pull request will increase total coverage on master by 3.34%.

Modified Files with Diff Coverage (2)

RatingFile% DiffUncovered Line #s
Coverage rating: B Coverage rating: B
avaframe/in3Utils/fileHandlerUtils.py97.4%925
Coverage rating: F Coverage rating: F
avaframe/com4FlowPy/com4FlowPy.py0.0%424-796
Total90.5%
🤖 Increase coverage with AI coding...
In the `PS_FP_changeCfgRead` branch, add test coverage for this new code:

- `avaframe/com4FlowPy/com4FlowPy.py` -- Line 424-796
- `avaframe/in3Utils/fileHandlerUtils.py` -- Line 925

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@ahuber-bfw ahuber-bfw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 uid at 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 uid is 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 overwrite where the user can specify e.g. default --> don't run simulation if results with same uid already there; overwrite if sims should be performed any way

Comment thread avaframe/runCom4FlowPy.py
Comment thread avaframe/runCom4FlowPy.py Outdated
@PaulaSp3 PaulaSp3 force-pushed the PS_FP_changeCfgRead branch from 11abad5 to 6bdcf91 Compare July 6, 2026 14:39
@PaulaSp3 PaulaSp3 force-pushed the PS_FP_changeCfgRead branch from 6bdcf91 to 52f01ef Compare July 6, 2026 14:47
@PaulaSp3 PaulaSp3 linked an issue Jul 6, 2026 that may be closed by this pull request

@ahuber-bfw ahuber-bfw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests schauen gut aus - dictionary als return passt auch.

  • die Kommentare in runCom4FlowPy.py bitte noch anpassen
  • der comment im .ini file ist als Diskussionspunkt gedacht (was meinst du?)

Comment thread avaframe/runCom4FlowPy.py Outdated
Comment thread avaframe/runCom4FlowPy.py Outdated
Comment thread avaframe/runCom4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPyCfg.ini Outdated
Comment thread avaframe/runCom4FlowPy.py Outdated
Comment thread avaframe/runCom4FlowPy.py
Comment thread avaframe/in3Utils/fileHandlerUtils.py Outdated
Comment thread avaframe/in3Utils/fileHandlerUtils.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flowPyDev Ideas for future development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[com4]: adapt skipping a simulation if already existing

2 participants