-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add config visualizations in tutorial descriptions #514
Conversation
Good idea 👍 |
The auto-generation is also what I would aim to, once we agree on what we want to have. |
"Configuration" section (like you have it now) sounds good to me.
What else do we still need to define? |
Easy automation: use pre-commit to render each precice-config.xml to |
…on tutorial faster (precice#516) * Use 4 processors and remove the initial Allen Cahn solving step * Save porosity value in initialize so that it used in the first solve call * Formatting * Revert to running the Micro Manager with 2 processors, as the runtime is ~10 minutes * Remove excess radius factor to account for correction of the diffuse interface width
I added now a script, some CI checks, and the generated files everywhere possible. The I also fixed the The juice of this PR is in the following files:
The first script relies on the |
It actually looks like the images are not even reproducible between successive runs. |
I now switched to DOT for the comparisons, as these are reproducible. So, we now check:
@uekerman any objections to that? An alternative workaround would be to generate the files directly in the website CI, but then they will not be rendered in the README files of this repository (on GitHub or locally) and they will not be part of the versioning. A final question would be if we have any reasons to avoid SVG. A heads-up for the diff: we have 31 tutorial directories, of which one (flow-over-heated-plate-direct) cannot be visualized at the moment. The 96 files changed are:
|
Graphviz layouting uses heuristics or spring-based models to find a decent layout. So they are not reproducible. The nodes in the dot layout often look very similar, but the edges don't. I think you are overthinking this feature a bit. Solving this with an all-in-one script is headache-inducing. pre-commit detects changes in the input XML for you. My suggestion to save you time and pain:
This way, the file is generated on the user system, which is way more likely to have the config-visualizer including dependencies installed. |
But we still need to make precice-config-visualizer an easy dependency, if we want to include it in the pre-commit |
I now added also Even though I am a bit unhappy that this adds generated artifacts (dot files) into the repository, I don't want to invest further work into it at the moment. We could merge this now and improve later. @fsimonis @uekerman ok?
Not sure how I can do that. At the same time, I don't want that every change in the XML config requires people to regenerate the PNG files (which would look different for everyone). Therefore, I think the intermediate DOT files are something we can live with. |
This requires to pin the version of the config-visualizer
Discussion fatigue and the sunken cost fallacy are no arguments for merging a PR. This exact situation has repeatedly bitten us (especially me) in the precice repo. The dot files are pretty significant clutter and will also be picked-up by the importer of the website, so this requires more follow-up changes. Reproducible outputsThe dot layouter of graphviz 10.0.1 seems to generate reproducible results for both $ precice-config-visualizer many-participants.xml > out.dot
$ mkdir out
$ seq 1000 | parallel 'dot out.dot -Tpng > out/{}'
$ md5sum out/* | cut -f1 -d' ' | uniq
3667455412d24a04541405c52f58b841
$ dot -V
dot - graphviz version 10.0.1 (0) I used this very complicated OpenDiHu setup to make layout shifts a likely as possible. Conservative suggestionWe use a cron-job to auto regenerate all config visualizations in the tutorials. Most of the work for this has already been done here. Radical suggestionWe render all configs consistently in the pipeline of the website.
Needs some work in the website repo. |
I removed everything related to checking and CI, as well as the dot files. (I just have the feeling we are running in circles and finding more bugs in dependencies, that need more time to fix, that delay everything further, for something that was supposed to be a small painless and very useful add-on since the beginning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you open an issue for the update workflow?
After that feel free to merge.
Too fast... The latest precice-config-visualizer breaks the trick for the direct mesh access:
And changes all the images. |
Fixed in v1.1.1 |
All good now. The already checked-in script works, and the images stay the same on my system. |
I think that it would give a very nice overview if in every tutorial we had a visualization of the config. It would also help popularize the config visualizer.
In terms of location, this should either go to the "Setup", or to a new section "preCICE configuration".
This is a first proof-of-concept to discuss the idea. It is currently bug-bound from precice/config-visualizer#19
In terms of PNG/SVG, the SVG would be smaller, but more complicated to view (correctly).
@uekerman what do you think?