Layout uniforme WebP: axes fixes + aspect='equal' pour superposition géolocalisée
- Positions d'axes fixes (data_left/bottom/width/height_frac) pour alignement pixel-parfait entre terrain et ortho/topo - aspect='equal' au lieu de 'auto' pour conserver les proportions géographiques - Colorbar descriptive pour les visualisations RGB (ortho/topo) - Comblage des petits trous DTM (< 1m) via rasterio.fill.fillnodata - Suppression de la visualisation "dépressions" - Hillshade composite: 0.7*hillshade + 0.3*cos(slope) - D8 flow accumulation accéléré par numba JIT (fallback Python) - Flag --keep-tif pour conserver les TIFF intermédiaires - --force supprime aussi les TIF existants avant régénération - ETA affiché pendant la génération des visualisations - Répertoires temp dans temp/ pour traitement parallèle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@ -17,6 +17,7 @@ class TestCLIParsing:
|
||||
parser.add_argument("-w", "--workers", type=int, default=1)
|
||||
parser.add_argument("-f", "--force", action="store_true")
|
||||
parser.add_argument("--file", nargs="+", type=str, default=None)
|
||||
parser.add_argument("--keep-tif", action="store_true")
|
||||
|
||||
args = parser.parse_args(["./input"])
|
||||
assert args.input == "./input"
|
||||
@ -25,6 +26,7 @@ class TestCLIParsing:
|
||||
assert args.workers == 1
|
||||
assert args.force is False
|
||||
assert args.file is None
|
||||
assert args.keep_tif is False
|
||||
|
||||
def test_file_flag_single(self):
|
||||
import argparse
|
||||
@ -65,7 +67,7 @@ class TestSetupLogging:
|
||||
assert len(logger.handlers) == 1
|
||||
# Format should not include timestamps
|
||||
fmt = logger.handlers[0].formatter._fmt
|
||||
assert "%(asctime)" not in fmt
|
||||
assert "%(asctime)s" not in fmt
|
||||
|
||||
def test_verbose_logging(self):
|
||||
"""Verbose logging includes timestamps."""
|
||||
@ -73,7 +75,7 @@ class TestSetupLogging:
|
||||
from lidar_pipeline.cli import setup_logging
|
||||
logger = setup_logging(verbose=True, debug=False)
|
||||
fmt = logger.handlers[0].formatter._fmt
|
||||
assert "%(asctime)" in fmt
|
||||
assert "%(asctime)s" in fmt
|
||||
|
||||
def test_debug_logging(self):
|
||||
"""Debug logging includes file:line info."""
|
||||
@ -82,5 +84,5 @@ class TestSetupLogging:
|
||||
logger = setup_logging(verbose=False, debug=True)
|
||||
assert logger.level == logging.DEBUG
|
||||
fmt = logger.handlers[0].formatter._fmt
|
||||
assert "%(filename)" in fmt
|
||||
assert "%(lineno)" in fmt
|
||||
assert "%(filename)s" in fmt
|
||||
assert "%(lineno)d" in fmt
|
||||
@ -11,12 +11,12 @@ def test_has_gpu_attribute():
|
||||
|
||||
|
||||
def test_to_gpu_returns_array():
|
||||
"""to_gpu returns a float64 array with correct values."""
|
||||
"""to_gpu returns a float32 array with correct values."""
|
||||
from lidar_pipeline.gpu import to_gpu, to_cpu, HAS_GPU
|
||||
arr = np.array([1.0, 2.0, 3.0])
|
||||
result = to_gpu(arr)
|
||||
# On GPU: cupy.ndarray, on CPU: numpy.ndarray
|
||||
assert result.dtype == np.float64
|
||||
# to_gpu converts to float32 to reduce GPU memory usage
|
||||
assert result.dtype == np.float32
|
||||
# Always bring back to CPU for comparison
|
||||
np.testing.assert_array_equal(to_cpu(result), [1.0, 2.0, 3.0])
|
||||
|
||||
|
||||
@ -26,9 +26,9 @@ class TestVizSteps:
|
||||
assert "solar" not in names
|
||||
|
||||
def test_expected_visualization_count(self):
|
||||
"""Should have 19 visualizations (18 terrain + ortho + topo - solar)."""
|
||||
"""Should have 17 visualizations (15 terrain + ortho + topo)."""
|
||||
from lidar_pipeline.pipeline import VIZ_STEPS
|
||||
assert len(VIZ_STEPS) == 19
|
||||
assert len(VIZ_STEPS) == 17
|
||||
|
||||
def test_ortho_and_topo_present(self):
|
||||
from lidar_pipeline.pipeline import VIZ_STEPS
|
||||
|
||||
@ -141,13 +141,6 @@ class TestTPI:
|
||||
assert result.exists()
|
||||
|
||||
|
||||
class TestDepressions:
|
||||
def test_generates_tif(self, synthetic_dem, tmp_output_dir):
|
||||
from lidar_pipeline.visualizations import generate_depressions
|
||||
result = generate_depressions(synthetic_dem, "test", tmp_output_dir, 5.0)
|
||||
assert result is not None
|
||||
assert result.exists()
|
||||
|
||||
|
||||
class TestSAILORE:
|
||||
def test_generates_tif(self, synthetic_dem, tmp_output_dir):
|
||||
|
||||
Reference in New Issue
Block a user