[Numpy-discussion] defmatrix move - new docstrings disappeared

Pauli Virtanen pav@iki...
Thu Sep 17 12:48:57 CDT 2009


to, 2009-09-17 kello 11:21 -0400, Ralf Gommers kirjoitti:
> After the recent move of the matrix module, all the changes to the
> docstrings have disappeared from the doc wiki. I imagine the changes
> still live somewhere in the underlying repo but are not visible to the
> user. Can they be restored? If there is some unforeseen problem with
> that, I do have a recent patch saved that contains the latest edits
> (but of course it won't apply cleanly).

They are not lost (the app is designed so that things are not easily
lost), and can be found by writing the old full URL:

        http://docs.scipy.org/numpy/docs/numpy.core.defmatrix/

The easiest way to make the transition is to copy the docstrings via SQL
on the server.

I just copied the numpy.core.defmatrix.* docstring revisions and
comments to numpy.matrx.defmatrix.*. For reference, it can be done with
two SQL statements on the database:

        insert or ignore into docweb_docstringrevision
        (docstring_id, text, author, comment, timestamp, review, ok_to_apply)
        select
          'numpy.matrx.defmatrix' || substr(docstring_id, 21, length(docstring_id)),
          text, author, comment, timestamp, review, ok_to_apply
        from docweb_docstringrevision
        where docstring_id like 'numpy.core.defmatrix%';

        insert or ignore into docweb_reviewcomment
        (docstring_id, text, author, timestamp, resolved) 
        select
          'numpy.matrx.defmatrix' || substr(docstring_id, 21, length(docstring_id)),
          text, author, timestamp, resolved
        from docweb_reviewcomment
        where docstring_id like 'numpy.core.defmatrix%';

Moving would have been two one-liners, but copying maybe better conforms
to the append-only policy. Also, the sqlite version on the server
doesn't support a replace() function, yuck.

I think everything should be OK now -- please let me know if something
is broken.

> I saved that patch from the wiki because I was worried about the large
> number of unmerged changes, there are about 500 docstrings with
> changes right now (close to 50% of all important docstrings). Would it
> make sense to make sure (maybe with an automatic reminder email) that
> changes from the wiki get merged if there are enough changes - 100
> changed docstrings or changes older than two months, say?

I'll put the following to my crontab, let's see if it helps...

        15 14 * * sun	test `wget -q -O- 'http://docs.scipy.org/numpy/patch/' | grep -c '<tr>'` -lt 100 || echo "Hey man, lots of stuff is waiting at http://docs.scipy.org/numpy/patch/" | mail -s "Lots o' Stuff waiting in Pydocweb" pauli@localhost

Anyone else with SVN commit access is welcome to do similarly :)

> I know it is quite a bit of work to do the merge. I remember Pauli
> saying that most of the work was reviewing all changes to make sure
> they are an improvement over the current svn version. Is that correct?
> I can help with that if necessary.

You have reviewer rights, so you can go and click the "OK to apply"
buttons, to flag those changes that are better than SVN.

Also, check that no unwanted or dangerous code (eg. careless handling of
temporary files, etc) is added to the examples -- they may eventually be
executed after committed to SVN.

-- 
Pauli Virtanen





More information about the NumPy-Discussion mailing list