Skip to content

Commit ba1f104

Browse files
Mihouclaude
andcommitted
chore(merge): integrate 2026-10-13 review into dev
Carries review/dev-20261006 (V1: calc_fov warns when rfov falls back to 0), re-reviewed and gated this week. No new code reached dev in the 2026-10-06 -> 2026-10-13 window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 parents eaaeb1c + 65eee14 commit ba1f104

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎deeplens/geolens.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
Xinge Yang, Qiang Fu, and Wolfgang Heidrich, "Curriculum learning for ab initio deep learned refractive optics," Nature Communications 2024.
1111
"""
1212

13+
import logging
1314
import math
1415

1516
import numpy as np
@@ -37,6 +38,8 @@
3738
from .light import Ray
3839
from .material import Material
3940

41+
logger = logging.getLogger(__name__)
42+
4043

4144
class GeoLens(
4245
GeoLensPSF,
@@ -1043,6 +1046,11 @@ def calc_fov(self):
10431046
else:
10441047
self.rfov = 0.0
10451048
self.real_dfov = 0.0
1049+
if self.rfov == 0.0:
1050+
logger.warning(
1051+
"calc_fov: no usable off-axis field; rfov = 0, so normalized-"
1052+
"field sampling (PSF, spot, MTF) collapses to the axis."
1053+
)
10461054

10471055
# 3. Compute 35mm equivalent focal length. 35mm sensor: 36mm * 24mm
10481056
self.eqfl = 21.63 / math.tan(self.rfov_eff)

‎test/test_design_constraints.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def test_bounds_sample_shared_profiles_and_physical_rims(
118118
["fold", "dead", "clear", "none", "first_dead", "early_dead", "early_crossing"],
119119
)
120120
def test_fov_uses_first_crossing_or_last_surviving_field(
121-
monkeypatch, case, device_auto
121+
monkeypatch, caplog, case, device_auto
122122
):
123123
lens = GeoLens(device=device_auto)
124124
lens.foclen, lens.r_sensor, lens.sensor_size = 10.0, 5.0, (8.0, 6.0)
@@ -170,6 +170,7 @@ def sample(fov_x, fov_y, num_rays):
170170
assert fov[0] == 0.0
171171
assert lens.rfov == pytest.approx(expected, rel=1e-5)
172172
assert lens.real_dfov == pytest.approx(2 * expected)
173+
assert ("rfov = 0" in caplog.text) == (expected == 0.0)
173174

174175

175176
def test_spot_analysis_reports_lost_field_throughput(monkeypatch, device_auto):

0 commit comments

Comments
 (0)