VarIr / scikit-hubness

A Python package for hubness analysis and high-dimensional data mining
BSD 3-Clause "New" or "Revised" License
44 stars 9 forks source link

Does not work with latest numpy #110

Open clkruse opened 1 year ago

clkruse commented 1 year ago

It throws the following error when trying to import the skhubness package. AttributeError: module 'numpy' has no attribute 'float'

The float attribute seems to have been removed in numpy 1.24, so I resolved this by downgrading to numpy==1.23.

VarIr commented 1 year ago

Thanks for reporting this. Indeed, the numpy aliases to Python dtypes have been removed in 1.24, ref. For the time being skhubness thus requires numpy<1.24.

jolespin commented 2 months ago

Is this package still being developed?

VarIr commented 2 months ago

Not very actively, though I might find some time to do maintenance tasks like this (which likely only requires changing np.float to np.float32 in the code; PR welcome).

jolespin commented 2 months ago

This package would be extremely useful for my research as I've been trying to implement some of these methods myself but I don't really have the background for it.

I can take a crack at updating the code to use the newest numpy and scikit learn because I'm unable to install this with pip.

Is there anything in particular I should be aware of in terms of porting to the newest versions?

VarIr commented 2 months ago

@jolespin Thank you, but now I believe this is in fact not necessary:

I have just tested skhubness==0.30 with Python=3.10 and recent numpy, sklearn etc. This runs the example code from the readme just fine. Also, at a quick glance, I could not find any usage of np.float in the code base that would have caused the initial error reported here. So I suppose this error came from an earlier version of skhubness (v.20.x indeed used np.float).

jolespin commented 2 months ago

Awesome. A few hours ago I forked it and got it to install just fine from source. I just changed a single line in the test directory under the neighbor module.

Is the 0.30 version ready for public by any chance? Maybe under beta release?

VarIr commented 2 months ago

Thx for the feedback. Which line did you change?

It is ready enough that I pushed the changes to main. Since the docs are not yet fully updated to reflect changes in v.30, I've never created an "official" release for PyPI. I cannot guarantee for anything, but please feel free to try and test.

jolespin commented 2 months ago

I just remove the np.float32 and np.float64 parts but I didn't even need to since I was already working with v0.30a.