I need to migrate python numpy code from version 1.19 to 1.24, is it better to migrate directly or step by step (first 1.20, then 1.21 etc.)?
From my personal point of view, the gap between the versions of NumPy is not so big. I would create a new virtual environment and install the desired version of NumPy. Then by running the code, either you will get Runtime errors for unsupported and no longer existing functions or everything will run just smoothly.
In case you have errors, you can try searching them online to find the required fix.
In case you have no errors at all, I would still try to come up with a Test script that testes some of the basic functionalities that are used and could break through out the code, you could try copying some values and hardcode set them to see the behaviour.
The above, would apply to any kind of package. If you still feel you need to go step by step, feel free.
ChatGPT's point of view is : "It's generally recommended to upgrade to the latest version of Numpy step by step, rather than directly from version 1.19 to 1.24. This is because newer versions of Numpy may have breaking changes, so by upgrading incrementally, you can minimize the risk of encountering compatibility issues and ensure a smoother transition."