diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 748d728..01ec88e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.14.3 + rev: v0.15.15 hooks: # Run the linter. - id: ruff diff --git a/notebooks/tp_insa/01_introduction_generale_fr.ipynb b/notebooks/tp_insa/01_introduction_generale_fr.ipynb index cb4a473..ca3c690 100644 --- a/notebooks/tp_insa/01_introduction_generale_fr.ipynb +++ b/notebooks/tp_insa/01_introduction_generale_fr.ipynb @@ -109,7 +109,11 @@ "metadata": {}, "outputs": [], "source": [ - "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)" + "print(\n", + " \"Je vais dire plusieurs fois que la télédétection c'est super.\",\n", + " \"Je vous propose de tenir un décompte, pour l'instant ça fait :\",\n", + " 7,\n", + ")" ] }, { @@ -214,7 +218,7 @@ "outputs": [], "source": [ "age = 40\n", - "f'J\\'ai {age} ans'" + "f\"J'ai {age} ans\"" ] }, { @@ -484,7 +488,7 @@ "pixel_rgb = [37, 150, 190]\n", "pixel_nir = [0]\n", "\n", - "pixel_rgbnir = pixel_rgb + pixel_nir \n", + "pixel_rgbnir = pixel_rgb + pixel_nir\n", "print(pixel_rgbnir)" ] }, @@ -507,7 +511,9 @@ "outputs": [], "source": [ "pixel_nir = pixel_rgbnir.pop()\n", - "print(f'On récupère le pixel NIR : {pixel_nir} et le pixel RGB qui a perdu son NIR : {pixel_rgbnir}')" + "print(\n", + " f\"On récupère le pixel NIR : {pixel_nir} et le pixel RGB qui a perdu son NIR : {pixel_rgbnir}\"\n", + ")" ] }, { @@ -533,10 +539,7 @@ "metadata": {}, "outputs": [], "source": [ - "mon_point = {\n", - " \"type\" : \"Point\",\n", - " \"coordonnees\" : [-71, 41]\n", - " }" + "mon_point = {\"type\": \"Point\", \"coordonnees\": [-71, 41]}" ] }, { @@ -608,7 +611,7 @@ "metadata": {}, "outputs": [], "source": [ - "pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]\n" + "pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]" ] }, { @@ -650,7 +653,7 @@ "source": [ "pixel_rgbnir = [120, 100, 110, 20]\n", "\n", - "for color in pixel_rgbnir :\n", + "for color in pixel_rgbnir:\n", " print(color)" ] }, @@ -691,7 +694,7 @@ "metadata": {}, "outputs": [], "source": [ - "pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]\n" + "pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]" ] }, { @@ -715,6 +718,7 @@ "def bravo_la_teledec():\n", " print(\"La télédétection c'est vraiment super !\")\n", "\n", + "\n", "bravo_le_sertit()" ] }, @@ -727,6 +731,7 @@ "def bravo_le_(nom_entreprise):\n", " print(\"Le\", nom_entreprise, \"c'est vraiment super !\")\n", "\n", + "\n", "bravo_le_(\"sertit\")" ] }, @@ -805,6 +810,7 @@ "def bravo_le_(nom_entreprise=\"sertit\"):\n", " print(\"Le\", nom_entreprise, \"c'est vraiment super !\")\n", "\n", + "\n", "bravo_le_()\n", "bravo_le_(\"laboratoire icube\")" ] @@ -826,6 +832,7 @@ " nom_entreprise_caché = \"laboratoire icube\"\n", " print(\"Le\", nom_entreprise, \"c'est vraiment super !\")\n", "\n", + "\n", "bravo_le_()\n", "print(nom_entreprise_caché)" ] @@ -843,11 +850,13 @@ "metadata": {}, "outputs": [], "source": [ - "nom_entreprise=\"sertit\"\n", + "nom_entreprise = \"sertit\"\n", + "\n", "\n", "def bravo_le_():\n", " nom_entreprise = \"laboratoire icube\"\n", "\n", + "\n", "print(\"Le\", nom_entreprise, \"c'est vraiment super !\")" ] }, @@ -864,12 +873,14 @@ "metadata": {}, "outputs": [], "source": [ - "nom_entreprise=\"sertit\"\n", + "nom_entreprise = \"sertit\"\n", + "\n", "\n", "def bravo_le_(nom_entreprise):\n", " nom_entreprise = \"laboratoire icube\"\n", " return nom_entreprise\n", "\n", + "\n", "nom_entreprise = bravo_le_(nom_entreprise)\n", "print(\"Le\", nom_entreprise, \"c'est vraiment super !\")" ] @@ -972,7 +983,7 @@ "import numpy as np\n", "\n", "# Création d'une fonction de 2x3\n", - "m = np.arange(0, 6).reshape([2,3])\n", + "m = np.arange(0, 6).reshape([2, 3])\n", "print(m)" ] }, @@ -1111,7 +1122,8 @@ "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", - "plt.imshow(image_rgbnir[:,:,:3])" + "\n", + "plt.imshow(image_rgbnir[:, :, :3])" ] }, { @@ -1144,8 +1156,8 @@ "source": [ "# Pour afficher le résultat\n", "\n", - "#water_pixels = votre résultat\n", - "#plt.imshow(water_pixels)" + "# water_pixels = votre résultat\n", + "# plt.imshow(water_pixels)" ] }, { diff --git a/notebooks/tp_insa/02_intro_manipulation_images_fr.ipynb b/notebooks/tp_insa/02_intro_manipulation_images_fr.ipynb index 1f7347a..ae162c0 100644 --- a/notebooks/tp_insa/02_intro_manipulation_images_fr.ipynb +++ b/notebooks/tp_insa/02_intro_manipulation_images_fr.ipynb @@ -39,7 +39,6 @@ "source": [ "# Imports indispensables\n", "\n", - "from matplotlib import pyplot\n", "import rasterio\n", "from rasterio.plot import show\n", "from rasterio.plot import show_hist\n", @@ -71,7 +70,9 @@ "metadata": {}, "outputs": [], "source": [ - "img = rasterio.open(\"https://maxar-opendata.s3.amazonaws.com/events/Belize-Wildfires-June24/ard/16/033131010232/2024-05-02/10300100F9791C00-ms.tif\")" + "img = rasterio.open(\n", + " \"https://maxar-opendata.s3.amazonaws.com/events/Belize-Wildfires-June24/ard/16/033131010232/2024-05-02/10300100F9791C00-ms.tif\"\n", + ")" ] }, { @@ -89,7 +90,7 @@ "metadata": {}, "outputs": [], "source": [ - "#Tapez le nom de la variable ici\n" + "# Tapez le nom de la variable ici\n" ] }, { @@ -231,7 +232,7 @@ "metadata": {}, "outputs": [], "source": [ - "show(bande_1, cmap = \"gray\")" + "show(bande_1, cmap=\"gray\")" ] }, { @@ -275,7 +276,7 @@ "metadata": {}, "outputs": [], "source": [ - "show(bande_1, vmin=60, vmax=200, cmap = \"gray\")" + "show(bande_1, vmin=60, vmax=200, cmap=\"gray\")" ] }, { @@ -301,7 +302,9 @@ "metadata": {}, "outputs": [], "source": [ - "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))" + "deep_b, b, g, y, r, r_edge, nir, water_v = (\n", + " img.read(i) for i in (1, 2, 3, 4, 5, 6, 7, 8)\n", + ")" ] }, { @@ -339,7 +342,7 @@ }, "outputs": [], "source": [ - "show(img.read([3,2,1]))" + "show(img.read([3, 2, 1]))" ] }, {