Skip to content

Fix signal docstring examples and add doctest coverage - #3819

Merged
quaquel merged 1 commit into
mesa:mainfrom
falloficaruss:fix-signal-docstring-examples
Aug 26, 2026
Merged

quaquel merged 1 commit into
mesa:mainfrom
falloficaruss:fix-signal-docstring-examples

Conversation

@falloficaruss

Copy link
Copy Markdown
Contributor

Follow-up to #3818.

Summary

  • Fix signal docstring examples to import ObservableSignals.
  • Replace weakly referenced inline lambdas with named handlers.
  • Define handlers for the string-based compatibility examples.
  • Add isolated doctest coverage for the signal type docstrings.

@github-actions

Copy link
Copy Markdown

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +1.3% [+0.7%, +2.1%] 🔵 +0.1% [-0.1%, +0.3%]
BoltzmannWealth large 🔴 +5.0% [+4.1%, +6.0%] 🔴 +7.9% [+6.1%, +9.9%]
Schelling small 🔴 +3.7% [+3.2%, +4.3%] 🔵 -0.0% [-0.7%, +0.6%]
Schelling large 🔵 +3.1% [+2.4%, +3.8%] 🔴 +5.4% [+3.9%, +7.2%]
WolfSheep small 🔵 +0.4% [-0.1%, +0.8%] 🔵 -1.2% [-4.8%, +2.5%]
WolfSheep large 🔵 +2.9% [+1.8%, +3.7%] 🔵 +2.8% [+1.9%, +3.6%]
SugarscapeG1mt small 🔵 +3.4% [+2.4%, +4.3%] 🔵 +1.1% [-0.4%, +2.7%]
SugarscapeG1mt large 🔵 +0.2% [-1.5%, +1.7%] 🔵 +0.4% [-0.7%, +1.6%]
BoidFlockers small 🔵 +0.0% [-0.5%, +0.6%] 🔵 +0.4% [+0.1%, +0.7%]
BoidFlockers large 🔵 -1.1% [-1.9%, -0.3%] 🔵 +0.3% [+0.0%, +0.5%]

@quaquel quaquel added the docs Release notes label label Aug 26, 2026
Comment on lines +24 to +29
def test_signal_type_docstrings():
"""Execute signal type examples in an isolated namespace."""
result = doctest.testmod(signal_types, globs={})
assert result.failed == 0


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fine for now, but we might want to handle this for the entire repo.

@quaquel
quaquel merged commit bfea659 into mesa:main Aug 26, 2026
13 checks passed
@github-actions github-actions Bot added experimental Release notes label testing Release notes label and removed docs Release notes label labels Aug 26, 2026
@falloficaruss
falloficaruss deleted the fix-signal-docstring-examples branch August 26, 2026 19:00
EwoutH pushed a commit that referenced this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimental Release notes label testing Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants