Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • vS5_2020-2021
2 results

Target

Select target project
0 results Searching
Select Git revision
Loading items
Show changes

Commits on Source 55

58 files
+ 2458
255
Compare changes
  • Side-by-side
  • Inline

Files

.gitignore

0 → 100644
+129 −0
Original line number Diff line number Diff line
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# fichier mac
.DS_Store

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

Python++.pdf

0 → 100644
+7.68 MiB

File added.

No diff preview for this file type.

Python++_SeanceIHM.pdf

0 → 100644
+2.53 MiB

File added.

No diff preview for this file type.

panorama/Frise.pdf

0 → 100644
+66 KiB

File added.

No diff preview for this file type.

+86 −0
Original line number Diff line number Diff line
**Sommaire**

[[TOC]]

# Informatique à l'ECL

*Remarque* Les liens vers les espaces Moodle sont ceux de 2020-2021. Je vous laisse rechercher les liens de ces mêmes cours pour l'année en cours !

---
## Enseignement de l'Informatique en 2A

### S7 - UE Approfondissement (App)

- [App 1-FH](https://pedagogie2.ec-lyon.fr/enrol/index.php?id=1105) - Multimédia : Concepts et technologies, [M. Ardabilian](mailto:mohsen.ardabilian@ec-lyon.fr), [E. Dellandréa](mailto:emmanuel.dellandrea@ec-lyon.fr)    
- [App 2-FH](https://pedagogie2.ec-lyon.fr/enrol/index.php?id=1106) - Stratégies de résolution de problèmes, [A. Saidi](mailto:alexandre.saidi@ec-lyon.fr)    
- [App 3-EG](https://pedagogie2.ec-lyon.fr/course/view.php?id=1107) - Applications concurrentes, mobiles et réparties en Java, [A. Saidi](mailto:alexandre.saidi@ec-lyon.fr), [S. Derrode](mailto:stephane.derrode@ec-lyon.fr)    
- [App 4-EG](https://pedagogie2.ec-lyon.fr/enrol/index.php?id=1108) - Analyse de données et reconnaissance des formes, [L. Chen](liming.chen@ec-lyon.fr), [E. Dellandréa](mailto:emmanuel.dellandrea@ec-lyon.fr)    

[*Détails des enseignements*](https://www.ec-lyon.fr/formation/ingenieure-generaliste/programme-formation/tronc-commun/offre-formation-tronc-commun?module=654102)

### S8 - UE Électifs (ELC)

- [ELC A11](https://pedagogie2.ec-lyon.fr/course/view.php?id=1137) - Programmation des interfaces graphiques en C++, [E. Dellandréa](mailto:emmanuel.dellandrea@ec-lyon.fr), [S. Derrode](mailto:stephane.derrode@ec-lyon.fr)    
- [ELC B2](https://pedagogie2.ec-lyon.fr/enrol/index.php?id=1140) - Algorithme collaboratifs et applications, [P. Michel](philippe.michel@ec-lyon.fr), [A. Saidi](mailto:alexandre.saidi@ec-lyon.fr)    
- [ELC C4](https://pedagogie2.ec-lyon.fr/enrol/index.php?id=1152) - Capteurs et traitement d'images, [L. Chen](liming.chen@ec-lyon.fr)       
- [ELC D3](https://pedagogie2.ec-lyon.fr/enrol/index.php?id=1160) - Applications Web, [D. Muller](mailto:daniel.muller@ec-lyon.fr), [R. Chalon](rene.chalon@ec-lyon.fr)    
- [ELC E1](https://pedagogie2.ec-lyon.fr/enrol/index.php?id=1170) - Algorithme et raisonnement, [A. Saidi](mailto:alexandre.saidi@ec-lyon.fr), [E. Dellandréa](mailto:emmanuel.dellandrea@ec-lyon.fr)     

[*Détails des enseignements*](https://www.ec-lyon.fr/formation/ingenieure-generaliste/programme-formation/parcours-electif/offre-formation-parcours?module=654204)

---
## Césure 2A / 3A - Centrale Digital Lab

Une année de césure professionnalisante et en immersion dans le numérique

 - 3 semaines de cours en *IA*, *Machine Learning*, *Big Data*, *Web*, *Data visualisation*    
 - 3 POC (*Proof-Of-Concept*) de 7 semaines, animés par des entreprises et en mode agile (formateurs CGI / Sopra)    
 - 1 stage en entreprise de 5 mois (à l'étranger)   

Plus d'information?

 - Teaser video : [youtube - Centrale Digital Lab](https://www.youtube.com/watch?v=dK0R9EFA4I8)    
 - Responsable du programme [René Chalon](mailto:rene.chalon@ec-lyon.fr)  
 - Plus d'information auprès de [Fatima Chouikhi](mailto:fatima.chouikhi@ec-lyon.fr)    
 - Site de l'ECL : [Centrale Digital Lab](https://www.ec-lyon.fr/formation/ingenieur-generaliste/construire-son-projet-professionnel/lyon-centrale-digital-lab)

---
## Enseignement de l'Informatique en 3A

### S9 – Modules Ouverts Disciplinaires (MOD)

- [MOD 2.1](https://pedagogie3.ec-lyon.fr/course/view.php?id=1210) - Défis informatique du Big Data, [S. Derrode](mailto:stephane.derrode@ec-lyon.fr)    
- [MOD 3.2](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1203) - Apprentissage profond & Intelligence Artificielle, [L. Chen](liming.chen@ec-lyon.fr), A. Bosio, [E. Dellandréa](mailto:emmanuel.dellandrea@ec-lyon.fr)    
- [MOD 4.4](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1241) - Recherche opérationnelle, [M. Zine](abdel-malek.zine@ec-lyon.fr), N. Bousquet, [A. Saidi](mailto:alexandre.saidi@ec-lyon.fr)    
- [MOD 4.6](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1249) - Systèmes de bases de données, [L. Chen](liming.chen@ec-lyon.fr)    
- [MOD 5.3](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1252) - Traitement et analyse des données visuelles et sonores, [M. Ardabilian](mailto:mohsen.ardabilian@ec-lyon.fr), [E. Dellandréa](mailto:emmanuel.dellandrea@ec-lyon.fr)    
- [MOD 7.1](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1250) - Systèmes d'information en entreprise, [R. Vuillemot](mailto:romain.vuillemot@ec-lyon.fr)
- [MOD 7.2](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1218) - Introduction à la data science, [A. Saidi](mailto:alexandre.saidi@ec-lyon.fr)
- [MOD 8.4](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1243) - Représentation et manipulation de données structurées, [D. Muller](mailto:daniel.muller@ec-lyon.fr)   
- [MOD 9.5](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1244) - Réseaux informatiques, [R. Chalon](rene.chalon@ec-lyon.fr)

[*Détails des enseignements*](https://www.ec-lyon.fr/formation/ingenieure-generaliste/programme-formation/parcours-electif/offre-formation-parcours?module=654017)


### S9 – Modules Ouverts Sectoriels (MOS)

- [MOS 4.3](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1423) - Informatique d'entreprise, [M. Ardabilian](mailto:mohsen.ardabilian@ec-lyon.fr), [D. Muller](mailto:daniel.muller@ec-lyon.fr)    
- [MOS 2.2](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1424) - Informatique graphique, [M. Ardabilian](mailto:mohsen.ardabilian@ec-lyon.fr), N. Bonneel    
- [MOS 4.4](https://pedagogie3.ec-lyon.fr/course/view.php?id=1430) - Nouvelles technologies de l'information et de la communication, [M. Ardabilian](mailto:mohsen.ardabilian@ec-lyon.fr), [D. Muller](mailto:daniel.muller@ec-lyon.fr)   
- [MOS 5.5](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1440) - Visualisation interactive de données,  [R. Vuillemot](mailto:romain.vuillemot@ec-lyon.fr)   

[*Détails des enseignements*](https://www.ec-lyon.fr/formation/ingenieure-generaliste/programme-formation/parcours-electif/offre-formation-parcours?module=654023)


### S9 – Modules Spécifiques Option (MSO)

- [MSO 3.1](https://pedagogie3.ec-lyon.fr/course/view.php?id=1369) - Technologies informatiques du Big Data, [S. Derrode](mailto:stephane.derrode@ec-lyon.fr)   
- [MSO 3.2](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1370) - Les systèmes d'information par la pratique, [R. Vuillemot](mailto:romain.vuillemot@ec-lyon.fr)   
- [MSO 3.3](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1371) - Internet des objets, [R. Chalon](rene.chalon@ec-lyon.fr), [D. Muller](mailto:daniel.muller@ec-lyon.fr)   
- [MSO 3.4](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1372) - Apprentissage automatique, [L. Chen](liming.chen@ec-lyon.fr), [E. Dellandréa](mailto:emmanuel.dellandrea@ec-lyon.fr)   
- [MSO 3.5](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1373) - Vision par ordinateur, [M. Ardabilian](mailto:mohsen.ardabilian@ec-lyon.fr), [L. Chen](liming.chen@ec-lyon.fr)    
- [MSO 3.6](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1374) - Calcul et modélisation géométrique pour  l'info. graphique, [M. Ardabilian](mailto:mohsen.ardabilian@ec-lyon.fr)   
- [MSO 3.7](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1375) - Apprentissage bayésien et exploration de textes, [A. Saidi](mailto:alexandre.saidi@ec-lyon.fr), [S. Derrode](mailto:stephane.derrode@ec-lyon.fr)
- [MSO 3.8](https://pedagogie3.ec-lyon.fr/enrol/index.php?id=1376) - Projet Informatique, toute l'équipe pédagogique   

[*Détails des enseignements*](https://www.ec-lyon.fr/formation/ingenieure-generaliste/programme-formation/parcours-electif/offre-formation-parcours?module=654039)

panorama/Slides.pdf

0 → 100644
+262 KiB

File added.

No diff preview for this file type.

+10 −1
Original line number Diff line number Diff line
Chers étudiants,

*A compléter*
 No newline at end of file
ce _repo_ contient l'ensemble des sujets de BE pour l'enseignement `INF-TC2` de l'École centrale de Lyon. Pour consulter le sujet, il vous suffit de cliquer sur le fichier markdown (d'extension _.md_) dans le répertoire correspondant à la séance.

**Remarques**

 - Pour rappel (vu en cours), les BE #3 et #5 seront évalués par votre encadrant. Les consignes pour le rendu sont précisées dans les répertoires respectifs.    
 - Les slides du cours sont disponibles sur [Moodle](https://pedagogie1.ec-lyon.fr/course/view.php?id=1024).
 - Dans le répertoire _tuto-git-gitlab_, vous trouverez les scénarios des 2 tutos joués en direct dans le cours #4. C'est le moment de vous exercer...

Stéphane Derrode et Thibault Rafaillac
 No newline at end of file
+67 −0
Original line number Diff line number Diff line
from Bibliotheque import Bibliotheque
from Lecteur      import Lecteur

if __name__ == '__main__':

    # Création d'une bibliothèque
    MS = Bibliotheque('Michel Serre')
    print("MS = ", MS)               # Affichage attendu : "MS = Nom de la biblio : Michel Serre"
    print("b1 = ", Bibliotheque(1))  # Affichage attendu : "b1 =  Nom de la biblio : 1"
    
    print('\n==>test bibliothèque vide')

    # Recherches
    print(MS.chercher_lecteur_numero(1))                       # Affichage attendu : None
    print(MS.chercher_livre_numero(1))                         # Affichage attendu : None
    print(MS.chercher_lecteur_nom('Levgueni Dimitri'))         # Affichage attendu : None
    print(MS.chercher_livre_titre('Les Hauts de Hurlevent'))   # Affichage attendu : None

    # Affichage
    MS.affiche_livres()   # Affichage attendu : (rien)
    MS.affiche_lecteurs() # Affichage attendu : (rien)
    MS.affiche_emprunts() # Affichage attendu : (rien)

    print('\n==>test bibliothèque non vide mais sans emprunt')
    MS.ajout_lecteur(Lecteur('Mzai Ahmed', 'Boulevard de la Paix', 1))
    MS.ajout_lecteur(Lecteur('Xu John',    'Rue de la Gare',       2))
  
    MS.ajout_livre('Le Père Goriot',  'Honoré de Balzac', -1, 101)
    MS.ajout_livre("Léon l'Africain", 'Amin Maalouf',      2, 102)

    MS.affiche_livres()   # Affichage attendu : le premier livre doit afficher 0 exemplaire (et non -1!)
    MS.affiche_lecteurs() # Affichage attendu : les 2 lecteurs
    MS.affiche_emprunts() # Affichage attendu : (rien)

    print(MS.chercher_lecteur_numero(1))          # Affichage attendu : le lecteur Mzai Ahmed
    print(MS.chercher_livre_numero(1))            # Affichage attendu : None
    print(MS.chercher_livre_numero(102))          # Affichage attendu : le livre Léon L'Africain
    print(MS.chercher_lecteur_nom('Xu John'))     # Affichage attendu : le lecteur Xu John
    print(MS.chercher_livre_titre('Samarcande'))  # Affichage attendu : None
  

    print('\n==>test bibliothèque non vide et avec emprunt')
    MS.emprunt_livre(8, 101)    # Affichage attendu : Emprunt impossible : lecteur inexistant (car 0 livre dispo)
    MS.emprunt_livre(1, 1001)   # Affichage attendu : Emprunt impossible : livre inexistant (car 0 livre dispo)
    
    MS.emprunt_livre(1, 101)    # Affichage attendu : Emprunt impossible (car 0 livre dispo)
    MS.emprunt_livre(1, 102)    # Affichage attendu : (rien) (car l'emprunt est OK)
    MS.affiche_emprunts()       # Affichage attendu : Emprunt - Numero lecteur : 1, Numero livre: 102, Date : 2021-xx-yy

    MS.retour_livre(33, 102)    # Affichage attendu : Aucun emprunt ne correspond a ces informations : 33 102
    MS.retour_livre(1, 102)     # Affichage attendu : (rien) (le livre emprunté a bien été rendu)
    MS.affiche_emprunts()       # Affichage attendu : (rien) (car il n'y a aucun livre emprunté)

    print(MS.retrait_livre(28))   # Affichage attendu : False
    print(MS.retrait_livre(101))  # Affichage attendu : False (car il n'y a aucun exemplaire de ce livre)
    MS.emprunt_livre(1, 102)      
    print(MS.retrait_livre(102))  # Affichage attendu : False car le livre est emprunté
    MS.retour_livre(1, 102)
    print(MS.retrait_livre(102))  # Affichage attendu : True

    print(MS.retrait_lecteur(28))   # Affichage attendu : False
    MS.ajout_livre("Léon l'Africain", 'Amin Maalouf',      2, 102)
    MS.emprunt_livre(1, 102)  
    print(MS.retrait_lecteur(1))    # Affichage attendu : False (car emprunt en cours)
    MS.retour_livre(1, 102)
    print(MS.retrait_lecteur(1))    # Affichage attendu : True
−14 KiB (15.7 KiB)

29.66 KiB

15.66 KiB

  • 2-up
  • Swipe
  • Onion skin
−18.2 KiB (12.1 KiB)

30.35 KiB

12.11 KiB

  • 2-up
  • Swipe
  • Onion skin
−32.6 KiB (32 KiB)

64.61 KiB

32.03 KiB

  • 2-up
  • Swipe
  • Onion skin
+0 −1
Original line number Diff line number Diff line
<mxfile host="Electron" modified="2020-08-24T05:34:03.311Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.6.2 Chrome/83.0.4103.122 Electron/9.2.0 Safari/537.36" etag="JyznIXuSCOPoCPcxa0e5" version="13.6.2" type="device"><diagram name="Page-1" id="c4acf3e9-155e-7222-9cf6-157b1a14988f">7V19c5s2GP80vut2Z4537D9jJ223pVuu3dpm//SwkW21gDyQE7uffhIIg5BwnRiwc1XuerUeg4T0+/G86cUDaxpt3yT+evUOBSAcmHqwHVjXA9M0DN0l/1HJLpeMPCZYJjDIRXop+AC/A3ZnId3AAKRMloswQiGGa144R3EM5piT+UmCHvnLFigMOMHaXwJB8GHuh6L0EwzwivXC9Er5WwCXq6Jlwx3n38z8+bdlgjYxay9GMci/ifyiGtbHdOUH6LEism4G1jRBCOefou0UhHRY+RF73fDt/pETEONjbvhrsn1zf319Zf728Pbz/VWY/HkfDk2bPRzeFWMBAjI0rAjC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JpLi/tlBZnVN9Sb2pujS3HHtRC6tJcmz8vyvYcbVz96+z0Lik/xczT5ZzdcvCF+umObpGOhhg/Xs7JLd3Cd/EHt0i7L4sJ2zQHpmvy5sAwfnRI4+Uc7nXsMbgvwWxYI0/jDxd1bJ1X9M+zIZZpa3sFs7chxO7rVll1zT51bEPEaPfCbUjxFiobQkdDjFIv3Ia0Bt/F2xC5phPwmsBZCBFegf82akPeM6e9A5gQ5uR5bOA3BKUtzYRbozGvv3XGwerctN7eqWBFEFwExcUhqJXm9vvxetykJ/8FCYmHpE4FO5QpOagkTpkEfzIFT/rpEFmytIbxTzgV1g64kkluKbgtTIVJH7gpB6qmwrpG3pWseur1tW46KMb/ShyI/SxYodSnFQVf/6xWb3fAj9G51X7j1q0VSOi/giL8Vh499wWaTr1VrDiNFbIJ9H5pUfxS3xG8QJFEfSiOdM4Ryex6zxyRb/+amoOrYsl/wZJUrf1vnwCSmfWeCSAPFnMC5P5FtrzigEehXIvu+CGZe++ZH/KNYRk/SjtCKSL3LqQHXClanJhokGwX7JkW8pWZMlpkJ0O9ElwKRYwuiCHZP9gzMeTrNnmHgmKv3IkuEpDd+ZOkWP7wdZ6pLn9Y3Lr5Hw==</diagram></mxfile>
 No newline at end of file
−38.1 KiB (34.3 KiB)

72.37 KiB

34.26 KiB

  • 2-up
  • Swipe
  • Onion skin
+12 KiB

12.04 KiB

+95 −178

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

−45.4 KiB

45.43 KiB

−40.3 KiB

40.32 KiB

−4.52 KiB

4.52 KiB

seance2_4h/figures/uml1.svg

deleted100644 → 0
+0 −3
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="701px" height="168px" viewBox="-0.5 -0.5 701 168" content="&lt;mxfile host=&quot;app.diagrams.net&quot; modified=&quot;2020-09-02T12:41:38.977Z&quot; agent=&quot;5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36&quot; etag=&quot;ruTGXMro8CwttfHMEE6F&quot; version=&quot;13.6.6&quot; type=&quot;device&quot;&gt;&lt;diagram id=&quot;ZFG0j7v5SNXi1jvCDSdx&quot; name=&quot;Page-1&quot;&gt;7Zptb9owEMc/TV5SkYQE9pKHPkkwdWVapb2Z3MRJrJoYOaZAP/0uiU0Ah422S9NJlhDE53Nyvt/Z5B+w3PFic83RMpmxEFPL6YYby51YjtMf+PCeG7alwXPc0hBzEpYmuzLMyQuWxq60rkiIswNHwRgVZHloDFia4kAc2BDnbH3oFjF6eNUlirFmmAeI6tYHEoqktA6cfmW/wSRO1JVt/0vZs0DKWc4kS1DI1nsm99Jyx5wxUR4tNmNM89ypvJTjrk707gLjOBXnDHBiPhOb7Y8vs5+j+c2v+2A4CzqeU57mGdGVnPE9pBGlMSSgDFtsVS6yNVlQlEJrFLFUzGWPDW1ESZzCcQDBYA6GZ8wFgTQOZYdgS7AGCaHhFG3ZKg85Eyh4Uq1Rwjh5gdMiKs8J3VzIinD8A495PhLMXbBynIHPncqDfWSaoc2B4xRlQhoCRilaZuRxN40F4jFJR0wItpBOiAcyBtvLg8KQcSQYHzPKYKKTlBUJUbm5IpQedynw+eliirJMHqsxU5KqALInLIJEBcxWaYhD2VpiThYYsjtfooCksTRHexe0HDeKIicIiuxx9oT3ekL/0ffyNOqFI2spZ4Y3eyZZSNeYwYX5FlzUspY1LRe1q9rraons6j7ZXx5+Ty5NuSzj3amryoUDWbyvKWRfK2TLGZURD+ED5kqgMI9LGuYrtGRJbpGOUpU5xZE4WeRZyWda+Ex6leVeJiI3MRgb0aIsEhKGOC14CyRQWY0FcUZSUSTKG8EL8jnuXniWB4GPoW1XbXjl7lyMWQpzQaQgi6HU1zgv9xrmf94O/l4JEr3jn0de+b0H/O232+kLXw8f7nvrYNgJEbv62rFPcN8a7k1yVyM+gnt9yK4GvgNNarA3ib0/aHm56/crOfXEUG+Sut3ttb3avZpt/ggzJeXtVoFZ3azbb2K8AFoUV1C/58wnHVsD7+rg3RrIFD1iescyIgjLz89L3yP47fF1z7x/GzS0qvW93Bo71rCrMTZL+d2oP3AHr4+5r8G+pBT0vBGcRnCeEpyu/ekUp39KeRjF+ZodrH92KXwWxXnqSYNRnI1yb19xDmq1B5frPWSrx5qHpob7O7m3Ljl16VFg3xrsTWJvX3P6XaM5G+TbtubUd3OjOZtC3bbm9PXHhpZ7ZfSm0Zsn9KbnvVVvuk3tV3bd15HRm6/cvXY7wf+jN23zE2cr4FsXnL7+WPzi4sKA/tegP1Jh1odsft1qEO/ZSrKxb+6au08jNZphbTe3aUOz+rdm0bf3l1f38jc=&lt;/diagram&gt;&lt;/mxfile&gt;"><defs><clipPath id="mx-clip-4-31-212-26-0"><rect x="4" y="31" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-57-212-26-0"><rect x="4" y="57" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-83-212-26-0"><rect x="4" y="83" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-109-212-26-0"><rect x="4" y="109" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-143-212-26-0"><rect x="4" y="143" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-31-212-26-0"><rect x="244" y="31" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-57-212-26-0"><rect x="244" y="57" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-83-212-26-0"><rect x="244" y="83" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-109-212-26-0"><rect x="244" y="109" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-143-212-26-0"><rect x="244" y="143" width="212" height="26"/></clipPath><clipPath id="mx-clip-484-31-212-26-0"><rect x="484" y="31" width="212" height="26"/></clipPath><clipPath id="mx-clip-484-57-212-26-0"><rect x="484" y="57" width="212" height="26"/></clipPath><clipPath id="mx-clip-484-83-212-26-0"><rect x="484" y="83" width="212" height="26"/></clipPath><clipPath id="mx-clip-484-117-212-26-0"><rect x="484" y="117" width="212" height="26"/></clipPath></defs><g><path d="M 0 26 L 0 0 L 220 0 L 220 26" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="all"/><path d="M 0 26 L 0 164 L 220 164 L 220 26" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 0 26 L 220 26" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="109.5" y="17.5">Rectangle</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-31-212-26-0)" font-size="12px"><text x="5.5" y="43.5">+ x: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-57-212-26-0)" font-size="12px"><text x="5.5" y="69.5">+ y: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-83-212-26-0)" font-size="12px"><text x="5.5" y="95.5">- l: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-109-212-26-0)" font-size="12px"><text x="5.5" y="121.5">- h: entier</text></g><path d="M 0 134 L 220 134" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-143-212-26-0)" font-size="12px"/><path d="M 240 26 L 240 0 L 460 0 L 460 26" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 26 L 240 164 L 460 164 L 460 26" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 26 L 460 26" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="349.5" y="17.5">Ellipse</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-31-212-26-0)" font-size="12px"><text x="245.5" y="43.5">+ x: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-57-212-26-0)" font-size="12px"><text x="245.5" y="69.5">+ y: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-83-212-26-0)" font-size="12px"><text x="245.5" y="95.5">- rx: double</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-109-212-26-0)" font-size="12px"><text x="245.5" y="121.5">- ry: double</text></g><path d="M 240 134 L 460 134" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-143-212-26-0)" font-size="12px"/><path d="M 480 26 L 480 0 L 700 0 L 700 26" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 480 26 L 480 138 L 700 138 L 700 26" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 480 26 L 700 26" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="589.5" y="17.5">?</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-31-212-26-0)" font-size="12px"><text x="485.5" y="43.5">+ x: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-57-212-26-0)" font-size="12px"><text x="485.5" y="69.5">+ y: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-83-212-26-0)" font-size="12px"><text x="485.5" y="95.5">...</text></g><path d="M 480 108 L 700 108" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-117-212-26-0)" font-size="12px"/></g></svg>
 No newline at end of file

seance2_4h/figures/uml2.svg

deleted100644 → 0
+0 −3
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="701px" height="286px" viewBox="-0.5 -0.5 701 286" content="&lt;mxfile host=&quot;app.diagrams.net&quot; modified=&quot;2020-09-02T12:43:26.686Z&quot; agent=&quot;5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36&quot; etag=&quot;WZoK8idbTfEnltmXA0ep&quot; version=&quot;13.6.6&quot; type=&quot;device&quot;&gt;&lt;diagram id=&quot;ZFG0j7v5SNXi1jvCDSdx&quot; name=&quot;Page-1&quot;&gt;7Vtdb+I4FP01PFKRT+ARaJkZCVbdstqR5mVlEpNYNTFyTIH++r3BNiFxYJh2A+1sJNTGN7Zzfc/x9YkNLWe03H7haBVPWYhpy+6E25Zz37Ltbs+Hv5lhJw1u15WGiJNQmqzcMCOvWBk7yromIU4LFQVjVJBV0RiwJMGBKNgQ52xTrLZgtPjUFYqwYZgFiJrW7yQUsbT27G5u/4pJFOsnW35f3lkiXVmNJI1RyDZHJueh5Yw4Y0JeLbcjTLPY6bjIduMTdw+OcZyISxrYEZ+K7e7v/vTHcPb1n6dgMA3ani27eUF0rUb8BGFESQQBkG6LnY5FuiFLihIoDRcsETN1x4IyoiRK4DoAZzAHwwvmgkAYB+qGYCuwBjGh4QTt2DpzORUoeNalYcw4eYVuEVV9wm0uFCNsv1BjlrUEcwesHKdQ51H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d1Ln3ZOeSCz7Nt4VWt00PpYAN8fcDf/JDMveAtt9mveiu8t/6WVtcy0f1/71cV5cBpVXEsIQwNVRtfajxqg2L+MwapevPfgjgP/wI=&lt;/diagram&gt;&lt;/mxfile&gt;"><defs><clipPath id="mx-clip-4-201-212-26-0"><rect x="4" y="201" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-227-212-26-0"><rect x="4" y="227" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-261-212-26-0"><rect x="4" y="261" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-201-212-26-0"><rect x="244" y="201" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-227-212-26-0"><rect x="244" y="227" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-261-212-26-0"><rect x="244" y="261" width="212" height="26"/></clipPath><clipPath id="mx-clip-484-201-212-26-0"><rect x="484" y="201" width="212" height="26"/></clipPath><clipPath id="mx-clip-484-235-212-26-0"><rect x="484" y="235" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-31-212-26-0"><rect x="244" y="31" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-57-212-26-0"><rect x="244" y="57" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-91-212-26-0"><rect x="244" y="91" width="212" height="26"/></clipPath></defs><g><path d="M 0 196 L 0 170 L 220 170 L 220 196" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="all"/><path d="M 0 196 L 0 282 L 220 282 L 220 196" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 0 196 L 220 196" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="109.5" y="187.5">Rectangle</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-201-212-26-0)" font-size="12px"><text x="5.5" y="213.5">- l: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-227-212-26-0)" font-size="12px"><text x="5.5" y="239.5">- h: entier</text></g><path d="M 0 252 L 220 252" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-261-212-26-0)" font-size="12px"/><path d="M 240 196 L 240 170 L 460 170 L 460 196" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 196 L 240 282 L 460 282 L 460 196" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 196 L 460 196" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="349.5" y="187.5">Ellipse</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-201-212-26-0)" font-size="12px"><text x="245.5" y="213.5">- rx: double</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-227-212-26-0)" font-size="12px"><text x="245.5" y="239.5">- ry: double</text></g><path d="M 240 252 L 460 252" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-261-212-26-0)" font-size="12px"/><path d="M 480 196 L 480 170 L 700 170 L 700 196" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 480 196 L 480 256 L 700 256 L 700 196" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 480 196 L 700 196" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="589.5" y="187.5">?</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-201-212-26-0)" font-size="12px"><text x="485.5" y="213.5">...</text></g><path d="M 480 226 L 700 226" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-235-212-26-0)" font-size="12px"/><path d="M 120 170 L 120 150 L 350 150 L 350 132.24" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 350 114.24 L 359 132.24 L 341 132.24 Z" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 350 170 L 350 132.24" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 350 114.24 L 359 132.24 L 341 132.24 Z" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 580 170 L 580 150 L 350 150 L 350 132.24" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 350 114.24 L 359 132.24 L 341 132.24 Z" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 26 L 240 0 L 460 0 L 460 26" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 26 L 240 112 L 460 112 L 460 26" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 26 L 460 26" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="349.5" y="17.5">Forme</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-31-212-26-0)" font-size="12px"><text x="245.5" y="43.5">+ x: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-57-212-26-0)" font-size="12px"><text x="245.5" y="69.5">+ y: entier</text></g><path d="M 240 82 L 460 82" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-91-212-26-0)" font-size="12px"/></g></svg>
 No newline at end of file

seance2_4h/figures/uml3.svg

deleted100644 → 0
+0 −3
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="701px" height="482px" viewBox="-0.5 -0.5 701 482" content="&lt;mxfile host=&quot;app.diagrams.net&quot; modified=&quot;2020-09-02T12:43:54.091Z&quot; agent=&quot;5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36&quot; etag=&quot;lFbpCapjlEMSZ9oZFN9N&quot; version=&quot;13.6.6&quot; type=&quot;device&quot;&gt;&lt;diagram id=&quot;ZFG0j7v5SNXi1jvCDSdx&quot; name=&quot;Page-1&quot;&gt;7Vxdb6M4FP01kboPrQKEfDwmaTszq3Y124x21HmpHHDAGgdHxpkk/fV7ATsfGFLahaSdtVR14osx9j3H1/eeMG054/n6E0eL8J75mLbstr9uOdct2+71u/A7MWwyQ6fXyQwBJ35msnaGCXnG0tiW1iXxcXzQUTBGBVkcGj0WRdgTBzbEOVsddpsxevjUBQqwZph4iOrW78QXYWbt272d/TMmQaiebHUH2ZU5Up3lSuIQ+Wy1Z3JuWs6YMyayT/P1GNPEd8ov2X23JVe3E+M4ElVusAN+L9abfwb3P0aTz08P3vDeu3TtbJhfiC7lih/AjSgKwAHZtMVG+SJekTlFEbRGMxaJibxiQRtREkTw2YPJYA6GX5gLAm4cyguCLcDqhYT6d2jDlsmUY4G8n6o1ChknzzAsonJMuMyFZITdPegxSe4EcxusHMfQ56vyg5Uz3aP1Qcc7FAtp8BilaBGT6XYZc8QDEo2YEGwuOyHuyTlYbjIpDB5HgvEx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v3PWWAq1Fyvhxg6KMtHVlMIfmFZuxSOouVK4SJfLwYwjf5j8r1toTSlLCtFRKOaqbMV+gFVpDD4MWcAiRG921lxdB6OpArObNZMaUl48zGDtY9VbzJbcw0eWplI7KKsDfAw35dxkJUdR20PJLQBJ2TimSJBf+GC6RcjJJ3xNmLorNh0nV2wO2odDZCuXd+3w1wfq5wbq5AbKPKMNBGCjzV43uZNKJ2wNcs9x20fn1bGP9ocP2Qx2rN5i8B+IXiQl/iZE731MotvtHA/6byR6J79jFLYvEL0ubik16DfkljrTPhq3NEqcmluvDaLdvMT4HoNoR39x6JbxuXmV2UjnZdJ5/lVmq7J0XkcpVcxi/ZX8rJTKldym2qkS8D+QlO4WndOjvLBigK8b+LO/zdypUOWa71DeCu+5/7ZEr0xGf9XrzP9feesweSjPQfYTDi3jaoxdpxTsi6dc9hKSjxcUeXgOK77wC+jlG341G3gqq/Jv4AY0d3/GL6ufdn8L0bn5Fw==&lt;/diagram&gt;&lt;/mxfile&gt;"><defs><clipPath id="mx-clip-4-231-212-26-0"><rect x="4" y="231" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-257-212-26-0"><rect x="4" y="257" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-291-212-34-0"><rect x="4" y="291" width="212" height="34"/></clipPath><clipPath id="mx-clip-4-325-212-26-0"><rect x="4" y="325" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-351-212-26-0"><rect x="4" y="351" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-377-212-26-0"><rect x="4" y="377" width="212" height="26"/></clipPath><clipPath id="mx-clip-4-403-212-32-0"><rect x="4" y="403" width="212" height="32"/></clipPath><clipPath id="mx-clip-4-435-212-46-0"><rect x="4" y="435" width="212" height="46"/></clipPath><clipPath id="mx-clip-244-231-212-26-0"><rect x="244" y="231" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-257-212-26-0"><rect x="244" y="257" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-291-212-34-0"><rect x="244" y="291" width="212" height="34"/></clipPath><clipPath id="mx-clip-244-325-212-26-0"><rect x="244" y="325" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-351-212-26-0"><rect x="244" y="351" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-377-212-26-0"><rect x="244" y="377" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-403-212-34-0"><rect x="244" y="403" width="212" height="34"/></clipPath><clipPath id="mx-clip-244-437-212-46-0"><rect x="244" y="437" width="212" height="46"/></clipPath><clipPath id="mx-clip-484-231-212-26-0"><rect x="484" y="231" width="212" height="26"/></clipPath><clipPath id="mx-clip-484-265-212-26-0"><rect x="484" y="265" width="212" height="26"/></clipPath><clipPath id="mx-clip-484-291-212-26-0"><rect x="484" y="291" width="212" height="26"/></clipPath><clipPath id="mx-clip-484-317-212-38-0"><rect x="484" y="317" width="212" height="38"/></clipPath><clipPath id="mx-clip-484-355-212-46-0"><rect x="484" y="355" width="212" height="46"/></clipPath><clipPath id="mx-clip-244-31-212-26-0"><rect x="244" y="31" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-57-212-26-0"><rect x="244" y="57" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-91-212-26-0"><rect x="244" y="91" width="212" height="26"/></clipPath><clipPath id="mx-clip-244-117-212-26-0"><rect x="244" y="117" width="212" height="26"/></clipPath></defs><g><path d="M 0 226 L 0 200 L 220 200 L 220 226" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="all"/><path d="M 0 226 L 0 476 L 220 476 L 220 226" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 0 226 L 220 226" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="109.5" y="217.5">Rectangle</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-231-212-26-0)" font-size="12px"><text x="5.5" y="243.5">- l: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-257-212-26-0)" font-size="12px"><text x="5.5" y="269.5">- h: entier</text></g><path d="M 0 282 L 220 282" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-291-212-34-0)" font-size="12px"><text x="5.5" y="303.5">+ constructeur(x: entier, y: entier,</text><text x="5.5" y="317.5">l: entier, h: entier)</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-325-212-26-0)" font-size="12px"><text x="5.5" y="337.5">+ affiche()</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-351-212-26-0)" font-size="12px"><text x="5.5" y="363.5">+ get_dim(): l: entier, h: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-377-212-26-0)" font-size="12px"><text x="5.5" y="389.5">+ set_dim(l: entier, h: entier)</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-403-212-32-0)" font-size="12px"><text x="5.5" y="415.5">+ contient_point(x: entier, y: entier):</text><text x="5.5" y="429.5">booléen</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-4-435-212-46-0)" font-size="12px"><text x="5.5" y="447.5">+ redimension_par_points(x0: entier,</text><text x="5.5" y="461.5">y0: entier, x1: entier, y1: entier)</text></g><path d="M 240 226 L 240 200 L 460 200 L 460 226" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 226 L 240 478 L 460 478 L 460 226" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 226 L 460 226" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="349.5" y="217.5">Ellipse</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-231-212-26-0)" font-size="12px"><text x="245.5" y="243.5">- rx: double</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-257-212-26-0)" font-size="12px"><text x="245.5" y="269.5">- ry: double</text></g><path d="M 240 282 L 460 282" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-291-212-34-0)" font-size="12px"><text x="245.5" y="303.5">+ constructeur(x: entier, y: entier,</text><text x="245.5" y="317.5">rx: double, ry: double)</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-325-212-26-0)" font-size="12px"><text x="245.5" y="337.5">+ affiche()</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-351-212-26-0)" font-size="12px"><text x="245.5" y="363.5">+ get_dim(): rx: double, ry: double</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-377-212-26-0)" font-size="12px"><text x="245.5" y="389.5">+ set_dim(rx: double, ry: double)</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-403-212-34-0)" font-size="12px"><text x="245.5" y="415.5">+ contient_point(x: entier, y: entier):</text><text x="245.5" y="429.5">booléen</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-437-212-46-0)" font-size="12px"><text x="245.5" y="449.5">+ redimension_par_points(x0: entier,</text><text x="245.5" y="463.5">y0: entier, x1: entier, y1: entier)</text></g><path d="M 480 226 L 480 200 L 700 200 L 700 226" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 480 226 L 480 396 L 700 396 L 700 226" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 480 226 L 700 226" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="589.5" y="217.5">?</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-231-212-26-0)" font-size="12px"><text x="485.5" y="243.5">...</text></g><path d="M 480 256 L 700 256" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-265-212-26-0)" font-size="12px"><text x="485.5" y="277.5">+ constructeur(...)</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-291-212-26-0)" font-size="12px"><text x="485.5" y="303.5">+ affiche()</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-317-212-38-0)" font-size="12px"><text x="485.5" y="329.5">+ contient_point(x: entier, y: entier):</text><text x="485.5" y="343.5">booléen</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-484-355-212-46-0)" font-size="12px"><text x="485.5" y="367.5">+ redimension_par_points(x0: entier,</text><text x="485.5" y="381.5">y0: entier, x1: entier, y1: entier)</text></g><path d="M 120 200 L 120 180 L 350 180 L 350 158.24" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 350 140.24 L 359 158.24 L 341 158.24 Z" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 350 200 L 350 158.24" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 350 140.24 L 359 158.24 L 341 158.24 Z" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 580 200 L 580 180 L 350 180 L 350 158.24" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 350 140.24 L 359 158.24 L 341 158.24 Z" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 26 L 240 0 L 460 0 L 460 26" fill="#fff2cc" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 26 L 240 138 L 460 138 L 460 26" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><path d="M 240 26 L 460 26" fill="none" stroke="#d6b656" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="349.5" y="17.5">Forme</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-31-212-26-0)" font-size="12px"><text x="245.5" y="43.5">+ x: entier</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-57-212-26-0)" font-size="12px"><text x="245.5" y="69.5">+ y: entier</text></g><path d="M 240 82 L 460 82" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-91-212-26-0)" font-size="12px"><text x="245.5" y="103.5">+ constructeur(x: entier, y: entier)</text></g><g fill="#000000" font-family="Helvetica" pointer-events="none" clip-path="url(#mx-clip-244-117-212-26-0)" font-size="12px"><text x="245.5" y="129.5">+ deplacement(dx: entier, dy: entier)</text></g></g></svg>
 No newline at end of file
