Skip to content

Commit 26a7627

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8f04972 commit 26a7627

2 files changed

Lines changed: 39 additions & 24 deletions

File tree

notebooks/tp_insa/01_introduction_generale_fr.ipynb

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@
109109
"metadata": {},
110110
"outputs": [],
111111
"source": [
112-
"print(\"Je vais dire plusieurs fois que la télédétection c'est super.\", \"Je vous propose de tenir un décompte, pour l'instant ça fait :\", 7)"
112+
"print(\n",
113+
" \"Je vais dire plusieurs fois que la télédétection c'est super.\",\n",
114+
" \"Je vous propose de tenir un décompte, pour l'instant ça fait :\",\n",
115+
" 7,\n",
116+
")"
113117
]
114118
},
115119
{
@@ -214,7 +218,7 @@
214218
"outputs": [],
215219
"source": [
216220
"age = 40\n",
217-
"f'J\\'ai {age} ans'"
221+
"f\"J'ai {age} ans\""
218222
]
219223
},
220224
{
@@ -484,7 +488,7 @@
484488
"pixel_rgb = [37, 150, 190]\n",
485489
"pixel_nir = [0]\n",
486490
"\n",
487-
"pixel_rgbnir = pixel_rgb + pixel_nir \n",
491+
"pixel_rgbnir = pixel_rgb + pixel_nir\n",
488492
"print(pixel_rgbnir)"
489493
]
490494
},
@@ -507,7 +511,9 @@
507511
"outputs": [],
508512
"source": [
509513
"pixel_nir = pixel_rgbnir.pop()\n",
510-
"print(f'On récupère le pixel NIR : {pixel_nir} et le pixel RGB qui a perdu son NIR : {pixel_rgbnir}')"
514+
"print(\n",
515+
" f\"On récupère le pixel NIR : {pixel_nir} et le pixel RGB qui a perdu son NIR : {pixel_rgbnir}\"\n",
516+
")"
511517
]
512518
},
513519
{
@@ -533,10 +539,7 @@
533539
"metadata": {},
534540
"outputs": [],
535541
"source": [
536-
"mon_point = {\n",
537-
" \"type\" : \"Point\",\n",
538-
" \"coordonnees\" : [-71, 41]\n",
539-
" }"
542+
"mon_point = {\"type\": \"Point\", \"coordonnees\": [-71, 41]}"
540543
]
541544
},
542545
{
@@ -608,7 +611,7 @@
608611
"metadata": {},
609612
"outputs": [],
610613
"source": [
611-
"pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]\n"
614+
"pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]"
612615
]
613616
},
614617
{
@@ -650,7 +653,7 @@
650653
"source": [
651654
"pixel_rgbnir = [120, 100, 110, 20]\n",
652655
"\n",
653-
"for color in pixel_rgbnir :\n",
656+
"for color in pixel_rgbnir:\n",
654657
" print(color)"
655658
]
656659
},
@@ -691,7 +694,7 @@
691694
"metadata": {},
692695
"outputs": [],
693696
"source": [
694-
"pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]\n"
697+
"pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]"
695698
]
696699
},
697700
{
@@ -715,6 +718,7 @@
715718
"def bravo_la_teledec():\n",
716719
" print(\"La télédétection c'est vraiment super !\")\n",
717720
"\n",
721+
"\n",
718722
"bravo_le_sertit()"
719723
]
720724
},
@@ -727,6 +731,7 @@
727731
"def bravo_le_(nom_entreprise):\n",
728732
" print(\"Le\", nom_entreprise, \"c'est vraiment super !\")\n",
729733
"\n",
734+
"\n",
730735
"bravo_le_(\"sertit\")"
731736
]
732737
},
@@ -805,6 +810,7 @@
805810
"def bravo_le_(nom_entreprise=\"sertit\"):\n",
806811
" print(\"Le\", nom_entreprise, \"c'est vraiment super !\")\n",
807812
"\n",
813+
"\n",
808814
"bravo_le_()\n",
809815
"bravo_le_(\"laboratoire icube\")"
810816
]
@@ -826,6 +832,7 @@
826832
" nom_entreprise_caché = \"laboratoire icube\"\n",
827833
" print(\"Le\", nom_entreprise, \"c'est vraiment super !\")\n",
828834
"\n",
835+
"\n",
829836
"bravo_le_()\n",
830837
"print(nom_entreprise_caché)"
831838
]
@@ -843,11 +850,13 @@
843850
"metadata": {},
844851
"outputs": [],
845852
"source": [
846-
"nom_entreprise=\"sertit\"\n",
853+
"nom_entreprise = \"sertit\"\n",
854+
"\n",
847855
"\n",
848856
"def bravo_le_():\n",
849857
" nom_entreprise = \"laboratoire icube\"\n",
850858
"\n",
859+
"\n",
851860
"print(\"Le\", nom_entreprise, \"c'est vraiment super !\")"
852861
]
853862
},
@@ -864,12 +873,14 @@
864873
"metadata": {},
865874
"outputs": [],
866875
"source": [
867-
"nom_entreprise=\"sertit\"\n",
876+
"nom_entreprise = \"sertit\"\n",
877+
"\n",
868878
"\n",
869879
"def bravo_le_(nom_entreprise):\n",
870880
" nom_entreprise = \"laboratoire icube\"\n",
871881
" return nom_entreprise\n",
872882
"\n",
883+
"\n",
873884
"nom_entreprise = bravo_le_(nom_entreprise)\n",
874885
"print(\"Le\", nom_entreprise, \"c'est vraiment super !\")"
875886
]
@@ -972,7 +983,7 @@
972983
"import numpy as np\n",
973984
"\n",
974985
"# Création d'une fonction de 2x3\n",
975-
"m = np.arange(0, 6).reshape([2,3])\n",
986+
"m = np.arange(0, 6).reshape([2, 3])\n",
976987
"print(m)"
977988
]
978989
},
@@ -1111,7 +1122,8 @@
11111122
"outputs": [],
11121123
"source": [
11131124
"import matplotlib.pyplot as plt\n",
1114-
"plt.imshow(image_rgbnir[:,:,:3])"
1125+
"\n",
1126+
"plt.imshow(image_rgbnir[:, :, :3])"
11151127
]
11161128
},
11171129
{
@@ -1144,8 +1156,8 @@
11441156
"source": [
11451157
"# Pour afficher le résultat\n",
11461158
"\n",
1147-
"#water_pixels = votre résultat\n",
1148-
"#plt.imshow(water_pixels)"
1159+
"# water_pixels = votre résultat\n",
1160+
"# plt.imshow(water_pixels)"
11491161
]
11501162
},
11511163
{

notebooks/tp_insa/02_intro_manipulation_images_fr.ipynb

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"source": [
4040
"# Imports indispensables\n",
4141
"\n",
42-
"from matplotlib import pyplot\n",
4342
"import rasterio\n",
4443
"from rasterio.plot import show\n",
4544
"from rasterio.plot import show_hist\n",
@@ -71,7 +70,9 @@
7170
"metadata": {},
7271
"outputs": [],
7372
"source": [
74-
"img = rasterio.open(\"https://maxar-opendata.s3.amazonaws.com/events/Belize-Wildfires-June24/ard/16/033131010232/2024-05-02/10300100F9791C00-ms.tif\")"
73+
"img = rasterio.open(\n",
74+
" \"https://maxar-opendata.s3.amazonaws.com/events/Belize-Wildfires-June24/ard/16/033131010232/2024-05-02/10300100F9791C00-ms.tif\"\n",
75+
")"
7576
]
7677
},
7778
{
@@ -89,7 +90,7 @@
8990
"metadata": {},
9091
"outputs": [],
9192
"source": [
92-
"#Tapez le nom de la variable ici\n"
93+
"# Tapez le nom de la variable ici\n"
9394
]
9495
},
9596
{
@@ -231,7 +232,7 @@
231232
"metadata": {},
232233
"outputs": [],
233234
"source": [
234-
"show(bande_1, cmap = \"gray\")"
235+
"show(bande_1, cmap=\"gray\")"
235236
]
236237
},
237238
{
@@ -275,7 +276,7 @@
275276
"metadata": {},
276277
"outputs": [],
277278
"source": [
278-
"show(bande_1, vmin=60, vmax=200, cmap = \"gray\")"
279+
"show(bande_1, vmin=60, vmax=200, cmap=\"gray\")"
279280
]
280281
},
281282
{
@@ -301,7 +302,9 @@
301302
"metadata": {},
302303
"outputs": [],
303304
"source": [
304-
"deep_b, b, g, y, r, r_edge, nir, water_v = (img.read(i) for i in (1,2,3,4,5,6,7,8))"
305+
"deep_b, b, g, y, r, r_edge, nir, water_v = (\n",
306+
" img.read(i) for i in (1, 2, 3, 4, 5, 6, 7, 8)\n",
307+
")"
305308
]
306309
},
307310
{
@@ -339,7 +342,7 @@
339342
},
340343
"outputs": [],
341344
"source": [
342-
"show(img.read([3,2,1]))"
345+
"show(img.read([3, 2, 1]))"
343346
]
344347
},
345348
{

0 commit comments

Comments
 (0)