Skip to content
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

format examples #1531

Merged
merged 7 commits into from
Nov 3, 2023
Merged

format examples #1531

merged 7 commits into from
Nov 3, 2023

Conversation

ranocha
Copy link
Member

@ranocha ranocha commented Jun 16, 2023

It would be nice if several people could review this PR, e.g., @trixi-framework/developers

TODO

  • update style guide

@codecov
Copy link

codecov bot commented Jun 16, 2023

Codecov Report

Attention: 1145 lines in your changes are missing coverage. Please review.

Comparison is base (08a2e09) 82.77% compared to head (541a510) 72.65%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1531       +/-   ##
===========================================
- Coverage   82.77%   72.65%   -10.12%     
===========================================
  Files         431      431               
  Lines       34647    34637       -10     
===========================================
- Hits        28678    25164     -3514     
- Misses       5969     9473     +3504     
Flag Coverage Δ
unittests 72.65% <33.12%> (-10.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
examples/dgmulti_2d/elixir_euler_bilinear.jl 100.00% <100.00%> (ø)
...les/dgmulti_2d/elixir_euler_brown_minion_vortex.jl 100.00% <100.00%> (ø)
examples/dgmulti_2d/elixir_euler_curved.jl 100.00% <100.00%> (ø)
...ti_2d/elixir_euler_kelvin_helmholtz_instability.jl 100.00% <100.00%> (ø)
...lti_2d/elixir_euler_rayleigh_taylor_instability.jl 100.00% <100.00%> (ø)
...s/dgmulti_2d/elixir_euler_shockcapturing_curved.jl 100.00% <100.00%> (ø)
examples/dgmulti_2d/elixir_euler_weakform.jl 100.00% <100.00%> (ø)
examples/dgmulti_2d/elixir_mhd_reflective_wall.jl 100.00% <100.00%> (ø)
examples/dgmulti_3d/elixir_euler_curved.jl 100.00% <100.00%> (ø)
...les/dgmulti_3d/elixir_euler_taylor_green_vortex.jl 100.00% <100.00%> (ø)
... and 178 more

... and 54 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SimonCan SimonCan self-requested a review June 16, 2023 07:48
SimonCan
SimonCan previously approved these changes Jun 16, 2023
Copy link
Contributor

@jlchan jlchan left a comment

Choose a reason for hiding this comment

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

Looked over all of the dgmulti_1d and 2d elixirs. A few minor comments but nothing too major.

Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

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

I've randomly looked at a number of files from different mesh types. Mostly, it seems like everything is as good or as bad as before, sometimes there are slight improvements

In some cases (already noted by @JoshuaLampert @SimonCan @jlchan), there exists a somewhat weird formatting with binary operators being alone on one line. This is obviously a decline in readability. However, they are fixable (by moving the binary op to the previous line). Thus, from my side there are no hard reasons to not proceed with merging this once everyone had.a chance to review (and improve) things

@ranocha ranocha force-pushed the hr/format_examples branch from 2e213d8 to d038587 Compare November 2, 2023 07:48
@ranocha
Copy link
Member Author

ranocha commented Nov 2, 2023

I updated this PR based on the recent main. I also added the workaround for the weird formatting of binary operators everywhere. Some stochastic last reviews would be nice before merging this when tests pass.

There are some instances where the arguments x, t are on separate lines when defining boundary conditions - but that's necessary given our line length limit we use right now. The other cases with t, alone on a separate line are fixed.

@ranocha ranocha requested a review from sloede November 2, 2023 09:20
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

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

I did some spot checks but nothing rang besides that, like for the test/ folder, this reformatting is unfortunately not a clear improvement for readability but rather a lateral move. I still think it is useful to do!

It would be good if maybe @JoshuaLampert or @lchristm could have a look as well, maybe also @DanielDoehring? Not at everything, of course, but at least at a few random elixirs...

@DanielDoehring
Copy link
Contributor

Looks alright to me, we loose some "nice" formatting like

coordinates_min = (-1.0, -1.0) # minimum coordinates (min(x), min(y))
coordinates_max = ( 1.0,  1.0) # maximum coordinates (max(x), max(y))

which becomes

coordinates_min = (-1.0, -1.0) # minimum coordinates (min(x), min(y))
coordinates_max = (1.0, 1.0) # maximum coordinates (max(x), max(y))

but apart from that this looks fine to me.

Copy link
Member

@lchristm lchristm left a comment

Choose a reason for hiding this comment

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

I only looked at a few files (~two dozen; we have a lot of examples these days 😅) and did not find any issues. IMHO, overall the readability is not much better than before, but I think it is good that the formatting is consistent with the main code base now.

Copy link
Member

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

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

LGTM!

@JoshuaLampert
Copy link
Member

Looks alright to me, we loose some "nice" formatting like

coordinates_min = (-1.0, -1.0) # minimum coordinates (min(x), min(y))
coordinates_max = ( 1.0,  1.0) # maximum coordinates (max(x), max(y))

which becomes

coordinates_min = (-1.0, -1.0) # minimum coordinates (min(x), min(y))
coordinates_max = (1.0, 1.0) # maximum coordinates (max(x), max(y))

but apart from that this looks fine to me.

Personally, I actually prefer the formatted one.

@JoshuaLampert
Copy link
Member

Does someone know why some of the tests fail? Some of them even quite considerably (the actual error differs by one order of magnitude to the expected one)... We having similar issues also in other PRs, but strangely not the same tests fail.

@ranocha
Copy link
Member Author

ranocha commented Nov 3, 2023

Does someone know why some of the tests fail? Some of them even quite considerably (the actual error differs by one order of magnitude to the expected one)... We having similar issues also in other PRs, but strangely not the same tests fail.

I have no clue... 😞

@ranocha ranocha marked this pull request as ready for review November 3, 2023 10:28
@ranocha
Copy link
Member Author

ranocha commented Nov 3, 2023

Since CI also fails in other PRs, I think we should go ahead and merge this PR to avoid merge conflicts with other works. Okay for you, @sloede?

@sloede
Copy link
Member

sloede commented Nov 3, 2023

Since CI also fails in other PRs, I think we should go ahead and merge this PR to avoid merge conflicts with other works. Okay for you, @sloede?

I think we should wait until all tests have run, but yes, I agree that if this is just the same errors as elsewhere, we can merge

@ranocha ranocha merged commit c79fa43 into main Nov 3, 2023
25 of 31 checks passed
@ranocha ranocha deleted the hr/format_examples branch November 3, 2023 12:47
@DanielDoehring
Copy link
Contributor

Does someone know why some of the tests fail? Some of them even quite considerably (the actual error differs by one order of magnitude to the expected one)... We having similar issues also in other PRs, but strangely not the same tests fail.

So for the elixirs using the error-based timestepping I remember that there where actually different errors depending on the machine. This time, I can actually reproduce the errors on my machine and we have differences for other examples using CFL-based timestepping.

In principle, we should be able to find the point where things went wrong, right...?

bennibolm added a commit to bennibolm/Trixi.jl that referenced this pull request Nov 6, 2023
* Revise bounds check for MCL

* Rename `idp_bounds_delta` for MCL to `mcl_bounds_delta`

* Remove comment

* Fix allocs (trixi-framework#1695)

* Fix allocs

* remove unnecessary code

* rerun fmt

* format

* Allocation tests dgmulti 2d (trixi-framework#1698)

* HLLE CEE 2D3D NonCartesian Meshes (trixi-framework#1692)

* HLLE CEE 2D3D NonCartesian Meshes

* format

* hlle via hll

* format test

* format test

* format

* do not export hlle

* Correct test vals

* test values CI

* Update src/equations/compressible_euler_2d.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* Update src/equations/compressible_euler_1d.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* Update src/equations/compressible_euler_2d.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* Update src/equations/compressible_euler_3d.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* Update src/equations/compressible_euler_3d.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* apply suggestions

* additional sentence

* Fix typo

* typos

* correct test vals

---------

Co-authored-by: Hendrik Ranocha <[email protected]>

* Bump crate-ci/typos from 1.16.15 to 1.16.21 (trixi-framework#1700)

Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.16.15 to 1.16.21.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](crate-ci/typos@v1.16.15...v1.16.21)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add NumFOCUS + ACTRIX to acknowledgments (trixi-framework#1697)

* Add NumFOCUS + ACTRIX to acknowledgments

* Try to avoid spaces

* Another try to avoid gaps between images

* Hopefully fix image alignment in docs

* Try new logo formats

* Use smaller DUBS logo and add DUBS funding statement

* Add markdown-based table for logos in docs

* Try another table approach

* Hopefully get a layout that finally *works*...

* Arrrrrrgggggghhhhh

* format examples (trixi-framework#1531)

* format examples

* check formatting of examples in CI

* update style guide

* fix weird formatting

* fix formatting of binary operators

* format again

* Update differentiable_programming.jl (trixi-framework#1704)

* Format subcell elixirs

* Add warning for missing bounds check for entropy limiter (MCL)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Daniel Doehring <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
Co-authored-by: ArseniyKholod <[email protected]>
@ranocha
Copy link
Member Author

ranocha commented Nov 6, 2023

Yes, you're right. Did some update of one of the time stepping dependencies introduce the change we see here?

Comment on lines +168 to +169
-
-
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting appears to have removed something crucial

Copy link
Member

Choose a reason for hiding this comment

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

I don't think the formatter did that, but the manual formatting, e.g., here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants