All Projects → guilgautier → sdia-python

guilgautier / sdia-python

Licence: MIT license
Python course material - SDIA Python

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to sdia-python

Dugite Native
A toolchain for building a portable, cross-platform Git for applications
Stars: ✭ 102 (+537.5%)
Mutual labels:  packaging
Fades
fades is a system that automatically handles the virtualenvs in the cases normally found when writing scripts and simple programs, and even helps to administer big projects.
Stars: ✭ 182 (+1037.5%)
Mutual labels:  packaging
Scikit Build
Improved build system generator for CPython C, C++, Cython and Fortran extensions
Stars: ✭ 234 (+1362.5%)
Mutual labels:  packaging
Rpmvenv
RPM packager for Python virtualenv.
Stars: ✭ 128 (+700%)
Mutual labels:  packaging
Py3readiness
Python 3 support graph for most popular packages
Stars: ✭ 164 (+925%)
Mutual labels:  packaging
Cqtdeployer
This project is used to deploy applications written using QML, qt or other С / С++ frameworks.
Stars: ✭ 225 (+1306.25%)
Mutual labels:  packaging
Dhall To Cabal
Compile Dhall expressions to Cabal files
Stars: ✭ 92 (+475%)
Mutual labels:  packaging
sds env
Spatial Data Science Environment
Stars: ✭ 20 (+25%)
Mutual labels:  teaching
Aptly
aptly - Debian repository management tool
Stars: ✭ 2,065 (+12806.25%)
Mutual labels:  packaging
Mason
Cross platform package manager for C/C++ apps
Stars: ✭ 230 (+1337.5%)
Mutual labels:  packaging
Sailboat
🐍 A quick and easy way to distribute your Python projects!
Stars: ✭ 137 (+756.25%)
Mutual labels:  packaging
Klap
zero config, zero dependency bundler for tiny javascript packages
Stars: ✭ 143 (+793.75%)
Mutual labels:  packaging
Poetry
Python dependency management and packaging made easy.
Stars: ✭ 17,543 (+109543.75%)
Mutual labels:  packaging
Fpm
Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
Stars: ✭ 10,264 (+64050%)
Mutual labels:  packaging
Winepak
Flatpak-ing Microsoft Windows applications with Wine
Stars: ✭ 242 (+1412.5%)
Mutual labels:  packaging
Rain
🌧️ A live example to illustrate python packaging, testing, building, & deploying
Stars: ✭ 99 (+518.75%)
Mutual labels:  packaging
Hatch
A modern project, package, and virtual env manager for Python
Stars: ✭ 2,268 (+14075%)
Mutual labels:  packaging
pkutils
A Python packaging utility library
Stars: ✭ 19 (+18.75%)
Mutual labels:  packaging
learningmachines
Teaching machine learning!
Stars: ✭ 46 (+187.5%)
Mutual labels:  teaching
Recipe Robot
A kick ass tool for creating AutoPkg recipes.
Stars: ✭ 229 (+1331.25%)
Mutual labels:  packaging

SDIA - Python

Python course given to students enrolled in Parcours DATA - Science des Données et Intelligence Artificielle (SDIA) managed by Pierre Chainais at Ecole Centrale de Lille.

Some material is inspired and/or borrowed from courses previously given by:

Get the project

It is suggested you Fork the original repository.

A fork is a copy of a repository that you manage. Forks let you make changes to a project without affecting the original repository. You can fetch updates from or submit changes to the original repository with Pull Requests (PRs).

  1. Fork

  2. Clone: git clone https://github.com/<your-username>/sdia-python.git

  3. Create a remote.

    cd sdia-python
    git remote -v # list the remotes ; an origin remote should be present
    git remote add upstream https://github.com/guilgautier/sdia-python.git
    git remote -v # remotes origin and upstream should be listed

This process allows you to link your local copy of <your-username>/sdia-python with the original repository guilgautier/sdia-python, so that you can fetch updates from it, e.g., corrections, new course material, etc.

git remotes

For example, at the beginning of a practical session, to get the latest course material

git checkout main # select your main branch
git pull upstream main # fetch and merge commits from guilgautier/sdia-python

Note: Merge conflicts may occur 😏. We'll see how to handle this very common situation.

Set up your working environment

We will use conda to manage Python packages and virtual environments

Virtual environment

See also notes/anaconda-vscode.md

Create a virtual environment

A virtual environment is a self-contained directory tree that contains a Python installation for a particular version of Python, plus a number of additional packages.

It is always good practice to work in a virtual environment, isolated from your other Python projects.

The environment.yml file contains the list of the main packages that will be installed when creating the environment

cd sdia-python
# conda env list
conda env create -f environment.yml

Activate a virtual environment

# cd sdia-python
conda env list
conda activate sdia-python
# prefix (sdia-python) should appear

Deactivate a virtual environment

# cd sdia-python
# conda activate sdia-python
conda deactivate
# prefix (sdia-python) should disappear

Install the project in editable mode

In order to be able to import your code in various places of your project (source files, test files, noteboooks), like

import sdia_python.lab1
from sdia_python.lab1.xxx import yyy

You can install a project in "editable" or "develop" mode while you’re working on it. When installed as editable, a project can be edited in-place without reinstallation: changes to Python source files in projects installed as editable will be reflected the next time an interpreter process is started.

Before installing the project in "editable" mode, make sure to first activate your environment,

# cd sdia-python
conda activate sdia-python # a (sdia-python) prefix should appear
pip install -e .

See also

Integrated Development Environment - Visual Studio Code

Visual Studio Code (VSCode) is recommended to ease your coding experience.

See the notes/anaconda-vscode.md file.

Jupyter Notebooks

Jupyter notebooks allow you to easily prototype code and showcase your project, see notebooks/ folder.

In order to automatically reflect modifications of the source files (located in src/) into your notebook, make sure your notebook has the following cell (make it the top cell of your notebook) and run it!

%load_ext autoreload
%autoreload 2

Launch a Jupyter notebook

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].