Skip to content

Patches for pdf docs, Pyrex compatibility, dir()/help() fixes #1

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

balajis
Copy link

@balajis balajis commented Apr 19, 2011

Hi Chris,

I'm a friend of Titus' and made a few quick changes that significantly increased the out-of-the-box usability of pygr for me.

  1. 0fd4c47: enable creation of Pygr.pdf. Version 0.8.1 of the pdf docs happens to be the most downloaded file on the Pygr Google Code website, so I figured others would want this as well.
    • Added pdf target to Makefile
    • Fixed quotation of a few literals in rest/reference/{coordinator.rst,sequence.rst}
    • Indented ::doctest directives in tutorials/ucsc_ensemble.rst
    • Indentation of a stray paragraph was fixed in rest/guides/devguide.rst
    • tutorials/annotation and tutorials/compgenomics were added to rest/guidelist.rst, as they were missing from the table of contents tree
  2. e330c19: enable compatibility with Pyrex 0.9.9 by substituting cinit for new. Otherwise cdict.pyx refuses to compile at all.
  3. dd44816: added two lines to init.py to make dir(worldbase) and help(worldbase) work on Python 2.7.

With these changes, I think people should be able to run the tutorial "as is". Will tell you if that's not the case.

balajis added 3 commits April 19, 2011 06:02
Do ``cd doc; make`` and open ``doc/latex_new/Pygr.pdf``.
cnestedlist.pyx and cdict.py. Also updated .gitignore to exclude
build targets intervaldb.o and libnclist.a.

This patch fixes setup.py, which was giving the following output on
Mac OS X 10.6 (included below for those with the same error):

{{{
$ python setup.py --verbose build
running build
running build_py
not copying pygr/__init__.py (output up-to-date)
not copying pygr/annotation.py (output up-to-date)
not copying pygr/blast.py (output up-to-date)
not copying pygr/classutil.py (output up-to-date)
not copying pygr/coordinator.py (output up-to-date)
not copying pygr/Data.py (output up-to-date)
not copying pygr/dbfile.py (output up-to-date)
not copying pygr/downloader.py (output up-to-date)
not copying pygr/graphquery.py (output up-to-date)
not copying pygr/logger.py (output up-to-date)
not copying pygr/mapping.py (output up-to-date)
not copying pygr/metabase.py (output up-to-date)
not copying pygr/nlmsa_utils.py (output up-to-date)
not copying pygr/parse_blast.py (output up-to-date)
not copying pygr/schema.py (output up-to-date)
not copying pygr/seqdb.py (output up-to-date)
not copying pygr/sequence.py (output up-to-date)
not copying pygr/sequtil.py (output up-to-date)
not copying pygr/sqlgraph.py (output up-to-date)
not copying pygr/translationDB.py (output up-to-date)
not copying pygr/xnestedlist.py (output up-to-date)
not copying pygr/apps/__init__.py (output up-to-date)
not copying pygr/apps/catalog_downloads.py (output up-to-date)
not copying pygr/apps/leelabdb.py (output up-to-date)
not copying pygr/apps/maf2nclist.py (output up-to-date)
not copying pygr/apps/maf2VSgraph.py (output up-to-date)
not copying pygr/apps/seqref.py (output up-to-date)
not copying pygr/apps/splicegraph.py (output up-to-date)
not copying pygr/apps/ucsc_ensembl_annot.py (output up-to-date)
running build_ext
skipping 'pygr.seqfmt' extension (up-to-date)
pyrexc pygr/cdict.pyx --> pygr/cdict.c
~/pygr/pygr/cdict.pyx:95:4: __new__ method of extension type will change semantics in a future version of Pyrex. Use __cinit__ instead.
~/pygr/pygr/cdict.pyx:160:4: __new__ method of extension type will change semantics in a future version of Pyrex. Use __cinit__ instead.
~/pygr/pygr/cdict.pyx:212:4: __new__ method of extension type will change semantics in a future version of Pyrex. Use __cinit__ instead.
~/pygr/pygr/cdict.pyx:261:4: __new__ method of extension type will change semantics in a future version of Pyrex. Use __cinit__ instead.
~/pygr/pygr/cdict.pyx:407:4: __new__ method of extension type will change semantics in a future version of Pyrex. Use __cinit__ instead.
~/pygr/pygr/cdict.pyx:212:22: Warning: 'not None' will become the default in a future version of Pyrex. Use 'or None' to allow passing None.
building 'pygr.cdict' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pygr/cgraph.c -o build/temp.macosx-10.6-intel-2.7/pygr/cgraph.o
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pygr/cdict.c -o build/temp.macosx-10.6-intel-2.7/pygr/cdict.o
pygr/cdict.c:1:2: error: #error Do not use this file, it is the result of a failed Pyrex compilation.
pygr/cdict.c:1:2: error: #error Do not use this file, it is the result of a failed Pyrex compilation.
lipo: can't figure out the architecture type of: ~/tmp/ccWaoUlh.out
error: command 'gcc-4.2' failed with exit status 1
}}}

There is still a separate warning on the 'or None' argument:

{{{
$ python setup.py build --verbose
running build
running build_py
running build_ext
pyrexc pygr/cnestedlist.pyx --> pygr/cnestedlist.c
~/pygr/pygr/cnestedlist.pyx:167:42: Warning: 'not None' will become the default in a future version of Pyrex. Use 'or None' to allow passing None.
building 'pygr.cnestedlist' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pygr/intervaldb.c -o build/temp.macosx-10.6-intel-2.7/pygr/intervaldb.o
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pygr/cnestedlist.c -o build/temp.macosx-10.6-intel-2.7/pygr/cnestedlist.o
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pygr/apps/maf2nclist.c -o build/temp.macosx-10.6-intel-2.7/pygr/apps/maf2nclist.o
gcc-4.2 -arch i386 -arch x86_64 -isysroot / -g -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot / -g build/temp.macosx-10.6-intel-2.7/pygr/intervaldb.o build/temp.macosx-10.6-intel-2.7/pygr/cnestedlist.o build/temp.macosx-10.6-intel-2.7/pygr/apps/maf2nclist.o -o build/lib.macosx-10.6-intel-2.7/pygr/cnestedlist.so
}}}

Essentially, Pyrex has a transition period where every argument
needs to be explicitly declared with 'or None' or 'not None'.
This is because the default is currently 'or None', but it
will be changed to 'not None'. Explicit declarations will
work either way. See:

http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Release_Notes_0.9.9.html
…-the-box.

Root cause of the dir() issue was that defaultPath was not getting inspected, which broke expectations set by the tutorial.
Root cause of the help() issue is the __getattr__ method in ResourcePath, which did not return a string when asked for __name__ by the help method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant