Skip to content

fix: make profiler output opt-in and fix test assertions#24

Merged
YJack0000 merged 1 commit into
mainfrom
fix/library-ergonomics
Feb 23, 2026
Merged

fix: make profiler output opt-in and fix test assertions#24
YJack0000 merged 1 commit into
mainfrom
fix/library-ergonomics

Conversation

@YJack0000

Copy link
Copy Markdown
Owner

Summary

  • Add Environment::setVerbose(bool) — profiler/stats output after simulateIteration is now off by default
  • Fix test_chasing.py incorrect assertion (was asserting distance doesn't change, which contradicts a chasing scenario)
  • Remove duplicate OutOfRangeException registration

Usage

env = Environment(1000, 1000)
env.set_verbose(True)  # opt-in to profiler output
env.simulate_iteration(100)  # now prints stats

Test plan

  • All 3 Python tests pass
  • No stdout output by default when running tests
  • set_verbose(True) still produces output when enabled

🤖 Generated with Claude Code

- Add Environment::setVerbose(bool) to control profiler/stats output
  after simulateIteration. Default is now off (was always on).
- Expose set_verbose() in Python bindings
- Fix test_chasing.py: remove incorrect assertion that distance should
  not change (contradicts the chasing scenario). Now asserts both
  organisms survive (lifespan callback returns 0 consumption).
- Remove duplicate OutOfRangeException registration from python_bindings.cpp
  (already registered in Environment_bindings.cpp)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@YJack0000
YJack0000 merged commit 881965b into main Feb 23, 2026
4 checks 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