You are here

Error when importing protocols.simple_filters

9 posts / 0 new
Last post
Error when importing protocols.simple_filters
#1

Hi,

I'm trying to access ddG filter in PyRosseta. But it seems that the simple_filters module is not implemented in current PyRosetta r51661, because the following errors occurred when I trying do so:

>>> from rosetta import *
>>> import rosetta.protocols.simple_filters

Traceback (most recent call last):
File "", line 1, in
import rosetta.protocols.simple_filters
File "D:\Program Files\PyRosetta\rosetta\protocols\simple_filters\__init__.py", line 1, in
from __simple_filters_all_at_once_ import *
RuntimeError: extension class wrapper for base class class protocols::evaluation::SingleValuePoseEvaluator has not been created yet

Just wondering if it is incorporated in the current release. If not, is there any way to rebuild PyRosetta myself to take it in?

Thanks!

Post Situation: 
Tue, 2012-10-16 13:37
xfliu

Hi,

Before you imported 'import rosetta.protocols.simple_filters' could you please try to 'import protocols.evaluation' and let me know if it fix the error?

Thanks,

Tue, 2012-10-16 13:44
Sergey

Hi Sergey,

Yes... It seems that I have to import the stuffs in protocols.evaluation first, for the dependence unknown to me. Here is how it finally worked:

>>> import rosetta.protocols.evaluation
>>> from rosetta.protocols.evaluation import *
>>> import rosetta.protocols.simple_filters
>>> dir(rosetta.protocols.simple_filters.DdgFilter)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__instance_size__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'apply', 'clear', 'clone', 'compute', 'fresh_instance', 'get_type', 'get_user_defined_name', 'name', 'parse_my_tag', 'relax_mover', 'repack', 'repeats', 'report', 'report_sm', 'set_user_defined_name']

Many thanks for the suggestion!

Tue, 2012-10-16 13:58
xfliu

Great! I will modify upstream package so such extra import will no longer needed.

Tue, 2012-10-16 16:19
Sergey

Hi Sergey,

I have tried again to see if it is possible to ignore such extra import and I found an interesting phenomenon:

>>> import rosetta.protocols.simple_filters
Traceback (most recent call last):
File "", line 1, in
import rosetta.protocols.simple_filters
File "D:\Program Files\PyRosetta\rosetta\protocols\simple_filters\__init__.py", line 1, in
from __simple_filters_all_at_once_ import *
RuntimeError: extension class wrapper for base class class protocols::evaluation::SingleValuePoseEvaluator has not been created yet
>>> import rosetta.protocols.simple_filters

It means that if I tried to import simple_filters directly, in the first time the runtime error popped up as usual. But when I import it again in the Python interactive IDE, no error occurred... Well it only works in the interactive IDE but not in the script because the running aborted when the first runtime popped up. Just for your information to patch this bug.

Cheers,

Wed, 2012-10-17 01:23
xfliu

Yes, this is expected behavior: basically what happened is that after first import Python mark module as 'imported' and silently skip second attempt to import, so the error is actually still there etc.

Wed, 2012-10-17 12:34
Sergey

Sorry Sergey, but is there any differences between different rosetta library versions in Pyrosetta? I can import DdgFilter in Windows Pyrosetta r46650, but I cannot import it in Linux Pyrosetta r51661. I have build a local Pyrosetta with the default setting along with Rosetta 3.4 release, but I cannot import DdgFilter, either... I really got confused...

Wed, 2012-10-17 02:28
xfliu

Yes, there is a difference in Rosetta library: each rosetta-lib is build using appropriate revision number so the all slightly different.

Regarding the DdgFilter: It possible that it got relocated to the different namespace. Please search the source code and see where exactly his class located now and the try import that location.

hope that helps,

Wed, 2012-10-17 16:32
Sergey

No luck. DdgFilter is still in src/protocols/simple_filters/DdgFilter.hh. It also claimed in src/protocols/protein_interface_design/dock_design_filters.hh. Unfortunately, this head file is not included in __protein_interface_design_all_at_once_.source.cc, so I cannot access it with protein_interface_design namespace.

Thu, 2012-10-18 06:16
xfliu