NRL-Plasma-Physics-Division / turbopy

A lightweight computational physics framework, based on the organization of turboWAVE. Implements a "Simulation, PhysicsModule, ComputeTool, Diagnostic" class hierarchy.
https://turbopy.readthedocs.io/
Creative Commons Zero v1.0 Universal
10 stars 18 forks source link

Add writing to files during a simulation #156

Closed AOstenfeld closed 3 years ago

AOstenfeld commented 4 years ago

Pull Request

Description

Uses the IntervalHandler class to allow simulations to write to the output files while it is running.

This pull request addresses #145

codecov-io commented 4 years ago

Codecov Report

Merging #156 (924af54) into main (c3cd3f3) will decrease coverage by 0.75%. The diff coverage is 63.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
- Coverage   92.80%   92.04%   -0.76%     
==========================================
  Files           6        6              
  Lines         723      742      +19     
==========================================
+ Hits          671      683      +12     
- Misses         52       59       +7     
Impacted Files Coverage Δ
turbopy/diagnostics.py 85.40% <63.15%> (-1.98%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c3cd3f3...924af54. Read the comment docs.

AOstenfeld commented 4 years ago

Hey @arichar6 , I'm really sorry that this PR is taking so long, but I'm not sure what exactly I'm supposed to do. In your last suggestion, you wanted me to implement the IntervalHandler class into the HistoryDiagnostic class, but that already seems to have been done. The current PR I have extends the IntervalHandler functionality to the ClockDiagnostic class, so should I do the same thing with the other "Diagnostic" classes? Again, sorry I'm taking so long with this.

arichar6 commented 4 years ago

Hi @AOstenfeld. Don't worry about the slow progress... I haven't exactly been fast getting back to you either!

I'll try and take a look at the PR today, and answer your questions. Thanks for sticking with this!

AOstenfeld commented 3 years ago

Alright, I think I'm finally back to working consistently.

AOstenfeld commented 3 years ago

How do I merge the changes from the main branch into here?

arichar6 commented 3 years ago

How do I merge the changes from the main branch into here?

I usually do this from the command line, or sometimes using a GUI. This page has a short overview of the git merge command. That site also has more details in their free online git book. Let me know if you still have questions. We can set up a call to chat about this.

AOstenfeld commented 3 years ago

I think I fixed all the errors that my earlier changes caused lol.

AOstenfeld commented 3 years ago

I think this is ready for review

AOstenfeld commented 3 years ago

I believe that the interval handler works fine (or at least it should), but there is some unnecessary code that still uses the old dump_interval approach. I've commented it out for review, but I think it can be deleted.

AOstenfeld commented 3 years ago

Also, all the newly failed tests seem to be a result of missing the parameters that I commented out. I can change them too if the lines I commented out can in fact be removed.

arichar6 commented 3 years ago

I am working on getting the tests to pass. You are right that they are related to the un-needed parameters. I'll make a PR to your branch once I get this working. Hopefully it will be soon!

codecov-commenter commented 3 years ago

Codecov Report

Merging #156 (732cfae) into main (c3cd3f3) will increase coverage by 0.13%. The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
+ Coverage   92.80%   92.94%   +0.13%     
==========================================
  Files           6        6              
  Lines         723      751      +28     
==========================================
+ Hits          671      698      +27     
- Misses         52       53       +1     
Impacted Files Coverage Δ
turbopy/diagnostics.py 87.44% <69.23%> (+0.06%) :arrow_up:
turbopy/core.py 93.60% <0.00%> (+0.51%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c3cd3f3...732cfae. Read the comment docs.