05 January 2010

Scientific Software Developer Mantra


"Care enough to be a better scientific software developer today than yesterday."



For several months now, I have been trying to word a personal mantra for a scientific software developer (SSD). There has been about half a dozen mantras that I have been tossing around without settling on anyone mantra. They all were similar and the basic idea started with was, "Get better each day." Which in life is a good mantra.

So I decided to settle on the one above and to use it until a more polished one emerges (refactoring for emergent design.) It may seem too wordy for a mantra but it conveys how I want to behave as a SSD. Of course, if I was doing other parts of computational physics then computational physicist could be inserted easily.

Recently, Dan Pink posted a video called "Two Questions" about two questions that could change your life in 2010. I thought question #2 was coincidentally appropriate for this post.

Follow-up To Where Is Software Development Really Learned?: Stroustrup's Article

A few months ago I pondered Where Is Software Development Really Learned? And my thoughts were, "We learn on-the-job and by professional development but not often in school. Even for many CS majors."

Recently, Bjarne Stroustrup wrote on a similar topic in What Should We Teach New Software Developers? Why?

Again, what jumps out at me in Stroustrup's article (especially in The Problem section) is where is software development really learned? One of his conclusions was similar to mine (internships and mentoring in industry along with formal education) in that academia and industry need to bridge this gap.

Interesting article.

03 January 2010

Simulation Model: Stage Four - Verification

Thinking about Pople's Quantum Chemistry Models (or in more general Simulation Models), where five stages may be distinguished as:

1) Target
2) Formulation
3) Implementation
4) Verification
5) Prediction

I got to thinking about the fourth stage:

4) Verification
The next step is to test the model against known chemical facts to determine whether the target has been achieved. If quantitative accuracy is being sought, this can be done by various statistical criteria such as the root-mean-square difference between the results of the theoretical model and experimental data. In selecting such a dataset, it is important to make it as broad as possible, while limiting it to experimental facts known to be of high quality. If the results of such a comparison do meet the target requirements, the model may be said to
be validated.

and how this applies to almost any other type of scientific endeavor.

Can stage four be skipped? In doing so how do we know stage five (Prediction) results are correct? How do we start problem solving if stage five results are incorrect? If stage five results are correct then how do we know that several wrongs did not make a right?

There are many unanswered questions and there could be even more depending on the situation.

Without stage four, I would not be confident in the results of stage five for doing predictive science. Could one start from scratch and reproduce my results without stage four? Perhaps but most likely it would be fortuitous and if several persons tried to reproduce the results then most likely my results would be found out to not be very reliable. Without each stage where is my accountability?

Interestingly enough, these five stages could be associated (or at least have direct analogies) with doing experiment too. To take it even a step farther, these five stages could be said to be the outline of the scientific method.

Science is built in steps and with each step confidence and reliability is built. Without stage four are we really doing science or are we just playing around wasting time and money?

31 December 2009

"Programming: Principles and Practice Using C++"

"Programming is learned by writing programs."
-from the Preface page xxv of Stroustrup's new book on programming using C++.

Programming: Principles and Practices Using C++
by Bjarne Strousrup.

So far the first impression of the book, built from browsing and skimming, is that one could learn the essentials of programming and software construction while using the C++ languages. The book is based on a first year course that Stroustrup taught at Texas A&M University. It appears a lot of work and thought has gone into the course and book.

This is not a typical text book as Stroustrup says, "No. This is not a traditional Computer Science 101 course. It is a book about how to construct working software. ...... It is about programming (or more generally about how to develop software), and as such it goes into more detail about fewer topics than many traditional courses."

I look forward to studying several of the book topics that I have never really used or fully looked at while developing software. As a text book about programming then this may be an excellent book about programming and learning C++ at the same time. We will see how it goes as I work through the book.


14 November 2009

Python For Scientists and Engineers: Recent Class

Steve and I took a three day class that ended up being a survey of what is available for scientists and engineers using Python. The instructor did point out a good number sites to look at for scientific software bundles in Python.

One the most interesting sites pointed to was Python(x,y) which has bundled a number of tools (mostly python) into one package that was right up our alley on the MCATK project we are working. Python(x,y) is free and all the packages bundled under it are free-ware.

Python(x,y) has downloads for two platforms so far. Windows and Ubuntu. I have downloaded the Windows version (full setup) onto two different machines and it has installed perfectly and easily.

Python(x,y) provides a small window with menus and buttons that serve up the various packages it offers. Some of the packages Eclipse, Qt, MayaVi, SciTE, IDLE, gnuplot, Python, and IPython. There are Python modules for numpy, scipy, numexpr, sympy, matplotlib, pylab, and VTK to name a few. There is easy access to documentation for all of these packages and more.

You can easily launch Eclipse from the Python(x,y) window and turn around and launch the IPython command line window too. Also in the bundle is the Spyder the interactive software development environment.

For us one nice thing is that Eclipse already has plug-ins for CDT(C++), Python, and PyDev (unit tester). This way since we already do development with Eclipse and C++ then we can now easily do any Python work within the same IDE with unit testing. Unfortunately it is only available for Windows and Ubuntu at this time.

Also downloaded is the Photran plugin for Fortran development under Eclipse. Not that we need that.

Another site pointed out to us was EnThought which has some prebundled Python tools. The bundles are not free but all the packages under them are free. So you could download them yourself if you did not want to pay. The site is a great resource for scientific computing.

All in all it seems that Python would be fine choice for many scientific computation needs. Less so for the HPC we are doing at LANL but it certainly come in handy as another tool in our toolbox. One suggested use of Python and all the available tools was as a replacement for MatLab since all the Python tools are free. Definitely a possibility especially for students.

Recently, Neopythonic (Guido van Rossum) has an interesting post about Python in the Scientific World. Check it out.