Writing good research code is difficult. Here are some pointers and resources to look at. The Good Research Code Handbook How to write better scientific code in Python? Why Can't I Reproduce Their Results?