+74 −65
Original line number Diff line number Diff line
# <center>TD2 : Modélisation de formes géométriques</center>
**Sommaire**

Nous allons aborder dans ce TD le concept d'héritage de la programmation objet, et l'utilisation de tests unitaires pour guider le développement logiciel et améliorer sa qualité.
[[_TOC_]]

Le but de ce TD est de concevoir un module pour manipuler des formes géométriques avec Python. Ce module sera utilisé dans les TDs suivants, donc les tests seront essentiels pour limiter les éventuels bugs. Vous commencerez par définir les classes et leurs attributs, puis écrirez les tests unitaires de votre module, et terminerez par l'implémentation des méthodes.
# BE #2 : Modélisation de formes géométriques

Le but de ce BE est d'illustrer le concept d'héritage de la programmation objet, en concevant un module pour manipuler des formes géométriques avec Python. Vous commencerez par définir les classes et leurs attributs, puis implémenterez les méthodes, et les validerez avec des tests.

Pour compléter cet énoncé, la dernière section propose de réfléchir à une schéma UML d'une application décrite par son cahier des charges.

# Modélisation avec UML (1h)
---
## Modélisation avec UML (1h30)

Les formes géométriques sont représentées par des classes, et l'héritage sera utilisé pour factoriser les propriétés communes. Nous nous limitons à un repère à deux dimensions orthonormé, avec les axes croissant vers la droite et le bas. Les coordonnées dans ce repère sont des entiers relatifs (c'est-à-dire possiblement négatifs). Dans cet espace, nous choisissons de représenter les formes suivantes :

