JPLMLIA / pdsc

Planetary Data System Coincidences
https://jplmlia.github.io/pdsc/
Other
3 stars 2 forks source link

"import pdsc" is broken with latest scikit-learn==1.3.2 #47

Open stevenlujpl opened 1 year ago

stevenlujpl commented 1 year ago

Hi @garydoranjr, it seems import pdsc is broken with the latest scikit-learn==1.3.2. Please see the error message below:

>>> import sklearn
>>> sklearn.__version__
'1.3.2'
>>> from sklearn.neighbors import DistanceMetric
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'DistanceMetric' from 'sklearn.neighbors' (/gpfs/scratch/suds-martian-frost/visible_deployment/frost_env/lib/python3.12/site-packages/sklearn/neighbors/__init__.py)

I checked the scikit-learn release notes (please search for DistanceMetric to see relevant notes). It looks like DistanceMetric was moved from the neighbors to the metrics package in v1.3. I think we may want to consider either updating the import statement (i.e., change the import statement from from sklearn.neighbors import DistanceMetric to from sklearn.metrics import DistanceMetric) or updating the setup.py to restrict the sklearn's version to be <=1.2.2.