Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Observables to MESA #2291

Merged
merged 127 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from 121 commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
d90b0f7
further updates
quaquel Jan 21, 2024
9586490
Update benchmarks/WolfSheep/__init__.py
quaquel Jan 21, 2024
4aaa35d
Merge remote-tracking branch 'upstream/main'
quaquel Feb 21, 2024
d31478c
Merge remote-tracking branch 'upstream/main'
quaquel Apr 22, 2024
6e4c72e
Merge remote-tracking branch 'upstream/main'
quaquel Aug 14, 2024
70fbaf5
Merge remote-tracking branch 'upstream/main'
quaquel Aug 18, 2024
724c8db
Merge remote-tracking branch 'upstream/main'
quaquel Aug 21, 2024
45184a4
Merge remote-tracking branch 'upstream/main'
quaquel Aug 22, 2024
3d75d30
Merge remote-tracking branch 'upstream/main'
quaquel Aug 27, 2024
2759244
Update __init__.py
quaquel Aug 27, 2024
fc8aaea
Merge remote-tracking branch 'upstream/main'
quaquel Aug 28, 2024
1ba465d
Merge remote-tracking branch 'upstream/main'
quaquel Aug 30, 2024
2b5e822
Merge remote-tracking branch 'upstream/main'
quaquel Sep 2, 2024
3847799
Merge remote-tracking branch 'upstream/main'
quaquel Sep 4, 2024
301d80e
Merge remote-tracking branch 'upstream/main'
quaquel Sep 4, 2024
fe3d655
Merge remote-tracking branch 'upstream/main'
quaquel Sep 4, 2024
7d18880
Merge remote-tracking branch 'upstream/main'
quaquel Sep 5, 2024
6b49a3b
Merge remote-tracking branch 'upstream/main'
quaquel Sep 5, 2024
b9909e6
Merge remote-tracking branch 'upstream/main'
quaquel Sep 9, 2024
8ce3d83
Merge remote-tracking branch 'upstream/main'
quaquel Sep 10, 2024
88fbf74
Merge remote-tracking branch 'upstream/main'
quaquel Sep 13, 2024
b1965fc
wip
quaquel Sep 6, 2024
7cf2384
ongoing
quaquel Sep 8, 2024
ba2affb
draft observables and signals
quaquel Sep 11, 2024
21e185d
Update pyproject.toml
quaquel Sep 11, 2024
75aa6d1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 11, 2024
d594052
add observables to class, and signals to instances
quaquel Sep 12, 2024
5d77796
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 12, 2024
e3ac177
add HasObservables mixin and move signals back to experimental
quaquel Sep 13, 2024
8fc657b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 13, 2024
f58acd9
raise valueerror if owner does not have the observables attribute
quaquel Sep 13, 2024
8300d5d
stash
quaquel Sep 21, 2024
4499389
Update boltzmann_wealth.py
quaquel Sep 21, 2024
15d74aa
ongoing work
quaquel Sep 21, 2024
0f58754
Merge remote-tracking branch 'upstream/main' into signal
quaquel Sep 21, 2024
718ab09
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 21, 2024
1acca63
remove dependencies
quaquel Sep 21, 2024
9537c3b
ruff fixes
quaquel Sep 21, 2024
62d27ae
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 21, 2024
a0102e9
make All() work for signal_type
quaquel Sep 22, 2024
c7cedde
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 22, 2024
e4b9593
change how fallback_value is used
quaquel Sep 22, 2024
99483f2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 22, 2024
9d0fc75
Update observable_collections.py
quaquel Sep 22, 2024
dcf9564
add a BaseObservable class
quaquel Sep 22, 2024
0e67153
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 22, 2024
2a3f108
make BaseObserver an ABC and ruff fixes
quaquel Sep 22, 2024
69d42db
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 22, 2024
79f99a1
start of adding Computed and Computable
quaquel Sep 22, 2024
65d4974
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 22, 2024
2064c73
Update signal.py
quaquel Sep 22, 2024
72b5445
Merge remote-tracking branch 'upstream/main' into signal
quaquel Sep 22, 2024
5222518
remove wrongfully commited code
quaquel Sep 22, 2024
29974b2
typing fix
quaquel Sep 22, 2024
1588dbf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 22, 2024
51a6d0e
first testing of computable
quaquel Sep 23, 2024
dd17009
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 23, 2024
e000097
basic version of computed works
quaquel Sep 23, 2024
43b2a7b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 23, 2024
cba2eec
Update test.py
quaquel Sep 23, 2024
5e0e9d5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 23, 2024
6505de0
Update signal.py
quaquel Sep 23, 2024
ca85bcd
fix for cycles
quaquel Sep 24, 2024
4805252
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 24, 2024
ed3c5ba
Update signal.py
quaquel Sep 25, 2024
1e91ee5
Merge remote-tracking branch 'upstream/main' into signal
quaquel Sep 25, 2024
304c63a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 25, 2024
820c176
update 1 benchmark model
quaquel Sep 25, 2024
04ef6f1
some testing with timings
quaquel Sep 25, 2024
b3d8f9a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 25, 2024
74a641a
Merge remote-tracking branch 'upstream/main' into signal
quaquel Sep 25, 2024
27313ec
Update boltzmann_wealth.py
quaquel Sep 25, 2024
5ccf584
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 25, 2024
2d90025
Update boltzmann_wealth.py
quaquel Sep 25, 2024
2702bce
Merge branch 'main' into signal
quaquel Sep 26, 2024
b7c405c
perfcounter
quaquel Sep 27, 2024
291c721
various cleanups
quaquel Sep 27, 2024
658bf5e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2024
85cd317
Update test.py
quaquel Sep 27, 2024
f0c600b
Update __init__.py
quaquel Sep 27, 2024
f0c918a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2024
8afea8c
cleaning
quaquel Sep 27, 2024
ee56159
Merge remote-tracking branch 'upstream/main' into signal
quaquel Sep 27, 2024
95b647c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2024
9169d20
cleaning and debugging code
quaquel Sep 27, 2024
728b0d2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2024
1482f07
Merge branch 'main' into signal
quaquel Sep 30, 2024
fab12d4
Update boltzmann_wealth.py
quaquel Sep 30, 2024
34fd9ff
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 30, 2024
5f58aaa
Update mesa_signal.py
quaquel Sep 30, 2024
aa0b940
ongoing testing and cleaning
quaquel Oct 1, 2024
d539aa8
Merge remote-tracking branch 'upstream/main' into signal
quaquel Oct 1, 2024
ca9def1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 1, 2024
6d96541
Merge remote-tracking branch 'upstream/main' into signal
quaquel Oct 4, 2024
255e91c
switch from named tuple to attribute dict
quaquel Oct 7, 2024
5f96bb8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 7, 2024
555621c
Merge remote-tracking branch 'upstream/main' into signal
quaquel Oct 16, 2024
0dc29b8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 16, 2024
05e6d76
Merge remote-tracking branch 'upstream/main' into signal
quaquel Nov 4, 2024
9c4ec7c
cleanup and merging with upstream
quaquel Nov 4, 2024
3b2d240
Merge branch 'main' into signal
quaquel Nov 5, 2024
ac892f0
Merge branch 'main' into signal
quaquel Nov 9, 2024
b3320fb
first set of tests for Observable and HasObservable
quaquel Nov 9, 2024
cb1161b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 9, 2024
d947b16
some ruff stuff
quaquel Nov 9, 2024
7215073
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 9, 2024
da4c876
Update signals_util.py
quaquel Nov 9, 2024
5486de9
Update test.py
quaquel Nov 9, 2024
bad310a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 9, 2024
272f512
Merge branch 'main' into signal
quaquel Nov 9, 2024
b6bbd97
Merge remote-tracking branch 'upstream/main' into signal
quaquel Nov 14, 2024
e50dd82
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 14, 2024
28c186c
initial unit tests for observable list
quaquel Nov 14, 2024
9b17932
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 14, 2024
3e1f578
additional tests
quaquel Nov 14, 2024
9ea74d6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 14, 2024
5e9e15f
include experimental in code coverage
quaquel Nov 15, 2024
4b2ec6a
updates to tests
quaquel Nov 15, 2024
eeb87b2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 15, 2024
9761abe
minor fix
quaquel Nov 15, 2024
6460551
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 15, 2024
fd33efe
Update mesa_signal.py
quaquel Nov 15, 2024
03bbf09
Merge branch 'signal_tests' into signal
quaquel Nov 16, 2024
38d5462
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 16, 2024
7ebde11
Merge branch 'main' into signal
quaquel Nov 16, 2024
6640a1d
cleanup
quaquel Nov 16, 2024
2a6ddb4
Merge branch 'main' into signal
quaquel Nov 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ coverage:

ignore:
- "benchmarks/**"
- "mesa/experimental/**"
- "mesa/visualization/**"

comment: off
4 changes: 2 additions & 2 deletions mesa/experimental/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Experimental init."""

from mesa.experimental import cell_space, devs
from mesa.experimental import cell_space, devs, mesa_signals

__all__ = ["cell_space", "devs"]
__all__ = ["cell_space", "devs", "mesa_signals"]
13 changes: 13 additions & 0 deletions mesa/experimental/mesa_signals/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Functionality for Observables."""

from .mesa_signal import All, Computable, Computed, HasObservables, Observable
from .observable_collections import ObservableList

__all__ = [
"Observable",
"ObservableList",
Copy link
Member

Choose a reason for hiding this comment

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

Would an ObservableDict (also) be useful, to be able to track which Agent the value originated from?

Copy link
Member Author

Choose a reason for hiding this comment

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

An ObservableDict would indeed also be useful. Not sure what you mean with

to be able to track which Agent the value originated from

Copy link
Member

@tpike3 tpike3 Nov 16, 2024

Choose a reason for hiding this comment

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

I think I see what @EwoutH means here where it would be something like {agent.unique_id: <observables>}

"HasObservables",
"All",
"Computable",
"Computed",
]
Loading
Loading