jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.9k stars 262 forks source link

'Lambda' object has no attribute 'get_subscope_by_name' #840

Open jasontrigg0 opened 8 years ago

jasontrigg0 commented 8 years ago

Error Message

'Lambda' object has no attribute 'get_subscope_by_name'

Configuration

Virtualenv........: None RPC Python........: 2.7.10 (/usr/bin/python) Interactive Python: python (/usr/bin/python) Emacs.............: 24.5.1 Elpy..............: 1.11.0 Jedi..............: 0.9.0 Rope..............: Not found (0.10.3 available) Importmagic.......: Not found (0.1.7 available) Autopep8..........: Not found (1.2.2 available) Yapf..............: Not found (0.6.3 available) Syntax checker....: Not found (pyflakes)

Traceback

Traceback (most recent call last): File "/home/jtrigg/.emacs.d/elpa/elpy-20160131.118/elpy/jedibackend.py", line 341, in run_with_debug return getattr(script, name)() File "/usr/local/lib/python2.7/dist-packages/jedi/api/init.py", line 197, in completions for p in call_sig.params: File "/usr/local/lib/python2.7/dist-packages/jedi/evaluate/cache.py", line 41, in wrapper rv = function(obj, _args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/jedi/api/classes.py", line 348, in params sub = followed.get_subscope_by_name('init') File "/usr/local/lib/python2.7/dist-packages/jedi/evaluate/representation.py", line 563, in getattr return getattr(self.base_func, name) AttributeError: 'Lambda' object has no attribute 'get_subscope_by_name'

Jedi Debug Information

[N] dbg: Parsed /home/jtrigg/github/mysize_shopping/start_python/start/jeans_pca.py, with 0 parsers in 9 splits. [W] warning: No statement under the cursor. [N] dbg: execute: <CompiledObject: <type 'str'>> <Arguments: ()> [N] dbg: execute: <InstanceElement of <eFunction of <Function: init@238-242>>> <Arguments: ()> [N] dbg: execute result: [] in <InstanceElement of <eFunction of <Function: init@238-242>>> [N] dbg: execute result: [<eInstance of <CompiledObject: <type 'str'>>(<Arguments: ()>)>] in <CompiledObject: <type 'str'>> [N] dbg: eval_element Node(power, [<Name: pipe@57,10>, Node(trailer, [<Operator: .>, <Name: transform@57,15>])])@(57, 10) [N] dbg: finder.filter_name "<Name: pipe@57,10>" in (<eFunction of <Function: fit_pca@46-63>>): u'[<Name: pipe@49,4>]'@(57, 10) [N] dbg: eval_statement <ExprStmt: pipe = sklearn.pipeline.Pipeline([("scaler", sklearn.preprocessing.StandardScaler()), ('pca', sklearn.decomposition.RandomizedPCA(NUM_COMPONENTS))])@49,4> (<Name: pipe@49,4>) [N] dbg: eval_element Node(power, [<Name: sklearn@49,11>, Node(trailer, [<Operator: .>, <Name: pipeline@49,19>]), Node(trailer, [<Operator: .>, <Name: Pipeline@49,28>]), Node(trailer, [<Operator: (>, Node(atom, [<Operator: [>, Node(testlist_comp, [Node(atom, [<Operator: (>, Node(testlist_comp, [<String: "scaler">, <Operator: ,>, Node(power, [<Name: sklearn@49,49>, Node(trailer, [<Operator: .>, <Name: preprocessing@49,57>]), Node(trailer, [<Operator: .>, <Name: StandardScaler@49,71>]), Node(trailer, [<Operator: (>, <Operator: )>])])]), <Operator: )>]), <Operator: ,>, Node(atom, [<Operator: (>, Node(testlist_comp, [<String: 'pca'>, <Operator: ,>, Node(power, [<Name: sklearn@49,98>, Node(trailer, [<Operator: .>, <Name: decomposition@49,106>]), Node(trailer, [<Operator: .>, <Name: RandomizedPCA@49,120>]), Node(trailer, [<Operator: (>, <Name: NUM_COMPONENTS@49,134>, <Operator: )>])])]), <Operator: )>])]), <Operator: ]>]), <Operator: )>])])@(49, 11) [N] dbg: finder.filter_name "<Name: sklearn@49,11>" in (<eFunction of <Function: fit_pca@46-63>>): u'[<Name: sklearn@12,7>]'@(49, 4) [N] dbg: search_module 'sklearn' in u'/home/jtrigg/github/mysize_shopping/start_python/start/jeans_pca.py' [N] dbg: after import: [<ModuleWrapper: <fast.FastModule: sklearn@1-88>>] [N] dbg: finder._names_to_types: [<Name: sklearn@12,7>] -> [<ModuleWrapper: <fast.FastModule: sklearn@1-88>>] [N] dbg: eval_trailer: Node(trailer, [<Operator: .>, <Name: pipeline@49,19>]) in scope <ModuleWrapper: <fast.FastModule: sklearn@1-88>> [N] dbg: finder.filter_name "<Name: pipeline@49,19>" in (<ModuleWrapper: <fast.FastModule: sklearn@1-88>>): u'[<FakeName: pipeline@0,0>]'@None [N] dbg: search_module 'sklearn.pipeline' in paths ['/usr/local/lib/python2.7/dist-packages/scikit_learn-0.17-py2.7-linux-x86_64.egg/sklearn'] [N] dbg: after import: [<ModuleWrapper: <fast.FastModule: pipeline@1-575>>] [N] dbg: finder._names_to_types: [<FakeName: pipeline@0,0>] -> [<ModuleWrapper: <fast.FastModule: pipeline@1-575>>] [N] dbg: eval_trailer: Node(trailer, [<Operator: .>, <Name: Pipeline@49,28>]) in scope <ModuleWrapper: <fast.FastModule: pipeline@1-575>> [N] dbg: finder.filter_name "<Name: Pipeline@49,28>" in (<ModuleWrapper: <fast.FastModule: pipeline@1-575>>): u'[<Name: Pipeline@28,6>]'@None [N] dbg: finder._names_to_types: [<FakeName: Pipeline@28,6>] -> [<eClass of <Class: Pipeline@28-347>>] [N] dbg: eval_trailer: Node(trailer, [<Operator: (>, Node(atom, [<Operator: [>, Node(testlist_comp, [Node(atom, [<Operator: (>, Node(testlist_comp, [<String: "scaler">, <Operator: ,>, Node(power, [<Name: sklearn@49,49>, Node(trailer, [<Operator: .>, <Name: preprocessing@49,57>]), Node(trailer, [<Operator: .>, <Name: StandardScaler@49,71>]), Node(trailer, [<Operator: (>, <Operator: )>])])]), <Operator: )>]), <Operator: ,>, Node(atom, [<Operator: (>, Node(testlist_comp, [<String: 'pca'>, <Operator: ,>, Node(power, [<Name: sklearn@49,98>, Node(trailer, [<Operator: .>, <Name: decomposition@49,106>]), Node(trailer, [<Operator: .>, <Name: RandomizedPCA@49,120>]), Node(trailer, [<Operator: (>, <Name: NUM_COMPONENTS@49,134>, <Operator: )>])])]), <Operator: )>])]), <Operator: ]>]), <Operator: )>]) in scope <eClass of <Class: Pipeline@28-347>> [N] dbg: execute: <eClass of <Class: Pipeline@28-347>> <Arguments: Node(atom, [<Operator: [>, Node(testlist_comp, [Node(atom, [<Operator: (>, Node(testlist_comp, [<String: "scaler">, <Operator: ,>, Node(power, [<Name: sklearn@49,49>, Node(trailer, [<Operator: .>, <Name: preprocessing@49,57>]), Node(trailer, [<Operator: .>, <Name: StandardScaler@49,71>]), Node(trailer, [<Operator: (>, <Operator: )>])])]), <Operator: )>]), <Operator: ,>, Node(atom, [<Operator: (>, Node(testlist_comp, [<String: 'pca'>, <Operator: ,>, Node(power, [<Name: sklearn@49,98>, Node(trailer, [<Operator: .>, <Name: decomposition@49,106>]), Node(trailer, [<Operator: .>, <Name: RandomizedPCA@49,120>]), Node(trailer, [<Operator: (>, <Name: NUM_COMPONENTS@49,134>, <Operator: )>])])]), <Operator: )>])]), <Operator: ]>])> [N] dbg: eval_element <Name: BaseEstimator@28,15>@(28, 15) [N] dbg: finder.filter_name "<Name: BaseEstimator@28,15>" in (<eClass of <Class: Pipeline@28-347>>): u'[<Name: BaseEstimator@18,18>]'@(28, 15) [N] dbg: search_module 'sklearn.base' in paths ['/usr/local/lib/python2.7/dist-packages/scikit_learn-0.17-py2.7-linux-x86_64.egg/sklearn'] [N] dbg: finder.filter_name "u'BaseEstimator'" in (<ModuleWrapper: <fast.FastModule: base@1-477>>): u'[<Name: BaseEstimator@162,6>]'@None [N] dbg: finder._names_to_types: [<FakeName: BaseEstimator@162,6>] -> [<eClass of <Class: BaseEstimator@162-281>>] [N] dbg: after import: [<eClass of <Class: BaseEstimator@162-281>>] [N] dbg: finder._names_to_types: [<Name: BaseEstimator@18,18>] -> [<eClass of <Class: BaseEstimator@162-281>>] [N] dbg: eval_element <Name: object@162,20>@(162, 20) [N] dbg: finder.filter_name "<Name: object@162,20>" in (<eClass of <Class: BaseEstimator@162-281>>): u'[<CompiledName: (builtin).object>]'@(162, 20) [N] dbg: finder._names_to_types: [<CompiledName: (builtin).object>] -> [<CompiledObject: <type 'object'>>] [N] dbg: execute: <InstanceElement of <eFunction of <Function: init@89-111>>> <Arguments: Node(atom, [<Operator: [>, Node(testlist_comp, [Node(atom, [<Operator: (>, Node(testlist_comp, [<String: "scaler">, <Operator: ,>, Node(power, [<Name: sklearn@49,49>, Node(trailer, [<Operator: .>, <Name: preprocessing@49,57>]), Node(trailer, [<Operator: .>, <Name: StandardScaler@49,71>]), Node(trailer, [<Operator: (>, <Operator: )>])])]), <Operator: )>]), <Operator: ,>, Node(atom, [<Operator: (>, Node(testlist_comp, [<String: 'pca'>, <Operator: ,>, Node(power, [<Name: sklearn@49,98>, Node(trailer, [<Operator: .>, <Name: decomposition@49,106>]), Node(trailer, [<Operator: .>, <Name: RandomizedPCA@49,120>]), Node(trailer, [<Operator: (>, <Name: NUM_COMPONENTS@49,134>, <Operator: )>])])]), <Operator: )>])]), <Operator: ]>])> [N] dbg: execute result: [] in <InstanceElement of <eFunction of <Function: init@89-111>>> [N] dbg: execute result: [<eInstance of <eClass of <Class: Pipeline@28-347>>(<Arguments: Node(atom, [<Operator: [>, Node(testlist_comp, [Node(atom, [<Operator: (>, Node(testlist_comp, [<String: "scaler">, <Operator: ,>, Node(power, [<Name: sklearn@49,49>, Node(trailer, [<Operator: .>, <Name: preprocessing@49,57>]), Node(trailer, [<Operator: .>, <Name: StandardScaler@49,71>]), Node(trailer, [<Operator: (>, <Operator: )>])])]), <Operator: )>]), <Operator: ,>, Node(atom, [<Operator: (>, Node(testlist_comp, [<String: 'pca'>, <Operator: ,>, Node(power, [<Name: sklearn@49,98>, Node(trailer, [<Operator: .>, <Name: decomposition@49,106>]), Node(trailer, [<Operator: .>, <Name: RandomizedPCA@49,120>]), Node(trailer, [<Operator: (>, <Name: NUM_COMPONENTS@49,134>, <Operator: )>])])]), <Operator: )>])]), <Operator: ]>])>)>] in <eClass of <Class: Pipeline@28-347>> [N] dbg: eval_statement result [<eInstance of <eClass of <Class: Pipeline@28-347>>(<Arguments: Node(atom, [<Operator: [>, Node(testlist_comp, [Node(atom, [<Operator: (>, Node(testlist_comp, [<String: "scaler">, <Operator: ,>, Node(power, [<Name: sklearn@49,49>, Node(trailer, [<Operator: .>, <Name: preprocessing@49,57>]), Node(trailer, [<Operator: .>, <Name: StandardScaler@49,71>]), Node(trailer, [<Operator: (>, <Operator: )>])])]), <Operator: )>]), <Operator: ,>, Node(atom, [<Operator: (>, Node(testlist_comp, [<String: 'pca'>, <Operator: ,>, Node(power, [<Name: sklearn@49,98>, Node(trailer, [<Operator: .>, <Name: decomposition@49,106>]), Node(trailer, [<Operator: .>, <Name: RandomizedPCA@49,120>]), Node(trailer, [<Operator: (>, <Name: NUM_COMPONENTS@49,134>, <Operator: )>])])]), <Operator: )>])]), <Operator: ]>])>)>] [N] dbg: finder._names_to_types: [<Name: pipe@49,4>] -> [<eInstance of <eClass of <Class: Pipeline@28-347>>(<Arguments: Node(atom, [<Operator: [>, Node(testlist_comp, [Node(atom, [<Operator: (>, Node(testlist_comp, [<String: "scaler">, <Operator: ,>, Node(power, [<Name: sklearn@49,49>, Node(trailer, [<Operator: .>, <Name: preprocessing@49,57>]), Node(trailer, [<Operator: .>, <Name: StandardScaler@49,71>]), Node(trailer, [<Operator: (>, <Operator: )>])])]), <Operator: )>]), <Operator: ,>, Node(atom, [<Operator: (>, Node(testlist_comp, [<String: 'pca'>, <Operator: ,>, Node(power, [<Name: sklearn@49,98>, Node(trailer, [<Operator: .>, <Name: decomposition@49,106>]), Node(trailer, [<Operator: .>, <Name: RandomizedPCA@49,120>]), Node(trailer, [<Operator: (>, <Name: NUM_COMPONENTS@49,134>, <Operator: )>])])]), <Operator: )>])]), <Operator: ]>])>)>] [N] dbg: eval_trailer: Node(trailer, [<Operator: .>, <Name: transform@57,15>]) in scope <eInstance of <eClass of <Class: Pipeline@28-347>>(<Arguments: Node(atom, [<Operator: [>, Node(testlist_comp, [Node(atom, [<Operator: (>, Node(testlist_comp, [<String: "scaler">, <Operator: ,>, Node(power, [<Name: sklearn@49,49>, Node(trailer, [<Operator: .>, <Name: preprocessing@49,57>]), Node(trailer, [<Operator: .>, <Name: StandardScaler@49,71>]), Node(trailer, [<Operator: (>, <Operator: )>])])]), <Operator: )>]), <Operator: ,>, Node(atom, [<Operator: (>, Node(testlist_comp, [<String: 'pca'>, <Operator: ,>, Node(power, [<Name: sklearn@49,98>, Node(trailer, [<Operator: .>, <Name: decomposition@49,106>]), Node(trailer, [<Operator: .>, <Name: RandomizedPCA@49,120>]), Node(trailer, [<Operator: (>, <Name: NUM_COMPONENTS@49,134>, <Operator: )>])])]), <Operator: )>])]), <Operator: ]>])>)> [N] dbg: execute: <eClass of <Class: BaseEstimator@162-281>> <Arguments: ()> [N] dbg: execute result: [<eInstance of <eClass of <Class: BaseEstimator@162-281>>(<Arguments: ()>)>] in <eClass of <Class: BaseEstimator@162-281>> [N] dbg: finder.filter_name "<Name: transform@57,15>" in (<eInstance of <eClass of <Class: Pipeline@28-347>>(<Arguments: Node(atom, [<Operator: [>, Node(testlist_comp, [Node(atom, [<Operator: (>, Node(testlist_comp, [<String: "scaler">, <Operator: ,>, Node(power, [<Name: sklearn@49,49>, Node(trailer, [<Operator: .>, <Name: preprocessing@49,57>]), Node(trailer, [<Operator: .>, <Name: StandardScaler@49,71>]), Node(trailer, [<Operator: (>, <Operator: )>])])]), <Operator: )>]), <Operator: ,>, Node(atom, [<Operator: (>, Node(testlist_comp, [<String: 'pca'>, <Operator: ,>, Node(power, [<Name: sklearn@49,98>, Node(trailer, [<Operator: .>, <Name: decomposition@49,106>]), Node(trailer, [<Operator: .>, <Name: RandomizedPCA@49,120>]), Node(trailer, [<Operator: (>, <Name: NUM_COMPONENTS@49,134>, <Operator: )>])])]), <Operator: )>])]), <Operator: ]>])>)>): u'[<InstanceName: transform@278,8>]'@None [N] dbg: decorator: <Decorator: @if_delegate_has_method(delegate='_final_estimator') @277,4> <Function: transform@278-294> [N] dbg: eval_element <Name: if_delegate_has_method@277,5>@(277, 5) [N] dbg: finder.filter_name "<Name: if_delegate_has_method@277,5>" in (<eClass of <Class: Pipeline@28-347>>): u'[<Name: if_delegate_has_method@22,34>]'@(277, 5) [N] dbg: search_module 'sklearn.utils' in paths ['/usr/local/lib/python2.7/dist-packages/scikit_learn-0.17-py2.7-linux-x86_64.egg/sklearn'] [N] dbg: search_module 'sklearn.utils.metaestimators' in paths ['/usr/local/lib/python2.7/dist-packages/scikit_learn-0.17-py2.7-linux-x86_64.egg/sklearn/utils'] [N] dbg: finder.filter_name "u'if_delegate_has_method'" in (<ModuleWrapper: <fast.FastModule: metaestimators@1-73>>): u'[<Name: if_delegate_has_method@43,4>]'@None [N] dbg: finder._names_to_types: [<FakeName: if_delegate_has_method@43,4>] -> [<eFunction of <Function: if_delegate_has_method@43-73>>] [N] dbg: after import: [<eFunction of <Function: if_delegate_has_method@43-73>>] [N] dbg: finder._names_to_types: [<Name: if_delegate_has_method@22,34>] -> [<eFunction of <Function: if_delegate_has_method@43-73>>] [N] dbg: eval_trailer: Node(trailer, [<Operator: (>, Node(argument, [<Name: delegate@277,28>, <Operator: =>, <String: '_final_estimator'>]), <Operator: )>]) in scope <eFunction of <Function: if_delegate_has_method@43-73>> [N] dbg: execute: <eFunction of <Function: if_delegate_has_method@43-73>> <Arguments: Node(argument, [<Name: delegate@277,28>, <Operator: =>, <String: '_final_estimator'>])> [N] dbg: eval_element <Lambda@(72, 11)>@(72, 11) [N] dbg: Return reachable: <ReturnStmt: return lambda fn: _IffHasAttrDescriptor(fn, '%s.%s' % (delegate, fn.name))@72,4> [N] dbg: execute result: [<eLambdaWrapper of <Lambda@(72, 11)>>] in <eFunction of <Function: if_delegate_has_method@43-73>> [N] dbg: execute: <eLambdaWrapper of <Lambda@(72, 11)>> <Arguments: [AlreadyEvaluated([<eFunction of <Function: transform@278-294>>])]> [N] dbg: eval_element Node(power, [<Name: _IffHasAttrDescriptor@72,22>, Node(trailer, [<Operator: (>, Node(arglist, [<Name: fn@72,44>, <Operator: ,>, Node(term, [<String: '%s.%s'>, <Operator: %>, Node(atom, [<Operator: (>, Node(testlist_comp, [<Name: delegate@72,59>, <Operator: ,>, Node(power, [<Name: fn@72,69>, Node(trailer, [<Operator: .>, <Name: name@72,72>])])]), <Operator: )>])])]), <Operator: )>])])@(72, 22) [N] dbg: finder.filter_name "<Name: _IffHasAttrDescriptor@72,22>" in (<FunctionExecution of <eLambdaWrapper of <Lambda@(72, 11)>>>): u'[<Name: _IffHasAttrDescriptor@13,6>]'@(72, 22) [N] dbg: finder._names_to_types: [<FakeName: _IffHasAttrDescriptor@13,6>] -> [<eClass of <Class: _IffHasAttrDescriptor@13-43>>] [N] dbg: eval_trailer: Node(trailer, [<Operator: (>, Node(arglist, [<Name: fn@72,44>, <Operator: ,>, Node(term, [<String: '%s.%s'>, <Operator: %>, Node(atom, [<Operator: (>, Node(testlist_comp, [<Name: delegate@72,59>, <Operator: ,>, Node(power, [<Name: fn@72,69>, Node(trailer, [<Operator: .>, <Name: name@72,72>])])]), <Operator: )>])])]), <Operator: )>]) in scope <eClass of <Class: _IffHasAttrDescriptor@13-43>> [N] dbg: execute: <eClass of <Class: _IffHasAttrDescriptor@13-43>> <Arguments: Node(arglist, [<Name: fn@72,44>, <Operator: ,>, Node(term, [<String: '%s.%s'>, <Operator: %>, Node(atom, [<Operator: (>, Node(testlist_comp, [<Name: delegate@72,59>, <Operator: ,>, Node(power, [<Name: fn@72,69>, Node(trailer, [<Operator: .>, <Name: name@72,72>])])]), <Operator: )>])])])> [N] dbg: eval_element <Name: object@13,28>@(13, 28) [N] dbg: finder.filter_name "<Name: object@13,28>" in (<eClass of <Class: _IffHasAttrDescriptor@13-43>>): u'[<CompiledName: (builtin).object>]'@(13, 28) [N] dbg: finder._names_to_types: [<CompiledName: (builtin).object>] -> [<CompiledObject: <type 'object'>>] [N] dbg: execute: <InstanceElement of <eFunction of <Function: init@24-30>>> <Arguments: Node(arglist, [<Name: fn@72,44>, <Operator: ,>, Node(term, [<String: '%s.%s'>, <Operator: %>, Node(atom, [<Operator: (>, Node(testlist_comp, [<Name: delegate@72,59>, <Operator: ,>, Node(power, [<Name: fn@72,69>, Node(trailer, [<Operator: .>, <Name: name@72,72>])])]), <Operator: )>])])])> [N] dbg: execute result: [] in <InstanceElement of <eFunction of <Function: init@24-30>>> [N] dbg: execute result: [<eInstance of <eClass of <Class: _IffHasAttrDescriptor@13-43>>(<Arguments: Node(arglist, [<Name: fn@72,44>, <Operator: ,>, Node(term, [<String: '%s.%s'>, <Operator: %>, Node(atom, [<Operator: (>, Node(testlist_comp, [<Name: delegate@72,59>, <Operator: ,>, Node(power, [<Name: fn@72,69>, Node(trailer, [<Operator: .>, <Name: name@72,72>])])]), <Operator: )>])])])>)>] in <eClass of <Class: _IffHasAttrDescriptor@13-43>> [N] dbg: execute result: [<eInstance of <eClass of <Class: _IffHasAttrDescriptor@13-43>>(<Arguments: Node(arglist, [<Name: fn@72,44>, <Operator: ,>, Node(term, [<String: '%s.%s'>, <Operator: %>, Node(atom, [<Operator: (>, Node(testlist_comp, [<Name: delegate@72,59>, <Operator: ,>, Node(power, [<Name: fn@72,69>, Node(trailer, [<Operator: .>, <Name: name@72,72>])])]), <Operator: )>])])])>)>] in <eLambdaWrapper of <Lambda@(72, 11)>> [N] dbg: decorator end <eInstance of <eClass of <Class: _IffHasAttrDescriptor@13-43>>(<Arguments: Node(arglist, [<Name: fn@72,44>, <Operator: ,>, Node(term, [<String: '%s.%s'>, <Operator: %>, Node(atom, [<Operator: (>, Node(testlist_comp, [<Name: delegate@72,59>, <Operator: ,>, Node(power, [<Name: fn@72,69>, Node(trailer, [<Operator: .>, <Name: name@72,72>])])]), <Operator: )>])])])>) decorates <eFunction of <Function: transform@278-294>>> [N] dbg: execute: <InstanceElement of <eFunction of <Function: get@30-43>>> <Arguments: [AlreadyEvaluated([<eInstance of <eClass of <Class: Pipeline@28-347>>(<Arguments: Node(atom, [<Operator: [>, Node(testlist_comp, [Node(atom, [<Operator: (>, Node(testlist_comp, [<String: "scaler">, <Operator: ,>, Node(power, [<Name: sklearn@49,49>, Node(trailer, [<Operator: .>, <Name: preprocessing@49,57>]), Node(trailer, [<Operator: .>, <Name: StandardScaler@49,71>]), Node(trailer, [<Operator: (>, <Operator: )>])])]), <Operator: )>]), <Operator: ,>, Node(atom, [<Operator: (>, Node(testlist_comp, [<String: 'pca'>, <Operator: ,>, Node(power, [<Name: sklearn@49,98>, Node(trailer, [<Operator: .>, <Name: decomposition@49,106>]), Node(trailer, [<Operator: .>, <Name: RandomizedPCA@49,120>]), Node(trailer, [<Operator: (>, <Name: NUM_COMPONENTS@49,134>, <Operator: )>])])]), <Operator: )>])]), <Operator: ]>])>)>]), AlreadyEvaluated([<eClass of <Class: Pipeline@28-347>>])]> [N] dbg: eval_element <Name: out@40,15>@(40, 15) [N] dbg: finder.filter_name "<Name: out@40,15>" in (<FunctionExecution of <InstanceElement of <eFunction of <Function: get@30-43>>>>): u'[<Name: out@37,8>]'@(40, 15) [N] dbg: eval_statement <ExprStmt: # lambda, but not partial, allows help() to work with update_wrapper out = lambda *args, *kwargs: self.fn(obj, args, **kwargs)@37,8> (<Name: out@37,8>) [N] dbg: eval_element <Lambda@(37, 14)>@(37, 14) [N] dbg: eval_statement result [<eLambdaWrapper of <Lambda@(37, 14)>>] [N] dbg: finder._names_to_types: [<Name: out@37,8>] -> [<eLambdaWrapper of <Lambda@(37, 14)>>] [N] dbg: Return reachable: <ReturnStmt: return out@40,8> [N] dbg: execute result: [<eLambdaWrapper of <Lambda@(37, 14)>>] in <InstanceElement of <eFunction of <Function: get@30-43>>> [N] dbg: finder._names_to_types: [<InstanceName: transform@278,8>] -> [<eLambdaWrapper of <Lambda@(37, 14)>>]


Reproduction:

```Python
import jedi

source = '''\
#!/usr/bin/env python
import start.pysql
import start.utils
import urllib
import os.path
import argparse
import skimage.io
import sys
import numpy as np
import sklearn.pipeline
import sklearn.preprocessing
import sklearn.decomposition

logger = start.utils.Logger()
IMAGE_DIR = "/home/jtrigg/github/mysize_shopping/data/img"

def download_images():
    df = start.pysql.sql2df("SELECT image_url FROM start.product_variations pv WHERE image_url IS NOT NULL LIMIT 3000")
    df = df.drop_duplicates()
    df["image_url"].apply(get_img)

def get_img(url):
    img_name = url.split("/")[-1]
    out_file = IMAGE_DIR + "/" + img_name
    if not os.path.exists(out_file):
        urllib.urlretrieve(url, out_file)
    else:
        logger.debug("Duplicate image {}. Skipping...".format(img_name))

def load_all_images():
    flat_list = []
    d = None
    for f in os.listdir(IMAGE_DIR):
        img = skimage.io.imread(IMAGE_DIR + "/" + f)
        if not img.shape == (160,107,3):
            continue
        flat, dims = image2flat(img)
        flat_list.append(flat)
        d = dims
        # skimage.io.imshow(img)
        # skimage.io.show()
        # print img.shape
    return flat_list, d

def fit_pca(flat_list, dims):
    d1,d2,d3 = dims
    NUM_COMPONENTS = 5
    pipe = sklearn.pipeline.Pipeline([("scaler", sklearn.preprocessing.StandardScaler()), ('pca', sklearn.decomposition.RandomizedPCA(NUM_COMPONENTS))])
    pipe.fit(flat_list)
    pca_obj = pipe.named_steps["pca"]
    for c in pca_obj.components_:
        comp_img = flat2image(c, dims)
        # print comp_img
        # skimage.io.imshow(comp_img)
        # skimage.io.show()
    out = pipe.transform(fla
    projections = pipe.transform(flat_list).reshape((NUM_COMPONENTS, d1, d2, -1))
    for p in projections:
        skimage.io.imshow(p)
        skimage.io.show()

def image2flat(img):
    return np.reshape(img, (-1)), img.shape

def flat2image(flat, dims):
    return np.reshape(flat, dims)

def readCL():
    parser = argparse.ArgumentParser()
    parser.add_argument("-l","--log_level",default="INFO")
    args = parser.parse_args()
    return args.log_level

if __name__ == "__main__":
    log_level = readCL()
    logger.set(log_level)
    download_images()
    flat_list, dims = load_all_images()
    fit_pca(flat_list, dims)
'''

script = jedi.Script(column=28, source=source, line=57, encoding='utf-8', path=u'/home/jtrigg/github/mysize_shopping/start_python/start/jeans_pca.py')
script.completions()
jorgenschaefer commented 8 years ago

Hello, and thanks for the report! I thought this bug was fixed (#677), but apparently there are other places this can happen still. Damnit. :-) I hope to have a more general workaround for the next release.