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

Does not work with latest numpy #110

Open
clkruse opened this issue Mar 22, 2023 · 8 comments
Open

Does not work with latest numpy #110

clkruse opened this issue Mar 22, 2023 · 8 comments

Comments

@clkruse
Copy link

clkruse commented Mar 22, 2023

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
Copy link
Owner

VarIr commented Mar 22, 2023

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
Copy link

Is this package still being developed?

@VarIr
Copy link
Owner

VarIr commented May 21, 2024

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
Copy link

jolespin commented May 21, 2024

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
Copy link
Owner

VarIr commented May 22, 2024

@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
Copy link

jolespin commented May 22, 2024

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
Copy link
Owner

VarIr commented May 22, 2024

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
Copy link

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.

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

No branches or pull requests

3 participants