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

Refactor of some stretched rectilinear grid tests #2917

Merged
merged 5 commits into from
Feb 11, 2023
Merged

Conversation

tomchor
Copy link
Collaborator

@tomchor tomchor commented Feb 10, 2023

I noticed that in a couple of tests in test_grids.jl the code was written in way that leads to some not-so-clear statements such as:

@test all(isapprox.( grid.Δzᵃᵃᶠ[2:Nz], Δzᵃᵃᶜ.(2:Nz) ))

The above seems wrong at first but it's actually correct since Δzᵃᵃᶜ() is defined the same way as grid.Δzᵃᵃᶠ.

This PR changes that to make the notation clearer (i.e. grid.Δzᵃᵃᶠ[2:Nz] == Δzᵃᵃᶠ.(2:Nz)) and condenses 3 separate test functions for stretched grids (needing three separate grid instantiations) into one function (with the same tests).

EDIT:

This also implements a suggestion by @glwagner in #2865 that couldn't be implemented then. I'll open another PR in the near future to further condense some other tests.

tomchor and others added 2 commits February 10, 2023 19:06
Co-authored-by: Navid C. Constantinou <navidcy@users.noreply.github.com>
@tomchor tomchor requested a review from navidcy February 10, 2023 22:08
test/test_grids.jl Outdated Show resolved Hide resolved
@tomchor tomchor changed the title Refactor of a some stretched rectilinear grid test Refactor of a some stretched rectilinear grid tests Feb 10, 2023
@tomchor tomchor changed the title Refactor of a some stretched rectilinear grid tests Refactor of some stretched rectilinear grid tests Feb 11, 2023
@navidcy navidcy merged commit e5e7b8f into main Feb 11, 2023
@tomchor tomchor deleted the tc/rect-grid-test branch February 11, 2023 19:28
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.

2 participants