-
Notifications
You must be signed in to change notification settings - Fork 195
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
Convenience kwargs in JLD2OutputWriter
constructor for averaging output
#887
Conversation
…JLD2OutputWriter constructor
Ah, it looks like I accidentally branched this PR from |
OutputWriter
constructors for averaging outputJLD2OutputWriter
constructor for averaging output
Codecov Report
@@ Coverage Diff @@
## master #887 +/- ##
==========================================
+ Coverage 71.34% 71.39% +0.05%
==========================================
Files 187 187
Lines 5276 5289 +13
==========================================
+ Hits 3764 3776 +12
- Misses 1512 1513 +1
Continue to review full report at Codecov.
|
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.
Looks good to merge! I agree with needing to refactor the NetCDFOutputWriter
after which we can add time averaging capabilities to it.
# Convert each output to WindowedTimeAverage if time_averaging_window is specified | ||
if !isnothing(time_averaging_window) | ||
|
||
!isnothing(iteration_interval) && error("Cannot specify iteration_interval with time_averaging_window.") |
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.
I might throw an ArgumentError
as it's more specific and allows us to @test_throws
the constructor.
This PR adds the keyword arguments
time_averaging_window
andtime_averaging_stride
to the constructors forJLD2OutputWriter
andNetCDFOutputWriter
. A non-nothing
time_averaging_window
transforms all the specified output to aWindowedTimeAverage
.I have implemented this feature for
JLD2OutputWriter
only so far.@ali-ramadhan, can you confirm that the pattern applied toJLD2OutputWriter
will work forNetCDFOutputWriter
? I'm not 100% sure how it would work with the "slice" functionality of theNetCDFOutputWriter
.Todo:
[ ] Implement convenience kwargs forNetCDFOutputWriter
JLD2OutputWriter
[ ] Tests forNetCDFOutputWriter
Edit: I think we should just get this working for the
JLD2OutputWriter
for now. TheNetCDFOutputWriter
needs a bit of work anyways. We can extendNetCDFOutputWriter
to averaged output once that preliminary work is complete.