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

Create diagnostic helper which writes to .npy files #146

Closed arichar6 closed 4 years ago

arichar6 commented 4 years ago

TurboPy currently has a helper class which writes diagnostic data to csv files.

https://github.com/NRL-Plasma-Physics-Division/turbopy/blob/165a006ad9ea776e775ef5d823791549b7a53ca5/turbopy/diagnostics.py#L14

This is quite useful because it's a standard file format, and readable with a text editor. It is, however, inefficient both in terms of file space and in terms of read/write speed.

A natural option for a faster, more space efficient, file format would be the numpy .npy format. See this article for one argument in favor of .npy over .csv files.

A first step towards using .npy files with turboPy would be implementation of a NPYOutputUtility class similar to the csv class linked above. Close this issue by writing this class, with functionality, documentation, and tests that parallel those for the CSVOutputUtility class.

arichar6 commented 4 years ago

There is now a new OutputUtility abstract base class, which would make this even easier.

arichar6 commented 4 years ago

Closed with #159