code - neuralinterfacinglab/LabManual GitHub Wiki
Python
Writing code is a big part of your PhD. It is essential to write clean and organized code, as you will be collaborating with colleagues, and sharing it with the scientific community at publication.
Code management
All code is organized with Git and shared at Github. Collaborative projects are hosted on our lab github Personal or smaller projects can be hosted on your personal github.
Virtual Environments
We mainly work in Python, and use the anaconda environment to manage it.
We recommend the full Anaconda distribution (recommended for beginners) which includes a GUI for package management, or the minimum version Miniconda
It is recommended to create a seperate programming environment for each project you are working on. An environment is a separate installation of python and required libraries. Using environments has many benefits (here they use the venv package for environment. They work the same as anaconda environments.)
IDEs
To write and debug code, you need an Integrated Development Environment, or IDE. There are many options, and the best one is your own preference, but we like VSCode.
Learning to code
Get the basics down first, then the best way to learn is by doing it! Ask your collegues for help!
- Codecademy
- Coursera
- Python Data Science Handbook, by Jake vd Plas, organised in Jupiter notebooks.
Styleguides
To standardize coding practices and improve readability, coding styleguides exists and are worth adhering too. For python, these are called the Python Enhancement Proposals or PEPs. Following these PEPs will improve your own code a lot, provide structure and most imporantly, improve readbility for yourself and others!
There are also plugins called linters that check your code for adherence to the style guides. They dont always fit your needs, but can definitely help to learn writing cleaner code.
Python modules we like
- Itertools
- Pathlib
- Numpy
- Scipy
- Matplotlib
- Scikit-learn