Giter Club home page Giter Club logo

sdia-python's Introduction

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

sdia-python's People

Contributors

guilgautier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sdia-python's Issues

FAQ last session

Please list here the questions, notions, problems you'd like we discuss during our last session.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.