* Les rectangles caractérisés par leur origine (`x`, `y`) et leurs dimensions (`l`, `h`).
* Les ellipses caractérisées par leur origine (`x`, `y`) et leurs rayons aux axes (`rx`, `ry`).
* Un type de forme de votre choix (ex. triangle, polygone, étoile, ...), qui possède au moins une origine (`x`, `y`).
* Les cercles caractérisés par leur origine (`x`, `y`) et leur rayon.

<center><img src="figures/formes.svg" style="width:50%"/></center>
<center><img src="figures/formes.svg" style="width:70%"/></center>

__Exercice 1 -__ Représentez les 3 classes dans un diagramme de classes UML (_voir https://app.diagrams.net pour dessiner en ligne, avec l'onglet UML sur la gauche_). Il est recommandé de commencer les noms des classes par une majuscule et les attributs par une minuscule. Les attributs devraient-ils être publics ou privés ?


Les attributs `x` et `y` étant partagés par les trois classes, on introduit l'héritage pour les regrouper. Toutes les formes géométriques hériteront d'une même classe __Forme__. L'intérêt de cette classe est double :

* Du point de vue des développeurs du module, les méthodes dont le code est identique entre formes (ex. translation) sont fusionnées dans __Forme__, réduisant la quantité de code à  (et donc la multiplication des erreurs possibles).
* Du point de vue des utilisateurs du module, on peut écrire du code qui manipule des rectangles et des ellipses (ex. système de collisions de formes) sans avoir à écrire du code séparément pour les rectangles et les ellipses. Cet aspect sera illustré dans un prochain TD.
__Exercice 1 -__ Représentez les 3 classes dans un diagramme de classes UML (_voir [diagrams.net](https://app.diagrams.net) pour dessiner en ligne, avec l'onglet UML sur la gauche de l'interface_). Il est recommandé de commencer les noms des classes par une majuscule et les attributs par une minuscule. Durant tout ce BE on considérera uniquement des attributs privés.

__Exercice 2 -__ Mettez à jour le diagramme UML en incluant la classe __Forme__ et les relations d'héritage. Seuls les attributs seront inclus pour le moment.

Enfin, on vous demande de supporter a minima pour chaque forme les méthodes suivantes :
__Exercice 3 -__ On vous demande de supporter a minima pour chaque forme les méthodes suivantes :

* `deplacement(dx, dy)`, qui effectue une translation selon un vecteur donné.
* `translation(dx, dy)`, qui effectue une translation selon un vecteur donné.
* `contient_point(x, y)`, qui renvoie `True` si et seulement si le point donné est à l'intérieur de la forme ou sur sa frontière.
* `redimension_par_points(x0, y0, x1, y1)`, qui redimensionne la forme pour faire correspondre sa [boîte englobante](https://en.wikipedia.org/wiki/Minimum_bounding_rectangle) avec celle représentée par les points donnés.

__Exercice 3 -__ Complétez le diagramme UML avec ces méthodes. Les constructeurs devront également être renseignés (méthode `__init__` en Python), ainsi que les méthodes d'affichage (méthode `__str__` en Python).

__Exercice 4 -__ Écrivez un squelette de code correspondant à votre diagramme UML, dans un fichier _formes.py_. Seuls les constructeurs devront être implémentés. À l'intérieur des autres méthodes, vous mettrez l'instruction `pass` de Python (qui ne fait rien mais vous rappelle que le code est inachevé).


# Tests unitaires (1h)
* `redimension_par_points(x0, y0, x1, y1)`, qui redimensionne la forme telle qu'elle soit incluse dans le rectangle de coins (`x0`, `y0`) et (`x1`, `y1`). Dans le cas du cercle, il faudra également qu'il soit le plus proche du premier coin. Cette méthode est utile par exemple dans [diagrams.net](https://app.diagrams.net) pour le tracé de formes par appui-déplacement de souris.

Il convient à présent de rédiger des tests, qui échoueront tant que chaque fonction ne sera pas implémentée et correcte. Dans la méthodologie _Test Driven Development_, on les écrit toujours avant le code, au début ils échouent tous, et à mesure de l'avancement du projet le nombre de tests passés augmente. Nous utiliserons le module _pytest_ présenté en cours.
Complétez le diagramme UML avec ces méthodes. Les constructeurs devront également être renseignés (méthode `__init__` en _Python_), ainsi que les méthodes d'accès (les fameux _getter_/_setter_) et d'affichage (méthode `__str__`).

## Installation de _pytest_
__Exercice 4 -__ Écrivez un squelette de code correspondant à votre diagramme UML, dans un fichier _formes.py_. Seuls les constructeurs devront être implémentés. À l'intérieur des autres méthodes, vous mettrez l'instruction `pass` de _Python_ (qui ne fait rien mais vous rappelle que le code est inachevé).

Nous allons d'abord installer _pytest_, ainsi qu'un module permettant de lancer les tests depuis l'interface de Spyder. Ouvrez le terminal d'Anaconda (sous Windows, Menu Démarrer -> Anaconda -> Anaconda Prompt, sous Linux/Mac le terminal de base suffit). Exécutez-y la commande suivante :

```sh
conda install -c spyder-ide spyder-unittest pytest
```

❗ Si vous rencontrez une erreur comme `conda: command not found`, c'est que l'exécutable `conda` n'est présent dans aucun des dossiers visités par le terminal (essayez `echo %PATH%` pour en afficher la liste sous Windows, et `echo $PATH` sous Linux/Mac). Sous Windows, vérifiez que vous ouvrez bien le terminal d'Anaconda (pas le terminal par défaut du système). Sous Linux/Mac, la commande `export PATH=~/anaconda3/bin:/usr/local/anaconda3/bin:/usr/anaconda3/bin:$PATH` va ajouter (temporairement) une liste de répertoires usuels à la liste de recherche.
---
## Implémentation des méthodes (2h30)

Une fois les modules installés, __redémarrez Spyder__ et créez un fichier _test_formes.py_ avec l'exemple de code suivant :
Créez un fichier _test_formes.py_ dans le même dossier que _formes.py_ et initialisé avec le code suivant :

```python
from formes import *

def test_heritage():
	assert issubclass(Rectangle, Forme)
	assert issubclass(Ellipse, Forme)
def test_Rectangle():
    r = Rectangle(10, 20, 100, 50)
    str(r)
    assert r.contient_point(50, 50)
    assert not r.contient_point(0, 0)
    r.redimension_par_points(100, 200, 1100, 700)
    assert r.contient_point(500, 500)
    assert not r.contient_point(50, 50)

def test_Ellipse():
    e = Ellipse(60, 45, 50, 25)
    str(e)
    assert e.contient_point(50, 50)
    assert not e.contient_point(11, 21)
    e.redimension_par_points(100, 200, 1100, 700)
    assert e.contient_point(500, 500)
    assert not e.contient_point(101, 201)

def test_Cercle():
    c = Cercle(10, 20, 30)
    str(c)
    assert c.contient_point(0, 0)
    assert not c.contient_point(-19, -9)
    c.redimension_par_points(100, 200, 1100, 700)
    assert c.contient_point(500, 500)
    assert not c.contient_point(599, 500)

if __name__ == '__main__':
    test_Rectangle()
    test_Ellipse()
    test_Cercle()
```

__Exécutez ce fichier__ dans Spyder (même s'il ne fait rien), ce qui a pour effet d'initialiser le répertoire courant de Spyder à votre répertoire de travail. Allez ensuite dans le menu Run -> Run unit tests, pour configurer le module _spyder-unittest_.

<center>![](figures/spyder-unittest.png)</center>

Sélectionnez _pytest_, vérifiez que le dossier indiqué correspond à votre dossier de travail (celui contenant les fichiers _formes.py_ et _test_formes.py_), et validez. Un nouvel onglet _Unit testing_ apparaît dans l'espace en haut à droite, avec un bouton _Run tests_. Lorsque vous cliquez dessus :
La commande `assert` de _Python_ permet de spécifier une assertion (une condition qui doit toujours être vraie) à un point du programme. Elle sert, avant un bloc de code, à en documenter les prérequis et, après un bloc de code, à en vérifier les résultats. Son échec signifie alors un bug du programme. `assert` reçoit une expression (comme ce qu'on passe à `if`), et vérifie son résultat :

* _pytest_ cherche (dans le dossier que vous venez de configurer) tous les fichiers de la forme _test\_\*.py_ et _\*\_test.py_.
* Dans chacun de ces fichiers, _pytest_ exécute toutes les fonctions préfixées par `test`.
* Chaque test qui s'exécute sans déclencher d'exception est considéré valide.
* La fonction `test_heritage` dans le fichier _test_formes.py_ correspond à ces critères, donc elle est exécutée et son résultat contribue à un test "passé".
* Si `True`, l'assertion est vraie donc pas de problème, `assert` ne fait rien.
* Si `False`, l'assertion est fausse donc une exception `AssertionError` est déclenchée.
* Si l'expression renvoie une autre valeur, celle-ci est convertie en booléen pour se ramener aux deux cas précédents.

<center>![](figures/spyder-tests.png)</center>
La vérification de cette condition est faite une fois au moment de son exécution (l'assertion ne sera pas valide dans le reste du programme). Dans _test_formes.py_, on utilise `assert` pour tester une fonctionnalité qui n'est pas encore implémentée, l'exécution de ce fichier échouera tant que les méthodes de seront pas codées. À l'issue de cette partie, elle ne devra renvoyer plus aucune erreur !

## Définition des tests
__Exercice 5 -__ Implémentez les méthodes d'affichage (`__str__`) de chacune des classes dans _formes.py_. Vous pourrez vérifier leur bon fonctionnement en exécutant _formes.py_ (bouton `Run File - F5`), puis par exemple avec une commande `print(Rectangle(0, 0, 10, 10))` dans la console _IPython_.

__Exercice 5 -__ Dans le fichier _test_formes.py_, ajoutez une fonction `test_Rectangle_contient_point()` qui instancie un __Rectangle__ avec des coordonnées de votre choix, et vérifie avec `assert` que la méthode `contient_point` renvoie le bon résultat pour différentes coordonnées. L'exécution des tests doit échouer puisque votre code est encore vide.

Pour l'exercice suivant on vous donne un exemple d'implémentation de la méthode `contient_point` pour la classe __Rectangle__. La classe __Forme__ a été omise pour réduire la taille du code (mais dans votre code elle devra bien être présente).
__Exercice 6 -__ Implémentez les méthodes d'accès (_getter_/_setter_) pour les champs privés de chacune des classes. Pour vérifier que les champs sont bien privés, le code suivant __doit__ échouer avec une erreur de type `AttributeError` :

```python
class Rectangle:
	def __init__(self, x, y, l, h):
		self.x = x
		self.y = y
		self.__l = l
		self.__h = h
	
	def contient_point(self, x, y):
		return self.x < x < self.__l or \
		       self.y < y < self.__h
r = Rectangle(0, 0, 10, 10)
print(r.__x, r.__y, r.__w, r.__h)
```

__Exercice 6 -__ Cette méthode est buggée. Comment la corriger ? Vos tests l'avaient-ils repéré ? Si ce n'est pas le cas, trouvez les coordonnées qui donnent un mauvais résultat et ajoutez-les en tests dans la fonction `test_Rectangle_contient_point`.
__Exercice 7 -__ Implémentez les méthodes `contient_point` des deux sous-classes. Vous vérifierez que les deux premiers `assert` des méthodes de test ne déclenchent pas d'erreur.

__Exercice 8 -__ Implémentez les méthodes `redimension_par_points` de chacune des sous-classes. Le fichier _test_formes.py_ doit à présent s'exécuter sans problème.


__Exercice 9 -__ Exécutez ce test sur votre code, et corrigez les éventuels bugs. Représentez ensuite, dans un logiciel de dessin (ex. [diagrams.net](https://app.diagrams.net)), le rectangle et les positions des points qui sont testés. Quels bugs sont visés par chacun de ces tests ?


# Implémentation des méthodes (2h)
__Exercice 10 -__ Dessinez une ellipse dans votre logiciel de dessin, et représentez tous les points qu'il convient de tester avec `contient_point`. Pour chaque point (ou groupe de points), indiquez le type de bug qu'il vise en particulier. Implémentez ces tests dans _test_formes.py_.

__Exercice 7 -__ Implémentez les méthodes d'affichage (`__str__`) de chacune des classes. Il ne sera pas nécessaire d'écrire des tests pour ces méthodes.
__Exercice 11 -__ Dans le cas du cercle, la différence principale avec l'ellipse est la méthode `redimension_par_points` qui nécessite de placer le centre du cercle au plus près du premier point. Proposez des tests qui permettent de vérifier que la méthode positionne toujours correctement le cercle dans la boîte englobante d'entrée.

__Exercice 8 -__ Implémentez les méthodes d'accès getter/setter pour les champs privés de chacune des classes. À l'aide de [pytest.raises](https://docs.pytest.org/en/stable/assert.html#assertions-about-expected-exceptions), vous testerez le déclenchement d'erreurs si on essaie d'accéder directement aux attributs.

---
## Schéma UML

__Exercice 9 -__ Implémentez les méthodes `contient_point` des deux sous-classes restantes. Vous fournirez pour chacune une fonction de tests avec des jeux de coordonnées pertinents.
Cet exercice a été proposé lors de l'examen S6, année 2020-2021.

> La société « L’atelier des chefs » propose des cours de cuisine. Un cours réunit pendant 2h un chef et 2 à 5 apprentis. Pendant un cours, le chef propose une recette du catalogue (Moussaka, Fish and Ships, Osso buco, Tajine marocain, Soupe chinoise…) et aide les apprentis à réaliser cette recette dans le temps imparti. Dans un esprit de convivialité, tout le monde s’appelle par son prénom.
> Ils réalisent ensemble une recette composée d’ingrédients :
> -   une seule viande (parmi porc, veau, poulet) ;
> -   un ou plusieurs légumes (parmi carotte, choux, potiron) ;
> -   une ou plusieurs épices (parmi sel, poivre, curcuma).

__Exercice 10 -__ Implémentez les méthodes `redimension_par_points` de chacune des sous-classes. Vous fournirez également des tests validant leur fonctionnement quels que soient les points en entrée.
> Dégager les éléments principaux de cet énoncé et réaliser un diagramme de classes UML permettant de modéliser un cours de cuisine. Il n’est pas nécessaire de préciser les attributs, mais préciser les cardinalités s’il y a lieu.
+30 −0
Original line number Diff line number Diff line
### Consignes pour le rendu (BE #3 - INF-TC2)

Ce BE est le premier devoir à rendre concernant INF-TC2. Le compte-rendu (CR) de votre travail devra être déposé sur _Pedagogie1_, sur l'espace de dépôt spécifique à votre groupe. Et cela dans un **délai d'une semaine après la dernière séance consacrée à ce BE** (délai de rigueur, aucun travail accepté au delà de cette date). Cette semaine de délai ne tient pas compte d'éventuelles vacances. Si vous avez un doute, le plus simple est de contrôler la date pour votre groupe sur _Pedagogie1_.

**Consignes:**

> - Le travail peut être individuel ou en binôme. Si vous travaillez en binôme, **un seul dépôt suffit !**.    
> - Le dépôt consistera en une unique archive (zip, rar ou tgz) contenant l'ensemble des fichiers suivants :   
     - La base de données *Hotellerie.db*, après exécution des requêtes de l'énoncé. 
     - Le fichier _HotelDB.py_, contenant la classe **HotelDB** et un programme principal permettant de rejouer l'ensemble des requêtes de cet énoncé.
     - La base de données de votre choix pour les 2 requêtes libres (si différentes de *Hotellerie.db*) ; Si elle est très volumineuse, donnez uniquement le chemin de téléchargement dans votre rapport). Ajoutez le fichier _Python_ qui met en œuvre les requêtes que vous aurez imaginées. 
     - Un rapport (format _pdf_ exclusivement) contenant     
         - une en-tête où devront figurer le nom des élèves, leur numéro de groupe, le nom de l'encadrant ainsi que le titre du BE.   
         - des commentaires sur la programmation de chacune des requêtes et les résultats obtenus.    
         - tout diagramme, toute figure ou toute explication que vous jugerez utile, mais dans un **nombre de pages limité à 10** (il n'est pas demandé de rédiger 10 pages, c'est une limite à ne pas dépasser !).

> - L'archive devra nécessairement porter le nom suivant : *nom1-BE3.zip* ou *nom1-nom2-BE3.zip* (pour les étourdis, pensez à remplacer *nom1* et *nom2* par vos propres noms :-) )

**Critères d'évaluation du travail**

Voici une liste (non exhaustive) de critères qui permettront à vos encadrants d'évaluer vos requêtes :

> - **Qualité du rapport** : apparence visuelle globale (lisibilité), orthographe, structure du rapport claire et cohérente. Qualité des représentations graphique (légendes, label sur les axes...).    

> - **Qualité de l'API** : choix des noms et arguments des méthodes, pas de requêtes SQL hors de la classe, code  d'affichage des texte et des graphiques forcément en dehors des méthodes-requêtes.   

> - **Qualité du code** : est-ce qu'il fonctionne sans erreur, le code est-il suffisamment commenté et aéré ? Tests multiples avec des paramètres inattendus ou erronés. Interception des erreurs potentielles par des exceptions.   

> - **Qualité des requêtes** : originalité et justification de l'intérêt, difficulté technique, valorisation dans le rapport.
 
 No newline at end of file
+88 −0
Original line number Diff line number Diff line
# Quelques exemples d'usage de la librairie matplotlib
# De nombreux exemples supplémentaires à cette adresse: https://matplotlib.org/gallery/index.html
# Remarque : N'oubliez pas plt.close()! après chaque figure

import matplotlib.pyplot as plt
import numpy             as np

if __name__ == '__main__':

	## function
	#############################################
	x = np.linspace(0, 2, 100)           # Generate evenly spaced numbers

	fig, ax = plt.subplots()             # Create a figure and an axis.
	ax.plot(x, x, label='linear')        # Plot some data on the axes.
	ax.plot(x, x**2, label='quadratic')  # Plot more data on the axes...
	ax.plot(x, x**3, label='cubic')      # ... and some more.
	ax.set_xlabel('x label')             # Add an x-label to the axes.
	ax.set_ylabel('y label')             # Add a y-label to the axes.
	ax.set_title("Simple Plot")          # Add a title to the axes.
	ax.legend()                          # Add a legend.
	#plt.show()                           # Display the plot (close to continue)
	plt.savefig('mpl_plot.png')          # Save the plot on the HD (current directory)
	plt.close()                          # Close the fig


	## scatter data
	#############################################
	data1, data2 = np.random.randn(2, 100)  # Draw random samples

	fig, ax = plt.subplots(1, 1)            # Create a figure and an axis.
	ax.plot(data1, data2, marker='x')       # Scatter plot
	plt.savefig('mpl_scatter.png')          # Save the plot on the HD
	plt.close()                             # Close the fig


	## error bar
	# https://matplotlib.org/api/_as_gen/matplotlib.pyplot.errorbar.html
	#############################################
	x = np.linspace(0, 10, 50)
	dy = 0.8
	y = np.sin(x) + dy * np.random.randn(50)

	plt.errorbar(x, y, yerr=dy, fmt='o', color='black', ecolor='lightgray', elinewidth=3, capsize=0);
	plt.savefig('mpl_errorbar.png')
	plt.close()


	## histogram (avec personalisation)
	# https://matplotlib.org/3.3.1/api/_as_gen/matplotlib.pyplot.hist.html
	#############################################
	x = np.random.randn(1000)

	plt.style.use('classic')
	fig=plt.figure(figsize=(5,3))
	ax = plt.axes(facecolor='#E6E6E6')
	# Afficher les ticks en dessous de l'axe
	ax.set_axisbelow(True)
	# Cadre en blanc
	plt.grid(color='w', linestyle='solid')

	# Cacher le cadre
	# ax.spines contient les lignes qui entourent la zone où les 
	# données sont affichées.
	for spine in ax.spines.values():
	    spine.set_visible(False)
	# Cacher les marqueurs en haut et à droite
	ax.xaxis.tick_bottom()
	ax.yaxis.tick_left()

	# Nous pouvons personnaliser les étiquettes des marqueurs
	# et leur appliquer une rotation
	marqueurs = [-3, -2, -1, 0, 1, 2]
	xtick_labels = ['A', 'B', 'C', 'D', 'E', 'F']
	plt.xticks(marqueurs, xtick_labels, rotation=30)

	# Changer les couleur des marqueurs
	ax.tick_params(colors='gray', direction='out')
	for tick in ax.get_xticklabels():
	    tick.set_color('gray')
	for tick in ax.get_yticklabels():
	    tick.set_color('gray')
	    
	# Changer les couleurs des barres
	ax.hist(x, edgecolor='#E6E6E6', color='#EE6666')
	plt.savefig('mpl_histopersonalise.png')
	plt.close()
+266 KiB

265.75 KiB

+26.2 KiB

26.17 KiB

+44 KiB

File added.

No diff preview for this file type.