Menu

#2845 three completions wants

nextrelease
open-fixed
nobody
None
5
2 days ago
4 days ago
No

There's another ticket of wants for completions, but I should keep these small and closable:

  1. code fragment for "assert isinstance( p, Plot )"
  2. p,pe= plot(...) will assign the type Plot to p and PlotElement to pe
  3. p.getController().<t> results in "name error: p"</t>

Discussion

  • Jeremy Faden

    Jeremy Faden - 4 days ago

    item 4. from org.das2.graph import Das<t> doesn't show DasAxis as a completion.</t>

     

    Last edit: Jeremy Faden 3 days ago
  • Jeremy Faden

    Jeremy Faden - 3 days ago

    (1) is added. (2) appears to be handled already.

     
  • Jeremy Faden

    Jeremy Faden - 3 days ago

    (3) is kludged in

     
  • Jeremy Faden

    Jeremy Faden - 3 days ago

    I'm not sure what's going on with (4). I looked at the code which looks for the symbols and the code looks clean. Actually there are two relevant paths:

    from org.das2.graph import Das<T>
    org.das2.graph import Das<T>
    

    The first path works properly and sees the symbol, but the second doesn't.

     

    Last edit: Jeremy Faden 3 days ago
  • Jeremy Faden

    Jeremy Faden - 2 days ago

    Okay, the problem is with Jython, where it doesn't know about the symbol DasAxis unless someone has told it. If I first import the symbol then run the code:

    targetComponents = 'org.das2.graph'.split('.')
    base = targetComponents[0]
    baseModule = __import__(base, globals(), locals())
    module = baseModule    
    for component in targetComponents[1:]:
        module = getattr(module, component)
    list = dir(module)
    

    (which is what is used for completions) it does see the symbol. So I think the fix is to also look at the giant list of imports to see if there are other known imports.

     
  • Jeremy Faden

    Jeremy Faden - 2 days ago

    This is fixed by importing the known names before querying the module.

     
  • Jeremy Faden

    Jeremy Faden - 2 days ago
    • status: open --> open-fixed