Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.py #339

Merged
merged 3 commits into from
Nov 2, 2022
Merged

Update index.py #339

merged 3 commits into from
Nov 2, 2022

Conversation

seanmacavaney
Copy link
Collaborator

Keep IterDictIndexerBase around for backwards compatibility

prevents errors like:

Traceback (most recent call last):                                                                                                                                                    
  File "example.py", line 5, in <module>                                                                                                                                              
    from odis import Prf, ElectraScorer, LexDistil, DirectIndex                                                                                                                       
  File "/home/sean/ws/odis/odis/__init__.py", line 3, in <module>                                                                                                                     
    from .lexdistil import LexDistil                                                                                                                                                  
  File "/home/sean/ws/odis/odis/lexdistil.py", line 8, in <module>                                                                                                                    
    from pyterrier_dr import DocnoFile                                                                                                                                                
  File "/home/sean/miniconda3/envs/py37/lib/python3.7/site-packages/pyterrier_dr/__init__.py", line 1, in <module>                                 
    from .indexes import DocnoFile, NilIndex, NumpyIndex, RankedLists, FaissFlat, FaissHnsw, MemIndex, TorchIndex                                      
  File "/home/sean/miniconda3/envs/py37/lib/python3.7/site-packages/pyterrier_dr/indexes.py", line 114, in <module>                                                 
    class NilIndex(pt.index.IterDictIndexerBase):                                                                                                                                     
AttributeError: module 'pyterrier.index' has no attribute 'IterDictIndexerBase'                                                                                                       

Copy link
Contributor

@cmacdonald cmacdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a Deprecated annotation?

@seanmacavaney
Copy link
Collaborator Author

Good call, updated

@cmacdonald cmacdonald added this to the 0.9 milestone Nov 2, 2022
@seanmacavaney seanmacavaney merged commit 042cb8d into master Nov 2, 2022
@seanmacavaney seanmacavaney deleted the seanmacavaney-patch-1 branch November 2, 2022 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants