Translate the whole project to English and fix outdated comments and help
Comments, docstrings, logs, CLI help, map UI, legends, PDF sheet, scripts, compose files and AGENTS.md are now English. Data keys stay unchanged (relief_oriente, densite_sol, visualisations/, API JSON keys, link params). Wrong comments and help defaults found along the way are corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
"""Tests de la mesure de qualité des dalles (densité sol, date d'acquisition)."""
|
||||
"""Tests for tile quality measurement (ground density, acquisition date)."""
|
||||
|
||||
BOUNDS = (652000.0, 6861000.0, 653000.0, 6862000.0)
|
||||
|
||||
|
||||
def _gps_seconds(year, month, day):
|
||||
"""Temps GPS ajusté standard (secondes GPS − 1e9) d'un midi UTC."""
|
||||
"""Standard adjusted GPS time (GPS seconds − 1e9) of a UTC noon."""
|
||||
from datetime import datetime, timezone
|
||||
epoch = datetime(1980, 1, 6, tzinfo=timezone.utc)
|
||||
return (datetime(year, month, day, 12, tzinfo=timezone.utc) - epoch).total_seconds() - 1e9
|
||||
@ -18,7 +18,7 @@ def test_gps_adjusted_to_date():
|
||||
def test_compute_quality_density_grid_and_dates():
|
||||
import numpy as np
|
||||
from lidar_pipeline.quality import compute_quality
|
||||
# 1 point par m² sur la moitié nord, rien au sud ; 2 dates de vol.
|
||||
# 1 point per m² on the northern half, nothing in the south; 2 flight dates.
|
||||
xs, ys = np.meshgrid(np.arange(652000.5, 653000.0, 1.0),
|
||||
np.arange(6861500.5, 6862000.0, 1.0))
|
||||
x, y = xs.ravel(), ys.ravel()
|
||||
@ -28,11 +28,11 @@ def test_compute_quality_density_grid_and_dates():
|
||||
assert abs(q["ground_density"] - 0.5) < 1e-6
|
||||
grid = q["density_grid"]
|
||||
assert len(grid) == 20 and all(len(r) == 20 for r in grid)
|
||||
assert grid[0][0] == 1.0 # ligne 0 = nord : couverte
|
||||
assert grid[19][0] == 0.0 # sud : vide
|
||||
assert grid[0][0] == 1.0 # row 0 = north: covered
|
||||
assert grid[19][0] == 0.0 # south: empty
|
||||
assert q["acq_start"] == "2023-03-15" and q["acq_end"] == "2023-03-17"
|
||||
assert q["acq_source"] == "gps"
|
||||
# 1 point par m² : 1 pixel 0,2 m sur 25 occupé au nord, aucun au sud.
|
||||
# 1 point per m²: 1 in 25 0.2 m pixels occupied in the north, none in the south.
|
||||
assert abs(q["empty_fraction"] - (1 - 0.5 / 25)) < 1e-3
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ def test_sidecar_roundtrip_and_table(tmp_path):
|
||||
base = "LHD_FXX_0652_6862_PTS_LAMB93_IGN69"
|
||||
data = {"version": 1, "ground_density": 4.2}
|
||||
assert write_quality(tmp_path, base, data) is True
|
||||
assert write_quality(tmp_path, base, data) is False # contenu identique : pas réécrit
|
||||
assert write_quality(tmp_path, base, data) is False # identical content: not rewritten
|
||||
assert quality_path(tmp_path, base).is_file()
|
||||
assert read_quality(tmp_path, base) == data
|
||||
assert load_quality_table(tmp_path) == {base: data}
|
||||
@ -83,7 +83,7 @@ def test_read_quality_rejects_other_version(tmp_path):
|
||||
|
||||
|
||||
def test_quality_module_imports_without_numpy():
|
||||
"""L'image légère n'a pas numpy : le module ne doit pas l'importer au chargement."""
|
||||
"""The lightweight image has no numpy: the module must not import it at load time."""
|
||||
import subprocess, sys
|
||||
code = ("import sys; sys.modules['numpy'] = None; "
|
||||
"import lidar_pipeline.quality as q; print(q.QUALITY_VERSION)")
|
||||
@ -92,7 +92,7 @@ def test_quality_module_imports_without_numpy():
|
||||
|
||||
|
||||
def _write_las(path, x, y, cls, t, adjusted=True, creation=None):
|
||||
"""LAS minimal (format 6 : gps_time) pour les tests."""
|
||||
"""Minimal LAS (format 6: gps_time) for the tests."""
|
||||
import laspy
|
||||
import numpy as np
|
||||
header = laspy.LasHeader(point_format=6, version="1.4")
|
||||
@ -135,7 +135,7 @@ def test_quality_from_las_week_time_uses_header_date(tmp_path):
|
||||
|
||||
def test_quality_from_las_unreadable_returns_none(tmp_path):
|
||||
from lidar_pipeline.quality import quality_from_las
|
||||
p = tmp_path / "bad.laz"; p.write_bytes(b"pas un LAS")
|
||||
p = tmp_path / "bad.laz"; p.write_bytes(b"not a LAS")
|
||||
assert quality_from_las(p, BOUNDS) is None
|
||||
|
||||
|
||||
@ -148,7 +148,7 @@ def test_ensure_quality_skips_existing_and_unparsable(tmp_path):
|
||||
assert read_quality(tmp_path, base)["acq_start"] == "2022-06-01"
|
||||
write_quality(tmp_path, base, dict(read_quality(tmp_path, base), ground_density=99.0))
|
||||
assert ensure_quality(p, base, tmp_path) is True
|
||||
assert read_quality(tmp_path, base)["ground_density"] == 99.0 # non recalculé
|
||||
assert read_quality(tmp_path, base)["ground_density"] == 99.0 # not recomputed
|
||||
assert ensure_quality(p, "nom_libre", tmp_path) is False
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ def test_backfill_quality_reads_input_laz(tmp_path):
|
||||
[2, 6], [_gps_seconds(2022, 6, 1)] * 2)
|
||||
assert backfill_quality(inp, out) == 1
|
||||
assert abs(read_quality(out, base)["ground_density"] - 1e-6) < 1e-9
|
||||
assert backfill_quality(inp, out) == 0 # déjà à jour
|
||||
assert backfill_quality(inp, out) == 0 # already up to date
|
||||
|
||||
|
||||
def test_cli_quality_backfill(tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user