Restore numpy compatibility#48
Conversation
… in model and test files
|
Hi @mzwiessele , It seems like replacing the Do you have any idea on how we can fix this? |
|
hello @MartinBubel, I saw your work, and despair about numpy 2. I have a chatgpt subscription and yesterday I released the beast (gpt 5.6-sol) with a good prompt to repair paramz. I also made some extra changes:
For the moment 100% of the test passed!! Also have a GPy branch (based from you work) that work 100% The branch for paramz is https://github.com/fbordeu/paramz/tree/update-numpy-compatibility. Thanks for starting this work. The rest was mainly done by ChatGPT 2.6-sol, not me. I hope this will contribute to a long life of GPy. Felipe |
|
I'm not sure if @mzwiessele is tracking this. @MartinBubel are you still following? |
With the release of
numpy>=2, themy_array.dataaccess got removed.This is used deep inside
paramzwhich makes it incompatible with modernnumpyversions.Since
numpyis a core dependency of pretty much anything in scientific computing, this needs to be fixed.The way the
.dataaccessor was used inparamzis to update the memory location of existing arrays, without re-creating them and without creating temporary data copies.As off now, it seems like this is something that is not possible anymore in
numpy>=2, at least, I could not figure out how - at least for now.What does this PR do?
It may make sense to split this up into multiple PRs later. Sorry for the mess atm.
I have added a
_set_mem_addrfunction inparamz.util.pythat serves as a baseline for the problematic update that is still not fixed.The current variants works with
numpy<2but fails otherwise.If anyone has got some idea on how to better debug or even fix this, feel free to join :)
Also, this is not based on develop but master. The reason for this is that the latest merge into development seems to have broken something else. We'll fix that later.