Skip to content

Guard contrast-reserve calc for sizeless objects (stop ERROR log spam)#473

Merged
brickbots merged 1 commit into
mainfrom
fix/contrast-reserve-sizeless
Jun 15, 2026
Merged

Guard contrast-reserve calc for sizeless objects (stop ERROR log spam)#473
brickbots merged 1 commit into
mainfrom
fix/contrast-reserve-sizeless

Conversation

@brickbots

Copy link
Copy Markdown
Owner

Summary

Guard the contrast-reserve calculation against objects with no usable size, to stop steady ERROR-level log spam.

pydeepskylog.contrast_reserve() logs logger.error(...) and returns (it does not raise) when an object diameter is None, so the surrounding except (ValueError, TypeError, InvalidParameterError) in object_details.update_object_info() cannot suppress it. That method calls contrast_reserve() on every redraw, and for objects that have a magnitude but no usable size it passes diameter=None — producing steady ERROR-level log spam (~1–2/sec while that object's detail screen is open) that bypasses the root=ERROR log filter.

Fix

Skip the call when either diameter is None (the library can't compute a contrast reserve without diameters anyway) and leave the contrast line blank. This is the same end result as beforecontrast was ultimately set to "" on the None return — minus the error log.

Notes

Split out of #472 (IMU memory-leak fix) so it can be reviewed and merged independently; the two changes are unrelated and touch disjoint files (this one is object_details.py only). Complements the Contrast Reserve documentation work in #471.

🤖 Generated with Claude Code

pydeepskylog.contrast_reserve() logs logger.error(...) and returns (does
not raise) when an object diameter is None, so the surrounding
except (ValueError, TypeError, InvalidParameterError) cannot suppress it.
object_details.update_object_info() calls it per redraw with diameter=None
for objects that have a magnitude but no usable size, producing steady
ERROR-level log spam (~1-2/sec on that object's detail screen) that bypasses
the root=ERROR log filter.

Skip the call when either diameter is None (the library cannot compute it
anyway) and leave the contrast line blank -- the same end result as before
(contrast was ultimately set to "" on the None return), minus the error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@brickbots brickbots merged commit 19717fb into main Jun 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant