Suppression éclairage solaire, GPU accéléré, --file multi, tests unitaires
- Suppression de generate_solar (éclairage solaire) des visualisations - Accélération GPU de hillshade, slope, aspect, curvature, depressions, anomalies, roughness, texture GLCM, flow (sink filling) - Nettoyage mémoire GPU entre visualisations (gpu_cleanup) - Correction OOM texture GLCM: calcul entropie bin par bin au lieu d'un tableau 3D massif sur GPU - Correction bug: xp_minimum_filter manquant dans imports visualizations - Option --file accepte plusieurs noms complets sans extension - run.sh affiche l'aide si appelé sans arguments - Option --test pour exécuter les tests unitaires dans Docker - Filtre ReturnNumber>=1 intégré dans le pipeline PDAL (plus d'erreur SMRF) - 60 tests unitaires: GPU, visualisations, rendering, DTM, pipeline, CLI - Ajout pytest au Dockerfile Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
79
lidar_pipeline/tests/test_pipeline.py
Normal file
79
lidar_pipeline/tests/test_pipeline.py
Normal file
@ -0,0 +1,79 @@
|
||||
"""Tests for pipeline orchestration."""
|
||||
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class TestVizSteps:
|
||||
def test_viz_steps_not_empty(self):
|
||||
from lidar_pipeline.pipeline import VIZ_STEPS
|
||||
assert len(VIZ_STEPS) > 0
|
||||
|
||||
def test_viz_steps_have_callable_functions(self):
|
||||
from lidar_pipeline.pipeline import VIZ_STEPS
|
||||
for name, func in VIZ_STEPS:
|
||||
assert callable(func), f"VIZ_STEPS entry '{name}' is not callable"
|
||||
|
||||
def test_viz_steps_names_unique(self):
|
||||
from lidar_pipeline.pipeline import VIZ_STEPS
|
||||
names = [name for name, _ in VIZ_STEPS]
|
||||
assert len(names) == len(set(names)), "VIZ_STEPS has duplicate names"
|
||||
|
||||
def test_no_solar_in_viz_steps(self):
|
||||
"""Solar visualization was removed."""
|
||||
from lidar_pipeline.pipeline import VIZ_STEPS
|
||||
names = [name for name, _ in VIZ_STEPS]
|
||||
assert "solar" not in names
|
||||
|
||||
def test_expected_visualization_count(self):
|
||||
"""Should have 19 visualizations (18 terrain + ortho + topo - solar)."""
|
||||
from lidar_pipeline.pipeline import VIZ_STEPS
|
||||
assert len(VIZ_STEPS) == 19
|
||||
|
||||
def test_ortho_and_topo_present(self):
|
||||
from lidar_pipeline.pipeline import VIZ_STEPS
|
||||
names = [name for name, _ in VIZ_STEPS]
|
||||
assert "ortho" in names
|
||||
assert "topo" in names
|
||||
|
||||
|
||||
class TestLidarArchaeoPipeline:
|
||||
def test_init_creates_dirs(self, tmp_path):
|
||||
from lidar_pipeline.pipeline import LidarArchaeoPipeline
|
||||
input_dir = tmp_path / "input"
|
||||
input_dir.mkdir()
|
||||
output_dir = tmp_path / "output"
|
||||
|
||||
pipeline = LidarArchaeoPipeline(str(input_dir), str(output_dir))
|
||||
assert (tmp_path / "output").exists()
|
||||
assert (tmp_path / "output" / "DTM").exists()
|
||||
assert (tmp_path / "output" / "visualisations").exists()
|
||||
assert (tmp_path / "output" / "rapports").exists()
|
||||
|
||||
def test_init_raises_on_missing_input(self, tmp_path):
|
||||
from lidar_pipeline.pipeline import LidarArchaeoPipeline
|
||||
with pytest.raises(ValueError, match="introuvable"):
|
||||
LidarArchaeoPipeline("/nonexistent/path", str(tmp_path / "output"))
|
||||
|
||||
def test_find_laz_files_empty(self, tmp_path):
|
||||
from lidar_pipeline.pipeline import LidarArchaeoPipeline
|
||||
input_dir = tmp_path / "input"
|
||||
input_dir.mkdir()
|
||||
pipeline = LidarArchaeoPipeline(str(input_dir), str(tmp_path / "output"))
|
||||
files = pipeline.find_laz_files()
|
||||
assert files == []
|
||||
|
||||
def test_find_laz_files(self, tmp_path):
|
||||
from lidar_pipeline.pipeline import LidarArchaeoPipeline
|
||||
input_dir = tmp_path / "input"
|
||||
input_dir.mkdir()
|
||||
(input_dir / "test.laz").touch()
|
||||
(input_dir / "other.las").touch()
|
||||
(input_dir / "readme.txt").touch()
|
||||
|
||||
pipeline = LidarArchaeoPipeline(str(input_dir), str(tmp_path / "output"))
|
||||
files = pipeline.find_laz_files()
|
||||
names = [f.name for f in files]
|
||||
assert "test.laz" in names
|
||||
assert "other.las" in names
|
||||
assert "readme.txt" not in names
|
||||
Reference in New Issue
Block a user