mspass-team / mspass

Massive Parallel Analysis System for Seismologists
https://mspass.org
BSD 3-Clause "New" or "Revised" License
31 stars 12 forks source link

where and how to set up python test programs #50

Open pavlis opened 4 years ago

pavlis commented 4 years ago

I have a number now of potentially useful to necessary (as regression tests) python scripts for testing.
We have a good system for running regression test programs for C++ but how are we going to do this for python?

A different issue is what might be better called example python programs that can also serve as test programs but not to be run in automated scripts? The thing I'm working on right now is an example. A small simulated data test program that tests deconvolution code under ideal conditions. It would not be run in an automated test because it produces matlabplot graphics, which would always fail in the background or block forever (not sure what would happen with the github setup in that situation) while the plot window was waiting to exit. This little program with planned extensions, however, would be a good example to show the different deconvolution methods. Might ultimately be better in a Jupyter notebook, but I need to learn how to do that first. Anyway, point is how do you want to organize this in the repository? I need to put these somewhere under version control. Worse case I'll make small private repository.

wangyinz commented 4 years ago

We should probably create a /python/example directory for such a code. I am in the process of reorganizing the python related directories. This is something for me to learn as I don't really know the best practice yet.

pavlis commented 4 years ago

A new wrinkle on this issue comes up with my recognition of the clear benefits of using jupyter notebook to construct tutorials. jupyter notebooks save their state in yet another format so it isn't at all clear where they should be put in the repository and linked into the master pages? Initially I think I'll create a tutorials directory in docs. We'll need a way to integrate into the main documentation down the road though, but I have no idea how to do that.

In progress are two juypter notebook tutorials:

  1. I'm working on a tutorial to show use of Metadata, MetadataDefinitions, and AntelopePf. This one could be checked into the master branch as soon as I get it finished.
  2. I am also working on a basic deconvolution tutorial to use the algorithms derived from your original work. Well, there is one minor extension with a variant of the multitaper code, but it focuses on all the methods except the generalized iterative method. I think I told you there are bugs in that program I've been struggling to find. My thought is that once I get the core routines fully debugged I can try to tackle that beast.

So, other than an update I need suggestions on where I should put these notebook files in the repository? Will docs/tutorials be sufficient, or should be use something like docs/tutorials/notebooks?

wangyinz commented 4 years ago

Just tried googling that topic and found this. It seems we can use that extension to convert Jupyter notebooks to HTML pages. If we are gonna use this extension, the files should be put in somewhere like docs/source/tutorials

pavlis commented 4 years ago

Ok, I will check this working tutorial into master under source/tutorials.

If it isn't already there we should also install juypter on the docker container. People should be able to run this tutorial directly on the container image without having to install mspass at all. This would be extremely useful and an important demonstration of the merits of docker for the short course I hope we can hold in August at SAGE/GAGE. Note, however, that if that doesn't actually happen we could almost certainly do the same short course as a webinar as a fallback.