Mastodon
top of page
Search
Writer's pictureChris Handley

My Pythonic Experience




So I am perhaps rather late to Python in my career compared to others, but the last year or so has been a rapid adoption of the programming language on my part. Part of this has been driven by particular projects I work on, while also adopting it as a means to create more accessible software for those who don't want to dive into Fortran or C++.


My own coding background is predominantly Fortran based, given that many computational chemistry simulation programs are built using this language. This is partly because Fortran for a long time has had the fastest libraries for performing complex mathematics, and partly because of the longevity of these codes and the need to maintain them. Furthermore, Fortran has been developed for parallel programming and is relatively easy to teach others to code using, compared to C++.


However, there are some tasks in Fortran I would never do these days, and I would either write smaller routines using Bash, or some other language if I was processing text in particular, such as Perl, Awk, or C++.


Joining the Digital Research Service meant I was quickly exposed to Python, and the initial drive to use it was to test some machine learning-driven code on the HPC GPU cluster. It wasn't quite an uphill battle, especially given the well-developed IDEs that are available - such as PyCharm. Also, Python, through Anaconda, is really easy to manage which packages are loaded for a particular task, and on a Windows 10 machine meant I code rapidly develop in a visual environment before moving to the WSL Unix environment for further testing of the code before exporting it to the HPC. An added benefit of using my Windows 10 machine is that it has an Nvidia GPU, allowing me to test code that used CUDA, in particular Tensorflow. Recently I have also trained in teaching programming, via the Carpentries. This is off the back of running Python courses using material by the Carpentries. Teaching programming really helped reinforce how accessible Python is for novices seeking to write modern code for data sciences. The impact of learning Python for me and my work at the Digital Research Service has been significant. No more writing machine learning code from scratch like I would in Python. Lots of tools maintained by the larger community. And code that is quite easily ported to various systems.


Perhaps the most important impact of Python on my work has been the Atomic Simulation Environment, which enables Python code to interact with many of the most used Chemistry simulation programs, such as Gaussian, CASTEP, DL_POLY and more. Having a library that is able to parse structure files of various types, and understand chemistry "objects" such as molecules, peptides and solvents is invaluable as it enables me to perform many of the tasks I used to do, but much quicker and with just one programming language, and more importantly create code, and Jupyter notebooks, that can be used by many more chemists, especially those who are not experienced programmers. Does this mean I don't need to code in Fortran anymore? Nah. But Python certainly is a powerful tool sat next to my main workhorse code. - Chris

23 views0 comments

Recent Posts

See All

Comments


bottom of page