Skip to content
Alon Grinberg Dana edited this page May 30, 2021 · 11 revisions

Installing Python

We use Python within a data science platform called Anaconda. Anaconda comes with a dependency manager called Conda, which assists in managing all external libraries and their versions that we will use within Python.

To install Anaconda, download it on you Linux machine from here - scroll down and chose “64-Bit (x86) Installer” under “Linux”.

Then open your terminal, go to the folder you downloaded the Anaconda .sh file into (using the cd command), and type:

bash Anaconda3-2021.05-Linux-x86_64.sh

Your file may have a different name than what’s written in the above command (a more updated version). If you’re in the correct folder, you can simply type bash An and press Tab to auto-complete the correct file name.

Resources

Note that you can learn Python perfectly well without using paid services (it's all free). If you are interested in learning Python, consider the following online resources:

CAMPUS- Python course in Hebrew.

UDEMY- you can choose what course you want to learn, based on topics, level, language, ratings, video duration etc. NOTE: see price filter button, there are many free courses.

There are also several full Python courses for beginners on Youtube:

What to learn

Make sure that you master the fundamentals first. It might be tempting to jump into more interesting projects at first, but it's highly important to make sure you have covered all the fundamentals first.

What are the fundamentals?

  • Variables (used to store data)
  • Operators (used to assign, compare, add values)
  • Condition statements (like if, else, and elif that helps control the code flow)
  • Functions (re-usable code blocks to perform specific actions)
  • Data types (integers, floats, binaries, lists, tuples, dictionaries)
  • Loops (for, while)

After understanding the fundamentals, let's move to more advanced topics.

What are more advanced topics?

  • Using break and else in for loops
  • try / excepts / else blocks
  • list comprehension
  • generators such as range(x), and the difference between a generator and a list
  • Type hints
  • Class and object oriented programming (OOP): self, __init__(), instance variables, arguments and attributes, class inheritence

An even more advanced topic is Design Patterns. Make sure you master all of the above and gain experience coding in Python before learning Design Patterns.

Coding Practices

  • Software Carpentry workshops can help introduce you to some basic coding practices: working with a Unix shell, using Git, and basic Python commands (https://software-carpentry.org/lessons/). There is also a nice overview by the MolSSI group on scripting for scientific computing (https://education.molssi.org/python_scripting_cms/aio/index.html).
  • Familiarity with a standard command line editor such as Vim, Emacs, or Nano makes editing and working on remote clusters easier.
  • Most of our code will be in Python. You should familiarize yourself with PEP 8 guidelines (https://realpython.com/python-pep8/) and use tools like Pylint, Sublime Text’s AutoPEP8, or PyCharm to enforce good style. It can also be helpful to use optional type hints (https://docs.python.org/3/library/typing.html) so that others can more easily understand your code. Google has a comprehensive style guide for Python code here: http://google.github.io/styleguide/pyguide.html
  • While working in Jupyter notebooks / Jupyter Lab is a great way to analyze experiments and provide tutorials of code, rigorous testing and reproducible research is more easily conducted with a well-organized and documented codebase software repository.
  • Using private repositories to store and update continuous work is a great way to keep a project backed up.
  • Best practices in software development can change, so we should all inform each other of useful resources, helpful packages, and tools.

Other tips

Try out your new skills by:

  • Teaching others about what you've learned
  • Addressing feature requests and solving bugs in our repositories (RMG-Py, ARC, T3, TCKDB). You can look for the "good first issue" label to get started.
Clone this wiki locally