In the end it was hell. I had data going everywhere in 3 and 4D arrays, was getting confused which data was input data and which was output data and forgetting the return type of functions. I rewrote it all in Java and though it took some time, was definitely worth it. Creating a nice framework where you can label everything and see it in front of you makes understanding what you have done much easier, especially with Java's generics and a good ide that can predict what you want to type.
I got a lot done at the start, and that is thanks to python. But to understand what is going on and thus be able to tweak stuff you haven't touched in months or years, self-documentation in the form of a good type system is invaluable.
Now if only there were a language that I could write a thesis in quickly...