Update the python interface to use modern numpy interface