Best Practices

Best Practices#

Python ecosystem#

  • Manage your Python interpreter

    • know that there is no single Python

    • know which Python you are using

  • Manage your Python packages

    • know the names (and required versions) of your packages

    • know how to install them

    • share the package requirements with collaborators

    • ensure portability and reproducibility of your code

  • Use virtual environments

    • isolate and freeze your dependencies

    • know precisely which package versions your code is using

    • keep updating the packages whenever possible

General tips#

  • Communicate with collaborators and peers

    • learn about their code and tools

    • when in doubt, use the same tools and libraries as your colleagues

  • Write documentation for others and your future self

  • Write automation scripts

  • Version control all your code

    • including (converted) Jupyter notebooks

    • excluding sensitive date (like credentials or api tokens)

    • excluding all data in general (exceeding a couple of MB)

    • project-specific .gitignore (to complement the global core.excludesFile)

__pycache__
.venv
.ipynb_checkpoints