Read files from scientific_python folder in alphabetical order and try to understand how all prints
and asserts work.
This repository has a structure of a Python package with some additional files:
scientific_pythonfolder represents top level package of the same name. This package contains several sub-packages and modules. You can start witha_introsub-package and read its modules one by one in alphabetical order. All modules can be used as separate modules and scripts without package installationbinfolder contains scripts that can be used after package installation. Now they are used for testingdocfolder is used for documentation. Now it contains only MS Word file with course annotation (in Russian)misccontains two sub-folders related toJuyternotebooks used in class:jupyter_notebookscontains notebooks and other files used in class sorted by dateshare_jupytercontains littleDockerproject that runs my classJupyterserver and exposes notebookHTMLcopies to the world on sai.homb.it
setup.pyis used to install this packagerequirements.txtfile contains Python dependencies of the project.virtualenv_activation.shis a sample shell script (for *nix systems only) that can be used to activatevirtualenvand install the package. Use it by typing. virtualenv_activation.shorsource virtualenv_activation.sh. For exit virtualenv typedeactivateDockerfileanddocker-compose.ymlfiles can be used to run the project insideDockercontainer.gitignoreand.gitattributesaregitfiles.dockerignoreis just a link to.gitignore, it used to prevent load garbage into Docker container.travis.ymlis aTravisconfiguration file.Travisis a continuous integration (CI) system used to test this project with various Python versions, 2.7 and 3.5+ are supported
Remember to use Python 3, 3.6 and later is good enough in 2018. You can check python version typing in console python3 --version or import sys; print(sys.version) in Python itself
- Anaconda Python distribution is a good choice for scientific Python programming on every platform. It includes a lot of pre-compiled numerical and scientific packages and
condapackage manager where you can find even more packages, likeastropyorscikit-learn - Official Python distribution: good on Windows or macOS, when you like to build your environment from scratch.
Instead of official Python distribution I recommend to use Homebrew package manager, type brew install python
Probably you already have Python 3, check its version before start. If you haven't use your Linus package manager to install
iOS doesn't have any application to use for scientific programming. The best choice is Pythonista paid application that can run and edit Python 3.5 code and supports numpy package, but doesn't support scipy and other useful packages.
PyDroid 3 looks good
- IDLE: a simple Python source code editor. It is a part of Python standard library, so if you have Python, you probably have IDLE
- Visual Studio Code (do not be confused with Visual Studio, they are two different products): a powerful source code editor
- Spyder: the scientific Python development environment
- PyCharm: a powerful Python IDE (integrated development environment). PyCharm is closed source product, but Community edition is free to use and every student and professor can ask for a free professional version
- Learn Python in Y minutes: short and deep language tutorial. This tutorial has Russian version
- Dive into Python: old but still good Python handbook
- Official Python tutorial
- Python for astronomers
- Python 3 in one picture: print it and enjoy
- Use of Python programming language in astronomy and science
- Zen of Python or just run
import thisin Python - Official documentation
- Python code style guide
Classes have place in classroom 48 of Sternberg Astronomical Institute MSU at 9:30 on Wednesdays from September to December 2018.
| Date | Description | Materials | Video (in Russian) |
|---|---|---|---|
| 2018年09月05日 | Introduction | a_intro.basics, a_intro.sequences (the first part about lists) |
link |
Seminars had place in classroom 17 of Sternberg Astronomical Institute MSU at 13:30 on Fridays from September to December 2017. Records of on-line translations of the seminars are hosted on YouTube.
| Date | Description | Materials | Video (in Russian) |
|---|---|---|---|
| 2017年09月15日 | Introduction, coursework requirements. Why Python 3? Numbers, lists, if-else, loops. | a_intro.basics, a_intro.sequences |
link |
| 2017年09月22日 | Boolean variables, lists, tuples, dictionaries, sets. Strings and their formatting. Functions, arguments packing and unpacking. | a_intro.sequences, a_intro.strings, b_modules.functions |
link |
| 2017年09月29日 | Functions: default values of keyword arguments, docstrings. Iterators and generators. Modules: file.py as a module. | b_modules.* |
link |
| 2017年10月06日 | Jupyter notebooks. Read and write files and cats. Introduction to numpy: one-dimensional arrays and indexing. |
Notebooks, c_numpy.arrays |
link |
| 2017年10月13日 | numpy: multidimensional arrays, read tabular data files. |
Notebooks, c_numpy.multidim_arrays |
link |
| 2017年10月20日 | Read tabular data files with numpy and pandas. Figure plotting with matplotlib. |
Notebooks | link |
| 2017年10月27日 | scipy: integration, interpolation, optimization. Short overview of other features. |
Notebook, d_scipy.* |
link |
| 2017年11月03日 | Introduction to astropy: physical and astronomical constants, quantity calculations, sky coordinates, image manipulation, read and write data. |
Notebook | link |
| 2017年11月10日 | Packaging of Python project. Classes: example and magic methods. Unit testing. | Notebook and script, setup.py of this project, e_testing.* |
link |
| 2017年11月17日 | Two examples of astropy, astroquery and photutils usage: Hubble diagram fitting and transient object discovery. |
Notebooks | link |
| 2017年11月24日 | Dr. Ivan Zolotukhin tells about Django web framework, scientific web programming and model-template-view paradigm. |
Scripts | — |
| 2017年12月01日 | Student Nikita Utkin tells about argparse. Speed up Python script: why Python is slow, why to avoid loops and why we should know how Python works, numba as a simple way to speed up calculations. |
Scripts and notebook, c_numpy.arrays |
link |
| 2017年12月08日 | Parallel execution of Python code. threading and its limitations due GIL. multiprocessing and its limitations due serialisation via pickle. |
Notebooks | link |
| 2017年12月15日 | Cython language and C-code usage with Python. | Python, Cython and C code, f_speed.compilers and Cython/C files for this module, setup.py |
link |
Copyright (c) 2017, Konstantin L. Malanchev.
All program code in this repository is distributed under the terms of the MIT license. All data files are properties of their authors, see COPYRIGHT_NOTE files in folders with foreign data.