From c92684772e75ae6d4af02f2993664f2de155c267 Mon Sep 17 00:00:00 2001 From: Lea Vauchier Date: Mon, 23 Jun 2025 15:47:56 +0200 Subject: [PATCH 1/3] Update dependencies --- configs/config_control.yaml | 2 +- configs/config_metadata.yaml | 2 +- ctview/map_DXM.py | 14 +++++++------- environment.yml | 8 ++++---- requirements.txt | 2 -- 5 files changed, 13 insertions(+), 15 deletions(-) delete mode 100644 requirements.txt diff --git a/configs/config_control.yaml b/configs/config_control.yaml index 7553f08..4c612d1 100644 --- a/configs/config_control.yaml +++ b/configs/config_control.yaml @@ -88,7 +88,7 @@ class_map: - {value: 202, description: "Candidats Batiment", color: [255, 128, 128]} dxm_filter: # Paramètres pour le calcul du MNS (utilisé pour l'ombrage), dimension à filtrer et # valeur à garder, par défaut on utilise la dimension créée dans la phase de preprocessing - # des produits dérivés + # de las_digital_models dimension: dsm_marker keep_values: [1] post_processing: # Traitements à appliquer à la carte de classe diff --git a/configs/config_metadata.yaml b/configs/config_metadata.yaml index e4b8df5..b8318bc 100644 --- a/configs/config_metadata.yaml +++ b/configs/config_metadata.yaml @@ -96,7 +96,7 @@ class_map: - {value: 162, description: "VirtPont", color: [85, 97, 137]} dxm_filter: # Paramètres pour le calcul du MNS (utilisé pour l'ombrage), dimension à filtrer et # valeur à garder, par défaut on utilise la dimension créée dans la phase de preprocessing - # des produits dérivés + # de las_digital_models dimension: dsm_marker keep_values: [1] post_processing: # Traitements à appliquer à la carte de classe diff --git a/ctview/map_DXM.py b/ctview/map_DXM.py index ad89f7c..7cf5652 100644 --- a/ctview/map_DXM.py +++ b/ctview/map_DXM.py @@ -3,7 +3,7 @@ import tempfile from typing import List -import produits_derives_lidar.ip_one_tile +import las_digital_models.ip_one_tile from omegaconf import DictConfig from osgeo_utils import gdal_calc @@ -19,10 +19,10 @@ def create_raw_dxm( config_io: DictConfig, ): """Create a Digital Model (DSM or DTM) using the filter defined with - dxm_filter_dimension/dxm_filter_keep_values using the produits_derives_lidar + dxm_filter_dimension/dxm_filter_keep_values using the las_digital_models library - WARNING: the dtm bounds are inferred from the filename inside the produits_derives_lidar library + WARNING: the dtm bounds are inferred from the filename inside the las_digital_models library (dtm is not computed on the potential additional buffer) Args: @@ -42,10 +42,10 @@ def create_raw_dxm( } cf. configs/config_control.yaml for an example. The config will be completed with pixel_size, dxm_filter_dimension and dxm_filter_keep_values - to match produits_derive_lidar configuration expectations + to match las_digital_models configuration expectations """ - # Generate config that suits for produits_derive_lidar interpolation + # Generate config that suits for las_digital_models interpolation pdl_config = {} spatial_ref = ( f"EPSG:{config_io.spatial_reference}" @@ -60,7 +60,7 @@ def create_raw_dxm( log.debug("Config for dxm generation") log.debug(pdl_config) - produits_derives_lidar.ip_one_tile.interpolate_from_config( + las_digital_models.ip_one_tile.interpolate_from_config( input_file=input_file, output_raster=output_dxm, config=pdl_config ) @@ -104,7 +104,7 @@ def add_dxm_hillshade_to_raster( } cf. configs/config_control.yaml for an example ("io" subdivision) The config will be completed with pixel_size, dxm_filter_dimension and dxm_filter_keep_values - to match produits_derive_lidar configuration expectations + to match las_digital_models configuration expectations """ os.makedirs(os.path.dirname(output_dxm_raw), exist_ok=True) os.makedirs(os.path.dirname(output_dxm_hillshade), exist_ok=True) diff --git a/environment.yml b/environment.yml index b2215ef..760d015 100644 --- a/environment.yml +++ b/environment.yml @@ -5,8 +5,8 @@ channels: dependencies: - python=3.11.* - pip - - conda-forge:pdal==2.7.* - - conda-forge:python-pdal==3.4.* + - conda-forge:pdal>=2.8 + - conda-forge:python-pdal>=3.4 - gdal>=3.9 # To get the "nearest" interpolation option for FillNoData - laspy - numpy @@ -23,5 +23,5 @@ dependencies: - ipython - pip: - - --extra-index-url=https://nexus.ign.fr/repository/pypi-lidarhd-hosted/simple - - -r requirements.txt \ No newline at end of file + - ign-las-digital-models==2.0.0 # after name change + - ign-pdal-tools>=1.11.1 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a63546f..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -ign-mnx==1.1.0 -ign-pdal-tools==1.7.5 From 3e84b52f6037541a5703ef9cd2c83c3279f05b9d Mon Sep 17 00:00:00 2001 From: Lea Vauchier Date: Mon, 23 Jun 2025 15:48:39 +0200 Subject: [PATCH 2/3] Clean up useless data --- TODO.md | 14 - ci/test.sh | 1 - dico/dictionnaire_LidarHD_provisoire.ptc | 765 ----------------------- dico/ramp.txt | 45 -- script/get_conda.sh | 13 - script/update_pip_dependancies.sh | 6 - 6 files changed, 844 deletions(-) delete mode 100644 TODO.md delete mode 100755 ci/test.sh delete mode 100644 dico/dictionnaire_LidarHD_provisoire.ptc delete mode 100644 dico/ramp.txt delete mode 100755 script/get_conda.sh delete mode 100755 script/update_pip_dependancies.sh diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 675bf98..0000000 --- a/TODO.md +++ /dev/null @@ -1,14 +0,0 @@ -- config ajouter commentaire dans le fichier de config, par exemple pour les keep_classes ex: - [2] # seule la classe 2 (bâtiments) sera dans la bande 1 - -- Lidar Express rajouter fichier de config pour metadata - -- Mettre à jour le README (cela n'a pas été fait depuis le version `0.3.0`) - -- Mettre à jour les exemples `exemple_ctview_default.sh` `exemple_ctview_fast` et `exemple_metadata_fast` qui fonctionnent avec la version `0.3.0` - -- Faire le ménage dans le fichiers de test : exemple : le laz de test dans `data/laz/water` ne contient que des points virtuels et pas des points eau. Soit le renommer soit prendre un laz qui ne contient effectivement que des points eau. - -- Vérifier que les fichiers `dico/ramp.txt` et `dico/dictionnaire_LidarHD_provisoire.ptc` sont utilisés - -- Tester/Supprimer les mains ne se trouvant pas dans les fichiers `main_ctview` ou `main_metadata` - diff --git a/ci/test.sh b/ci/test.sh deleted file mode 100755 index 823d3d8..0000000 --- a/ci/test.sh +++ /dev/null @@ -1 +0,0 @@ -python -m pytest -s ./test -v \ No newline at end of file diff --git a/dico/dictionnaire_LidarHD_provisoire.ptc b/dico/dictionnaire_LidarHD_provisoire.ptc deleted file mode 100644 index 0bf1629..0000000 --- a/dico/dictionnaire_LidarHD_provisoire.ptc +++ /dev/null @@ -1,765 +0,0 @@ -1 Non classes 0 -* Zero length line 1 255,255,255 1 - -2 Sol 0 -* Zero length line 2 255,128,0 1 - -3 Vegetation basse 0 -* Zero length line 2 0,255,0 1 - -4 Vegetation intermediaire 0 -* Zero length line 2 0,255,0 1 - -5 Vegetation haute 0 -* Zero length line 2 0,255,0 1 - -6 Batiment 0 -* Zero length line 6 255,0,0 1 - -7 Reserve 0 -* Zero length line 1 255,255,255 1 - -8 Reserve 0 -* Zero length line 1 255,255,255 1 - -9 Eau 0 -* Zero length line 1 0,225,225 1 - -10 Reserve 0 -* Zero length line 1 255,255,255 1 - -11 Reserve 0 -* Zero length line 1 255,255,255 1 - -12 Reserve 0 -* Zero length line 1 255,255,255 1 - -13 Reserve 0 -* Zero length line 1 255,255,255 1 - -14 Reserve 0 -* Zero length line 1 255,255,255 1 - -15 Reserve 0 -* Zero length line 1 255,255,255 1 - -16 Reserve 0 -* Zero length line 1 255,255,255 1 - -17 Pont 0 -* Zero length line 1 255,255,0 1 - -18 Reserve 0 -* Zero length line 1 255,255,255 1 - -19 Reserve 0 -* Zero length line 1 255,255,255 1 - -20 Reserve 0 -* Zero length line 1 255,255,255 1 - -21 Reserve 0 -* Zero length line 1 255,255,255 1 - -22 Reserve 0 -* Zero length line 1 255,255,255 1 - -23 Reserve 0 -* Zero length line 1 255,255,255 1 - -24 Reserve 0 -* Zero length line 1 255,255,255 1 - -25 Reserve 0 -* Zero length line 1 255,255,255 1 - -26 Reserve 0 -* Zero length line 1 255,255,255 1 - -27 Reserve 0 -* Zero length line 1 255,255,255 1 - -28 Reserve 0 -* Zero length line 1 255,255,255 1 - -29 Reserve 0 -* Zero length line 1 255,255,255 1 - -30 Reserve 0 -* Zero length line 1 255,255,255 1 - -31 Reserve 0 -* Zero length line 1 255,255,255 1 - -32 Reserve 0 -* Zero length line 1 255,255,255 1 - -33 Reserve 0 -* Zero length line 1 255,255,255 1 - -34 Reserve 0 -* Zero length line 1 255,255,255 1 - -35 Reserve 0 -* Zero length line 1 255,255,255 1 - -36 Reserve 0 -* Zero length line 1 255,255,255 1 - -37 Reserve 0 -* Zero length line 1 255,255,255 1 - -38 Reserve 0 -* Zero length line 1 255,255,255 1 - -39 Reserve 0 -* Zero length line 1 255,255,255 1 - -40 Reserve 0 -* Zero length line 1 255,255,255 1 - -41 Reserve 0 -* Zero length line 1 255,255,255 1 - -42 Reserve 0 -* Zero length line 1 255,255,255 1 - -43 Reserve 0 -* Zero length line 1 255,255,255 1 - -44 Reserve 0 -* Zero length line 1 255,255,255 1 - -45 Reserve 0 -* Zero length line 1 255,255,255 1 - -46 Reserve 0 -* Zero length line 1 255,255,255 1 - -47 Reserve 0 -* Zero length line 1 255,255,255 1 - -48 Reserve 0 -* Zero length line 1 255,255,255 1 - -49 Reserve 0 -* Zero length line 1 255,255,255 1 - -50 Reserve 0 -* Zero length line 1 255,255,255 1 - -51 Reserve 0 -* Zero length line 1 255,255,255 1 - -52 Reserve 0 -* Zero length line 1 255,255,255 1 - -53 Reserve 0 -* Zero length line 1 255,255,255 1 - -54 Reserve 0 -* Zero length line 1 255,255,255 1 - -55 Reserve 0 -* Zero length line 1 255,255,255 1 - -56 Reserve 0 -* Zero length line 1 255,255,255 1 - -57 Reserve 0 -* Zero length line 1 255,255,255 1 - -58 Reserve 0 -* Zero length line 1 255,255,255 1 - -59 Reserve 0 -* Zero length line 1 255,255,255 1 - -60 Reserve 0 -* Zero length line 1 255,255,255 1 - -61 Reserve 0 -* Zero length line 1 255,255,255 1 - -62 Reserve 0 -* Zero length line 1 255,255,255 1 - -63 Reserve 0 -* Zero length line 1 255,255,255 1 - -64 Sursol perenne 0 -* Zero length line 254 128,0,64 1 - -65 Artefact 0 -* Zero length line 65 64,0,128 1 - -66 Point virtuel 0 -* Zero length line 66 255,0,255 1 - -67 Reserve 0 -* Zero length line 1 255,255,255 1 - -68 Reserve 0 -* Zero length line 1 255,255,255 1 - -69 Reserve 0 -* Zero length line 1 255,255,255 1 - -70 Reserve 0 -* Zero length line 1 255,255,255 1 - -71 Reserve 0 -* Zero length line 1 255,255,255 1 - -72 Reserve 0 -* Zero length line 1 255,255,255 1 - -73 Reserve 0 -* Zero length line 1 255,255,255 1 - -74 Reserve 0 -* Zero length line 1 255,255,255 1 - -75 Reserve 0 -* Zero length line 1 255,255,255 1 - -76 Reserve 0 -* Zero length line 1 255,255,255 1 - -77 Reserve 0 -* Zero length line 1 255,255,255 1 - -78 Reserve 0 -* Zero length line 1 255,255,255 1 - -79 Reserve 0 -* Zero length line 1 255,255,255 1 - -80 Reserve 0 -* Zero length line 1 255,255,255 1 - -81 Reserve 0 -* Zero length line 1 255,255,255 1 - -82 Reserve 0 -* Zero length line 1 255,255,255 1 - -83 Libre 0 -* Zero length line 1 255,255,255 1 - -84 Libre 0 -* Zero length line 1 255,255,255 1 - -85 Libre 0 -* Zero length line 1 255,255,255 1 - -86 Libre 0 -* Zero length line 1 255,255,255 1 - -87 Libre 0 -* Zero length line 1 255,255,255 1 - -88 Libre 0 -* Zero length line 1 255,255,255 1 - -89 Libre 0 -* Zero length line 1 255,255,255 1 - -90 Libre 0 -* Zero length line 1 255,255,255 1 - -91 Libre 0 -* Zero length line 1 255,255,255 1 - -92 Libre 0 -* Zero length line 1 255,255,255 1 - -93 Libre 0 -* Zero length line 1 255,255,255 1 - -94 Libre 0 -* Zero length line 1 255,255,255 1 - -95 Libre 0 -* Zero length line 1 255,255,255 1 - -96 Libre 0 -* Zero length line 1 255,255,255 1 - -97 Libre 0 -* Zero length line 1 255,255,255 1 - -98 Libre 0 -* Zero length line 1 255,255,255 1 - -99 Libre 0 -* Zero length line 1 255,255,255 1 - -100 Temp_Elodie 0 -* Zero length line 100 128,0,160 0 - -101 Temp1_Elodie 0 -* Zero length line 101 0,0,165 0 - -102 Temp2_Elodie 0 -* Zero length line 102 128,128,192 0 - -103 Temp3_Elodie 0 -* Zero length line 103 255,255,0 0 - -104 Temp4_Elodie 0 -* Zero length line 104 255,0,255 0 - -105 Temp5_Elodie 0 -* Zero length line 105 192,192,192 0 - -106 Temp6_Elodie 0 -* Zero length line 106 165,165,0 0 - -107 Temp7_Elodie 0 -* Zero length line 107 165,0,0 0 - -108 Temp8_Elodie 0 -* Zero length line 108 0,165,0 0 - -109 Temp9_Elodie 0 -* Zero length line 109 255,192,255 0 - -110 Analyse_refuteIA 0 -* Zero length line 110 0,128,128 0 - -111 Analyse_IncertainRefuteIAValide 0 -* Zero length line 111 192,158,254 0 - -112 Analyse_IncertainIATopo 0 -* Zero length line 112 160,66,255 0 - -113 Analyse_ValideIA 0 -* Zero length line 113 244,115,100 0 - -114 Analyse_ValideTopo 0 -* Zero length line 114 245,146,112 0 - -115 Analyse_ValideIATopo 0 -* Zero length line 115 226,37,16 0 - -116 Temp6_Floryne 0 -* Zero length line 116 165,165,0 0 - -117 Temp7_Floryne 0 -* Zero length line 117 165,0,0 0 - -118 Temp8_Floryne 0 -* Zero length line 118 0,165,0 0 - -119 Temp9_Floryne 0 -* Zero length line 119 255,192,255 0 - -120 Temp_Guillaume 0 -* Zero length line 120 128,0,160 0 - -121 Temp1_Guillaume 0 -* Zero length line 121 0,0,165 0 - -122 Temp2_Guillaume 0 -* Zero length line 122 128,128,192 0 - -123 Temp3_Guillaume 0 -* Zero length line 123 255,255,0 0 - -124 Temp4_Guillaume 0 -* Zero length line 124 255,0,255 0 - -125 Temp5_Guillaume 0 -* Zero length line 125 192,192,192 0 - -126 Temp6_Guillaume 0 -* Zero length line 126 165,165,0 0 - -127 Temp7_Guillaume 0 -* Zero length line 127 165,0,0 0 - -128 Temp8_Guillaume 0 -* Zero length line 128 0,165,0 0 - -129 Temp9_Guillaume 0 -* Zero length line 129 255,192,255 0 - -130 Temp_Hugo 0 -* Zero length line 130 128,0,160 0 - -131 Temp1_Hugo 0 -* Zero length line 131 0,0,165 0 - -132 Temp2_Hugo 0 -* Zero length line 132 128,128,192 0 - -133 Temp3_Hugo 0 -* Zero length line 133 255,255,0 0 - -134 Temp4_Hugo 0 -* Zero length line 134 255,0,255 0 - -135 Temp5_Hugo 0 -* Zero length line 135 192,192,192 0 - -136 Temp6_Hugo 0 -* Zero length line 136 165,165,0 0 - -137 Temp7_Hugo 0 -* Zero length line 137 165,0,0 0 - -138 Temp8_Hugo 0 -* Zero length line 138 0,165,0 0 - -139 Temp9_Hugo 0 -* Zero length line 139 255,192,255 0 - -140 Temp_Thomas 0 -* Zero length line 140 128,0,160 0 - -141 Temp1_Thomas 0 -* Zero length line 141 0,0,165 0 - -142 Temp2_Thomas 0 -* Zero length line 142 128,128,192 0 - -143 Temp3_Thomas 0 -* Zero length line 143 255,255,0 0 - -144 Temp4_Thomas 0 -* Zero length line 144 255,0,255 0 - -145 Temp5_Thomas 0 -* Zero length line 145 192,192,192 0 - -146 Temp6_Thomas 0 -* Zero length line 146 165,165,0 0 - -147 Temp7_Thomas 0 -* Zero length line 147 165,0,0 0 - -148 Temp8_Thomas 0 -* Zero length line 148 0,165,0 0 - -149 Temp9_Thomas 0 -* Zero length line 149 255,192,255 0 - -150 Temp_Tristan 0 -* Zero length line 150 128,0,160 0 - -151 Temp1_Tristan 0 -* Zero length line 151 0,0,165 0 - -152 Temp2_Tristan 0 -* Zero length line 152 128,128,192 0 - -153 Temp3_Tristan 0 -* Zero length line 153 255,255,0 0 - -154 Temp4_Tristan 0 -* Zero length line 154 255,0,255 0 - -155 Temp5_Tristan 0 -* Zero length line 155 192,192,192 0 - -156 Temp6_Tristan 0 -* Zero length line 156 165,165,0 0 - -157 Temp7_Tristan 0 -* Zero length line 157 165,0,0 0 - -158 Temp8_Tristan 0 -* Zero length line 158 0,165,0 0 - -159 Temp9_Tristan 0 -* Zero length line 159 255,192,255 0 - -160 Libre 0 -* Zero length line 1 255,255,255 1 - -161 Libre 0 -* Zero length line 1 255,255,255 1 - -162 Libre 0 -* Zero length line 1 255,255,255 1 - -163 Libre 0 -* Zero length line 1 255,255,255 1 - -164 Libre 0 -* Zero length line 1 255,255,255 1 - -165 Libre 0 -* Zero length line 1 255,255,255 1 - -166 Libre 0 -* Zero length line 1 255,255,255 1 - -167 Libre 0 -* Zero length line 1 255,255,255 1 - -168 Libre 0 -* Zero length line 1 255,255,255 1 - -169 Libre 0 -* Zero length line 1 255,255,255 1 - -170 Libre 0 -* Zero length line 1 255,255,255 1 - -171 Libre 0 -* Zero length line 1 255,255,255 1 - -172 Libre 0 -* Zero length line 1 255,255,255 1 - -173 Libre 0 -* Zero length line 1 255,255,255 1 - -174 Libre 0 -* Zero length line 1 255,255,255 1 - -175 Libre 0 -* Zero length line 1 255,255,255 1 - -176 Libre 0 -* Zero length line 1 255,255,255 1 - -177 Libre 0 -* Zero length line 1 255,255,255 1 - -178 Libre 0 -* Zero length line 1 255,255,255 1 - -179 Libre 0 -* Zero length line 1 255,255,255 1 - -180 Libre 0 -* Zero length line 1 255,255,255 1 - -181 Libre 0 -* Zero length line 1 255,255,255 1 - -182 Libre 0 -* Zero length line 1 255,255,255 1 - -183 Libre 0 -* Zero length line 1 255,255,255 1 - -184 Libre 0 -* Zero length line 1 255,255,255 1 - -185 Libre 0 -* Zero length line 1 255,255,255 1 - -186 Libre 0 -* Zero length line 1 255,255,255 1 - -187 Libre 0 -* Zero length line 1 255,255,255 1 - -188 Libre 0 -* Zero length line 1 255,255,255 1 - -189 Libre 0 -* Zero length line 1 255,255,255 1 - -190 Libre 0 -* Zero length line 1 255,255,255 1 - -191 Libre 0 -* Zero length line 1 255,255,255 1 - -192 Libre 0 -* Zero length line 1 255,255,255 1 - -193 Libre 0 -* Zero length line 1 255,255,255 1 - -194 Libre 0 -* Zero length line 1 255,255,255 1 - -195 Libre 0 -* Zero length line 1 255,255,255 1 - -196 Libre 0 -* Zero length line 1 255,255,255 1 - -197 Libre 0 -* Zero length line 1 255,255,255 1 - -198 Libre 0 -* Zero length line 1 255,255,255 1 - -199 Libre 0 -* Zero length line 1 255,255,255 1 - -200 Libre 0 -* Zero length line 1 255,255,255 1 - -201 Candidats Sol 0 -* Zero length line 2 255,192,0 1 - -202 Candidats Batiment 0 -* Zero length line 6 255,128,128 1 - -203 Candidats Vegetation 0 -* Zero length line 6 192,255,192 1 - -204 Candidats Pont 0 -* Zero length line 6 255,255,192 1 - -205 Candidats Sursol perenne 0 -* Zero length line 254 128,128,192 1 - -206 Candidats Eau 0 -* Zero length line 6 224,255,255 1 - -207 Refutes Sol 0 -* Zero length line 2 255,192,0 1 - -208 Refutes Batiment 0 -* Zero length line 6 0,128,128 1 - -209 Refutes Vegetation 0 -* Zero length line 6 192,255,192 1 - -210 Refutes Pont 0 -* Zero length line 6 255,255,192 1 - -211 Refutes Sursol perenne 0 -* Zero length line 254 128,128,192 1 - -212 Refutes Eau 0 -* Zero length line 6 224,255,255 1 - -213 Incertains Sol 0 -* Zero length line 2 255,192,0 1 - -214 Incertains Batiment 0 -* Zero length line 6 160,66,255 1 - -215 Incertains Vegetation 0 -* Zero length line 6 192,255,192 1 - -216 Incertains Pont 0 -* Zero length line 6 255,255,192 1 - -217 Incertains Sursol perenne 0 -* Zero length line 254 128,128,192 1 - -218 Incertains Eau 0 -* Zero length line 6 224,255,255 1 - -219 Libre 0 -* Zero length line 1 255,255,255 1 - -220 Libre 0 -* Zero length line 1 255,255,255 1 - -221 Libre 0 -* Zero length line 1 255,255,255 1 - -222 Libre 0 -* Zero length line 1 255,255,255 1 - -223 Libre 0 -* Zero length line 1 255,255,255 1 - -224 Libre 0 -* Zero length line 1 255,255,255 1 - -225 Libre 0 -* Zero length line 1 255,255,255 1 - -226 Libre 0 -* Zero length line 1 255,255,255 1 - -227 Libre 0 -* Zero length line 1 255,255,255 1 - -228 Libre 0 -* Zero length line 1 255,255,255 1 - -229 Libre 0 -* Zero length line 1 255,255,255 1 - -230 Libre 0 -* Zero length line 1 255,255,255 1 - -231 Libre 0 -* Zero length line 1 255,255,255 1 - -232 Libre 0 -* Zero length line 1 255,255,255 1 - -233 Libre 0 -* Zero length line 1 255,255,255 1 - -234 Libre 0 -* Zero length line 1 255,255,255 1 - -235 Libre 0 -* Zero length line 1 255,255,255 1 - -236 Libre 0 -* Zero length line 1 255,255,255 1 - -237 Libre 0 -* Zero length line 1 255,255,255 1 - -238 Libre 0 -* Zero length line 1 255,255,255 1 - -239 Libre 0 -* Zero length line 1 255,255,255 1 - -240 Libre 0 -* Zero length line 1 255,255,255 1 - -241 Libre 0 -* Zero length line 1 255,255,255 1 - -242 Libre 0 -* Zero length line 1 255,255,255 1 - -243 Libre 0 -* Zero length line 1 255,255,255 1 - -244 Libre 0 -* Zero length line 1 255,255,255 1 - -245 Libre 0 -* Zero length line 1 255,255,255 1 - -246 Libre 0 -* Zero length line 1 255,255,255 1 - -247 Libre 0 -* Zero length line 1 255,255,255 1 - -248 Libre 0 -* Zero length line 1 255,255,255 1 - -249 Libre 0 -* Zero length line 1 255,255,255 1 - -250 Libre 0 -* Zero length line 1 255,255,255 1 - -251 Libre 0 -* Zero length line 1 255,255,255 1 - -252 Libre 0 -* Zero length line 1 255,255,255 1 - -253 Libre 0 -* Zero length line 1 255,255,255 1 - -254 Libre 0 -* Zero length line 1 255,255,255 1 - -255 Libre 0 -* Zero length line 1 255,255,255 1 - diff --git a/dico/ramp.txt b/dico/ramp.txt deleted file mode 100644 index 6561c7a..0000000 --- a/dico/ramp.txt +++ /dev/null @@ -1,45 +0,0 @@ -# QGIS Generated Color Map Export File - -2 139 51 38 255 Ground - -3 143 201 157 255 Low Veg - -4 5 159 43 255 Med Veg - -5 47 250 11 255 High Veg - -6 209 151 25 255 Building - -7 232 41 7 255 Low Point - -8 197 0 204 255 reserved - -9 26 44 240 255 Water - -10 165 160 173 255 Rail - -11 81 87 81 255 Road - -12 203 210 73 255 Reserved - -13 209 228 214 255 Wire - Guard (Shield) - -14 160 168 231 255 Wire - Conductor (Phase) - -15 220 213 164 255 Transmission Tower - -16 214 211 143 255 Wire-Structure Connector (Insulator) - -17 151 98 203 255 Bridge Deck - -18 236 49 74 255 High Noise - -19 185 103 45 255 Reserved - -21 58 55 9 255 255 Reserved - -22 76 46 58 255 255 Reserved - -23 20 76 38 255 255 Reserved - -26 78 92 32 255 255 Reserved diff --git a/script/get_conda.sh b/script/get_conda.sh deleted file mode 100755 index 78671d9..0000000 --- a/script/get_conda.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -if [[ -d ~/anaconda3/ ]]; then - source ~/anaconda3/etc/profile.d/conda.sh -fi - -if [[ -d ~/miniconda3/ ]]; then - source ~/miniconda3/etc/profile.d/conda.sh -fi - -if [[ -d ~/mambaforge/ ]]; then - source ~/mambaforge/etc/profile.d/conda.sh -fi \ No newline at end of file diff --git a/script/update_pip_dependancies.sh b/script/update_pip_dependancies.sh deleted file mode 100755 index 70e07f0..0000000 --- a/script/update_pip_dependancies.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -source script/get_conda.sh -conda activate ctview - -# re install pip dependancies, force the download of the libs, with our private repo (Nexus). -pip install -U --force-reinstall -r ./../requirements.txt --extra-index-url=https://nexus.ign.fr/repository/pypi-lidarhd-hosted/simple From eddf5325cd139ec2d70a3d1c26a09b5ea709d793 Mon Sep 17 00:00:00 2001 From: Lea Vauchier Date: Tue, 24 Jun 2025 14:06:35 +0200 Subject: [PATCH 3/3] Update deployment/ci to run on github --- .github/workflows/cicd_deploy.yml | 74 +++++++++++++++++++++++++++++++ .github/workflows/cicd_full.yml | 69 ++++++++++++++++++++++++++++ .github/workflows/cicd_light.yml | 36 +++++++++++++++ Makefile | 26 ++++++----- pyproject.toml | 10 ++--- 5 files changed, 200 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/cicd_deploy.yml create mode 100644 .github/workflows/cicd_full.yml create mode 100644 .github/workflows/cicd_light.yml diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml new file mode 100644 index 0000000..5ba786c --- /dev/null +++ b/.github/workflows/cicd_deploy.yml @@ -0,0 +1,74 @@ + +name: cicd_deploy + +on: + # Also run when the pull request merges (which generates a push) + # So that we can tag the docker image appropriately. + push: + tags: [ 'v*.*.*' ] + +env: + IMAGE_NAME: ${{ github.repository }} + REGISTRY: ghcr.io + TEST_TAG: ${{ github.repository }}:test + +jobs: + deploy_docker: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout branch + uses: actions/checkout@v4 + + - name: Build the Docker image + id: build + uses: docker/build-push-action@v6 + with: + load: true + tags: ${{ env.TEST_TAG }} + + # run the test on the docker image + - name: Run tests in docker image + run: > + docker run + ${{ env.TEST_TAG }} + python -m pytest -s + --log-cli-level=DEBUG + --log-format="%(asctime)s %(levelname)s %(message)s" + --log-date-format="%Y-%m-%d %H:%M:%S" + -m "not functional_test" + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v3.4 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + if: github.event_name != 'pull_request' + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build a Docker image with Buildx (don't on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + if: github.event_name != 'pull_request' + id: build-and-push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/cicd_full.yml b/.github/workflows/cicd_full.yml new file mode 100644 index 0000000..a54b589 --- /dev/null +++ b/.github/workflows/cicd_full.yml @@ -0,0 +1,69 @@ + +name: cicd_full + +on: + # Run tests for pull-requests on master + pull_request: + branches: + - main + # Also run when the pull request merges (which generates a push) + # So that we can tag the docker image appropriately. + push: + branches: + - dev + +env: + IMAGE_NAME: ${{ github.repository }} + REGISTRY: ghcr.io + TEST_TAG: ${{ github.repository }}:test + +jobs: + deploy_docker: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout branch + uses: actions/checkout@v4 + + - name: Build the Docker image + id: build + uses: docker/build-push-action@v6 + with: + load: true + tags: ${{ env.TEST_TAG }} + + # run the test on the docker image + - name: Run tests in docker image + run: > + docker run + ${{ env.TEST_TAG }} + python -m pytest -s + --log-cli-level=DEBUG + + test_local: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout branch + uses: actions/checkout@v4 + + # See https://github.com/marketplace/actions/setup-micromamba + - name: setup-micromamba + uses: mamba-org/setup-micromamba@v2 + with: + environment-file: environment.yml + environment-name: ctview # activate the environment + cache-environment: true + cache-downloads: true + generate-run-shell: true + + - name: Run tests with pytest + shell: micromamba-shell {0} + run: python -m pytest -s --log-cli-level=DEBUG \ No newline at end of file diff --git a/.github/workflows/cicd_light.yml b/.github/workflows/cicd_light.yml new file mode 100644 index 0000000..0d76a23 --- /dev/null +++ b/.github/workflows/cicd_light.yml @@ -0,0 +1,36 @@ +name: cicd_light + +on: + # Run tests for non-draft pull request on dev + pull_request: + branches: + - dev + + +jobs: + test_light: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout branch + uses: actions/checkout@v4 + + # See https://github.com/marketplace/actions/setup-micromamba + - name: setup-micromamba + uses: mamba-org/setup-micromamba@v2 + with: + environment-file: environment.yml + environment-name: ctview # activate the environment + cache-environment: true + cache-downloads: true + generate-run-shell: true + + - name: Run tests with pytest + shell: micromamba-shell {0} + run: python -m pytest -s --log-cli-level=DEBUG + + + diff --git a/Makefile b/Makefile index 898e2ff..5260aea 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,9 @@ +# Makefile to manage main tasks +# cf. https://blog.ianpreston.ca/conda/python/bash/2020/05/13/conda_envs.html#makefile + +# Oneshell means I can run multiple lines in a recipe in the same shell, so I don't have to +# chain commands together with semicolon +.ONESHELL: install: mamba env update -n ctview -f environment.yml @@ -6,27 +12,27 @@ install-precommit: pre-commit install testing: - ./ci/test.sh + python -m pytest -s ./test -v ############################## # Docker ############################## -PROJECT_NAME=lidar_hd/ct_view +REGISTRY=ghcr.io +NAMESPACE=ignf +IMAGE_NAME=ctview VERSION=`python -m ctview._version` -REGISTRY=docker-registry.ign.fr +FULL_IMAGE_NAME=${REGISTRY}/${NAMESPACE}/${IMAGE_NAME}:${VERSION} docker-build: - docker build -t ${PROJECT_NAME}:${VERSION} -f Dockerfile . + docker build -t ${IMAGE_NAME}:${VERSION} -f Dockerfile . docker-test: - docker run --rm -it ${PROJECT_NAME}:${VERSION} python -m pytest -s + docker run --rm ${IMAGE_NAME}:${VERSION} python -m pytest -s -m "not functional_test" docker-remove: - docker rmi -f `docker images | grep ${PROJECT_NAME} | tr -s ' ' | cut -d ' ' -f 3` - docker rmi -f `docker images -f "dangling=true" -q` + docker rmi -f `docker images | grep ${IMAGE_NAME}:${VERSION} | tr -s ' ' | cut -d ' ' -f 3` docker-deploy: - docker login docker-registry.ign.fr -u svc_lidarhd - docker tag ${PROJECT_NAME}:${VERSION} ${REGISTRY}/${PROJECT_NAME}:${VERSION} - docker push ${REGISTRY}/${PROJECT_NAME}:${VERSION} \ No newline at end of file + docker tag ${IMAGE_NAME}:${VERSION} ${FULL_IMAGE_NAME} + docker push ${FULL_IMAGE_NAME} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 258e293..90c37b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,14 +2,14 @@ name = "ctview" dynamic = ["version"] -description = "créer différentes vues opérateurs pour du contrôle de classification de nuages de points." +description = "Generate thematic maps (image views) to easily visualize the content of a point cloud (classification maps, density maps, ...)" readme = "README.md" authors = [ - { name = "Elliot Luçon", email = "elliot.lucon@ign.fr" }, - { name = "Yoann Apel", email = "yoann.apel@ign.fr" }, - { name = "Guillaume Liégard", email = "guillaume.liegard@ign.fr" }, - { name = "Léa Vauchier", email = "lea.vauchier@ign.fr" }, + { name = "Elliot Luçon", email = "elliot.lucon@ign.fr" }, + { name = "Yoann Apel", email = "yoann.apel@ign.fr" }, + { name = "Guillaume Liégard", email = "guillaume.liegard@ign.fr" }, + { name = "Léa Vauchier", email = "lea.vauchier@ign.fr" }, ] [tool.black]