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

Change default output array type for JLD2OutputWriter to Array{Float64} #2890

Merged
merged 12 commits into from
Feb 6, 2023

Conversation

glwagner
Copy link
Member

@glwagner glwagner commented Feb 1, 2023

While Array{Float32} is neat because user output is smaller, it's a bad default because it often leads to confusing results, like the fact that outputing Field(Integral(c)) is different (possibly by eps(Float32)) than computing Integral(c_output) in post processing when Field(Integral(c)) is close to 0.

Thus @xkykai and I propose to make the default Array{Float64}. We could regard outputting with Array{Float32} as an "optimization" which is premature as a default.

…t64}

While `Array{Float32}` is neat because user output is smaller, it's a bad default because it often leads to confusing results, like the fact that outputing `Field(Integral(c))` is different (possibly by `eps(Float32)`) than computing `Integral(c_output)` in post processing.

Thus @xkykai and I propose to make the default `Array{Float64}`. We could regard outputting with `Array{Float32}` as an "optimization" which is premature as a default.
@glwagner glwagner changed the title Change default output array type for JLD2OutputWriter to Array{Floa… Change default output array type for JLD2OutputWriter to Array{Float64}` Feb 1, 2023
@glwagner glwagner changed the title Change default output array type for JLD2OutputWriter to Array{Float64}` Change default output array type for JLD2OutputWriter to Array{Float64} Feb 1, 2023
@glwagner
Copy link
Member Author

glwagner commented Feb 1, 2023

cc @navidcy we also ran into this problem with ParameterEstimocean once

@navidcy
Copy link
Collaborator

navidcy commented Feb 1, 2023

cc @navidcy we also ran into this problem with ParameterEstimocean once

I remember… took days to figure out what was happening

@navidcy
Copy link
Collaborator

navidcy commented Feb 1, 2023

Only for JLD2OutputeWriter?

@glwagner
Copy link
Member Author

glwagner commented Feb 2, 2023

Only for JLD2OutputeWriter?

Good point.

@navidcy navidcy self-requested a review February 3, 2023 05:27
Comment on lines 199 to 204
@test eltype(ds2["xC"]) == Float64
@test eltype(ds2["xF"]) == Float64
@test eltype(ds2["yC"]) == Float64
@test eltype(ds2["yF"]) == Float64
@test eltype(ds2["zC"]) == Float64
@test eltype(ds2["zF"]) == Float64
Copy link
Collaborator

Choose a reason for hiding this comment

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

ds2 is nc_sliced_writer which was constructed with explicit array_type = Array{Float32}

@navidcy
Copy link
Collaborator

navidcy commented Feb 4, 2023

(fyi I stopped the tests because everything was clogged... all tests in PRs have been running for 6-7 hrs... so perhaps restart when there is less load)

@navidcy
Copy link
Collaborator

navidcy commented Feb 5, 2023

merge?
we didn't bump any patch release, is this OK?

@glwagner
Copy link
Member Author

glwagner commented Feb 5, 2023

Let's bump

@navidcy
Copy link
Collaborator

navidcy commented Feb 5, 2023

why 0.79.3? we are only up to 0.79.1... am I missing something?

@glwagner
Copy link
Member Author

glwagner commented Feb 5, 2023

why 0.79.3? we are only up to 0.79.1... am I missing something?

you;re right

@navidcy
Copy link
Collaborator

navidcy commented Feb 6, 2023

Merge?

@glwagner glwagner merged commit 83e8dd4 into main Feb 6, 2023
@glwagner glwagner deleted the glw-xk/jld2-output-float64 branch February 6, 2023 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants