rs-station / reciprocalspaceship

Tools for exploring reciprocal space
https://rs-station.github.io/reciprocalspaceship/
MIT License
28 stars 11 forks source link

Missing function call signature from Jedi-VIM autocomplete library #168

Closed kmdalton closed 2 years ago

kmdalton commented 2 years ago

I have noticed that function parameters for the docstrings in rs are often just the generic *args,**kwargs when viewed in the Jedi-VIM autocomplete plugin.
image

I suspect this issue would also apply to parameter strings in Jupyter, but I haven't checked yet. I wonder if this has something to do with the cellify and spacegroupify decorators.

kmdalton commented 2 years ago

I just checked. It looks good in Jupyter-lab / Ipython. Not sure what to make of this.

I fully acknowledge that this could be on vim or jedi or (gasp!) me.

kmdalton commented 2 years ago

After re-installing Jedi, I, get the following traceback when I try to visit the documentation for generate_reciprocal_{asu,cell}:

Traceback (most recent call last):                                                                                                          
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/cache.py", line 109, in wrapper                                               
    try:                                                                                                                                    
KeyError: ((), frozenset({('resolve_stars', True)}))                                                                                        
During handling of the above exception, another exception occurred:                                                                         
Traceback (most recent call last):                                                                                                          
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi_vim.py", line 194, in wrapper                                                      
    def wrapper(*args, **kwargs):                                                                                                           
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi_vim.py", line 736, in show_documentation                                           
    win = vim.current.window                                                                                                                
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/api/classes.py", line 304, in docstring                                       
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/api/classes.py", line 314, in _get_docstring_signature                        
    def _get_docstring_signature(self):                                                                                                     
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/api/classes.py", line 315, in <genexpr>                                       
    return '\n'.join(                                                                                                                       
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/signature.py", line 30, in to_string                                
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/signature.py", line 12, in param_strings                            
    is_kw_only = False                                                                                                                      
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/cache.py", line 111, in wrapper                                               
    except KeyError:                                                                                                                        
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/signature.py", line 96, in get_param_names                          
    from jedi.inference.star_args import process_params                                                                                     
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/utils.py", line 20, in wrapper                                      
    def to_tuple(func):                                                                                                                     
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/star_args.py", line 157, in process_params                          
    found_kwarg_signature = True                                                                                                            
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/star_args.py", line 80, in _remove_given_params                     
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/arguments.py", line 191, in unpack                                  
    )                                                                                                                                       
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/arguments.py", line 315, in _iterate_star_args                      
    iter_ = array.py__iter__                                                                                                                
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/base_value.py", line 80, in py__getattribute__                      
    """                                                                                                                                     
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/base_value.py", line 69, in goto                                    
    def goto(self, name_or_str, name_context=None, analysis_errors=True):                                                                   
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/finder.py", line 35, in filter_name                                 
    for filter in filters:                                                                                                                  
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/base_value.py", line 57, in _get_value_filters                      
    for lazy_value in self.iterate(contextualized_node, is_async)                                                                           
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/filters.py", line 333, in get_filters                               
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/value/instance.py", line 179, in get_filters                        
    )                                                                                                                                       
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/value/instance.py", line 358, in get_annotated_class_object         
    if v.array_type == 'dict'                                                                                                               
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/cache.py", line 44, in wrapper                                      
    rv = function(obj, *args, **kwargs)                                                                                                     
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/value/instance.py", line 337, in _get_annotated_class_object        
    all_annotations = py__annotations__(funcdef)                                                                                            
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/base_value.py", line 80, in py__getattribute__                      
    """                                                                                                                                     
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/base_value.py", line 69, in goto                                    
    def goto(self, name_or_str, name_context=None, analysis_errors=True):                                                                   
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/finder.py", line 35, in filter_name                                 
    for filter in filters:                                                                                                                  
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/base_value.py", line 57, in _get_value_filters                      
    for lazy_value in self.iterate(contextualized_node, is_async)                                                                           
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/value/klass.py", line 200, in get_filters                           
    mro.append(cls_new)                                                                                                                     
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/value/klass.py", line 200, in get_filters                           
    mro.append(cls_new)                                                                                                                     
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/value/klass.py", line 200, in get_filters                           
    mro.append(cls_new)                                                                                                                     
  [Previous line repeated 2961 more times]                                                                                                  
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/value/klass.py", line 198, in get_filters                           
    for cls_new in mro_method():                                                                                                            
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/cache.py", line 92, in wrapper                                      
    cache = obj.inference_state.memoize_cache                                                                                               
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/base_value.py", line 333, in __getattr__                            
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/inference/utils.py", line 75, in wrapper                                      
    self.pushes = []                                                                                                                        
  File "/home/kmdalton/.vim/bundle/jedi-vim/pythonx/jedi/jedi/cache.py", line 105, in wrapper                                               
    def wrapper(self, *args, **kwargs):                                                                                                     
RecursionError: maximum recursion depth exceeded while calling a Python object                                                              
kmdalton commented 2 years ago

I now think this is most likely an issue with jedi. I'm going to close this, do some more research, and raise the issue where appropriate.