-
Notifications
You must be signed in to change notification settings - Fork 5
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
Integrate more python tools #93
Comments
@zhucaoxiang Nice work. During my time at PPPL, @KseniaAleynikova , @smiet and I put together the |
I think we should indeed have some stand-alone plotting routines, that can directly be run on the output for the quick inspection. The code of @zhucaoxiang currently uses different reading routines than the py_spec reading routine, but to prevent code duplication I think it is best to adapt it to use the same read in routine. I will look into adapting these routines to use py_spec. If py_spec needs to be adapted, I will add to it. I have asked the Gekyll developers how they have implemented their python postprocessing. They have multiple classes: one class object which reads in and contains all the raw data from the hdf5 file. Then a second class which takes as input the raw data class, and has as in-built functions the things you want to do. That would look like this:
Separating the data class from the class that manipulates this data and makes the plots helps keep the code clear and separate. Thoughts? |
Personally, I would prefer the objective-oriented style, which is to put SPEC related functions into one class. In this sense, one doesn't have to specify the output for each process. Of course, there must be some functions that should be stand-alone, like As to the different classes Another point I prefer is to use keyword arguments for plotting, which will gain the convenience a lot. |
@zhucaoxiang I completely agree with using the object-oriented style, and with using keyworded arguments as much as possible! I think that putting all the functions into the base class can make it large and unwieldy, but I am not completely against it. We could make subclasses like in numpy, where you have My proposal is to separate the functions from the data they are acting on, but still do it in an object-oriented way, giving the user an object of a Also @zhucaoxiang, I see your spec.py uses a |
I have made some changes to some python tools. Personally, I would like to integrate all functions into one class, such that it is convenient to use and portable.
In spec.py from the
pythontools
branch, I have implemented/moved some plotting functions for SPEC and put them into theSPEC
class (Each function is documented).Here is a way to use it.
This is just to motivate some discussions on working together with more SPEC python functions.
The text was updated successfully, but these errors were encountered: