On Sep 9, 2008, at 12:42 PM, Rob Kirkpatrick wrote:
> Hi Guys,
>
> I've run into this error when trying to run some of Jenny's
> doctests. When I look in the code of sqlgraph.py", line 269 seems
> to be at the wrong indentation level. I get a new set of errors
> when I indent that line, so I'm not sure if this is part of my
> problem or not... Comments?
Hi Rob,
what makes you think line 269 is mis-indented? It looks right to me;
__init__() must always bind its itemClass as a subclass, which is what
self.objclass() does... Note that if itemClass is None,
self.objclass() just uses self.itemClass (typically provided by the
class definition).
more comments below...
>
>
> **********************************************************************
> File "/Users/Robby/pyensembl-0.1.0/build/lib/ensembl/adaptor.py",
> line 274, in ensembl.adaptor.ExonAdaptor
> Failed example:
> slice = coreDBAdaptor.fetch_slice_by_region('chromosome', '1',
> end=100000, strand = -1)
> Exception raised:
> Traceback (most recent call last):
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/doctest.py", line 1212, in __run
> compileflags, 1) in test.globs
> File "<doctest ensembl.adaptor.ExonAdaptor[5]>", line 1, in
> <module>
> slice = coreDBAdaptor.fetch_slice_by_region('chromosome',
> '1', end=100000, strand = -1)
> File "/Users/Robby/pyensembl-0.1.0/build/lib/ensembl/
> adaptor.py", line 688, in fetch_slice_by_region
> sr = self._get_seqregion()
> File "/Users/Robby/pyensembl-0.1.0/build/lib/ensembl/
> adaptor.py", line 584, in _get_seqregion
> seqRegion = self._create_seqregion()
> File "/Users/Robby/pyensembl-0.1.0/build/lib/ensembl/
> adaptor.py", line 565, in _create_seqregion
> dnaAdaptor = self.get_adaptor('dna')
> File "/Users/Robby/pyensembl-0.1.0/build/lib/ensembl/
> adaptor.py", line 460, in get_adaptor
> tbAdaptor = adaptorClass(name, itemClass=rowClass,
> serverInfo=self.conn)
> File "/Users/Robby/pyensembl-0.1.0/build/lib/ensembl/
> adaptor.py", line 214, in __init__
> sqlgraph.SQLTable.__init__(self, name,
> itemSliceClass=seqdb.SeqDBSlice, attrAlias=dict(seq='sequence'),
> **kwargs)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/pygr-0.7-py2.5-macosx-10.3-fat.egg/pygr/
> sqlgraph.py", line 269, in __init__
> self.objclass(itemClass) # NEED TO SUBCLASS OUR ITEM CLASS
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/pygr-0.7-py2.5-macosx-10.3-fat.egg/pygr/
> sqlgraph.py", line 352, in objclass
> subclassArgs=dict(db=self)) # bind itemClass
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/pygr-0.7-py2.5-macosx-10.3-fat.egg/pygr/
> classutil.py", line 217, in get_bound_subclass
> subclass_init(**subclassArgs)
> TypeError: unbound method _init_subclass() must be called with
> shadowClass instance as first argument (got nothing instead)
This error message seems to say that the itemClass has an
_init_subclass() attribute that is callable, but which has not been
"decorated" as a classmethod as it must be. For correct examples of
how to do this, see seqdb.FileDBSequence or sqlgraph.TupleO. I guess
I would need to scrutinize Jenny's rowClass code to verify if I'm
interpreting this right.
I don't see how this error could pass a test suite; it will die
whenever it tries to construct an instance of this table class. Is
this only happening on your computer, or does Jenny get the same error?
-- Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pygr-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---