GalSim-developers/GalSim — pull request #240 by barnabytprowe (2012-09-05 01:32:27+00:00)
Title: #237 - Moving wrapped docstrings to the python layer in galsim/*.py files

As per the brief discussion on #237, I've moved (and slightly tweaked in the process on occasion) the class docstrings from `pysrc/Image.cpp` and `pysrc/Random.cpp` to `galsim/image.py` and `galsim/random.py` where they are added to the Python classes following the `import _galsim`.

This is hopefully a more transparent location for this information. Where I've moved docstrings from the C++ wrapper code, I've left a comment saying where the new docstrings are.

Two things to note:

1. A couple of occasions where I've mentioned file locations rely on the Boost.Python C++ wrappers remaining in `pysrc/` for their accuracy in future. This is therefore relevant to Issue #214... If changes are made there, then some of the text in `random.py` will need to change.

2. It turns out that you cannot add the docstrings for instance methods post hoc in this way as you can for class docstrings. This is described (with an example) in the notes to commit 738b647. I therefore added a "Methods" section to each class docstring in `random.py`, explaining how to read the dox either using the Python interpreter or via looking directly into `pysrc/Random.cpp`. This is in fact what needs to be updated if #214 changes the Boost wrapper locations.

Comments / direct edits most welcome.