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

Definition of gridpoints() and its tests #7

Merged
merged 2 commits into from
Feb 29, 2024
Merged

Definition of gridpoints() and its tests #7

merged 2 commits into from
Feb 29, 2024

Conversation

jbytecode
Copy link
Contributor

gridpoints() was originally defined as

function gridpoints(x::Vector{T}, y=x::Vector{T}, z=x::Vector{T}) where T<:Real
    reshape([GeometryBasics.Point{3, T}(x, y, z) for z in z, y in y, x in x], 
                             length(x)*length(y)*length(z))
end 

but it can be simplified like this

function gridpoints(x::Vector{T}, y=x, z=x) where T<:Real
    reshape([GeometryBasics.Point{3, T}(x, y, z) for z in z, y in y, x in x], 
                             length(x)*length(y)*length(z))
end 

A test suite is added to avoiding any breaking changes. expected values are obtained by the original code. The changed code produces the same output.

@Kevin-Mattheus-Moerman
Copy link
Member

Great thanks!

@Kevin-Mattheus-Moerman Kevin-Mattheus-Moerman merged commit b640129 into COMODO-research:main Feb 29, 2024
0 of 3 checks passed
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