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

make typing behavior of AgentSet.get explicit #2293

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

quaquel
Copy link
Member

@quaquel quaquel commented Sep 13, 2024

This is just a small update using typing.overload to make it explicit how arguments and the 2 possibly returns of AgentSet.get are related.

Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +0.5% [-0.2%, +1.2%] 🔵 +0.4% [+0.3%, +0.5%]
BoltzmannWealth large 🔵 -7.0% [-21.8%, +0.4%] 🔵 +2.1% [-2.9%, +7.7%]
Schelling small 🔵 +0.1% [-0.2%, +0.3%] 🔵 -0.1% [-0.4%, +0.1%]
Schelling large 🔵 -0.4% [-1.1%, +0.4%] 🔵 -0.6% [-2.4%, +1.1%]
WolfSheep small 🔵 +0.7% [-0.7%, +2.0%] 🔵 +0.0% [-0.2%, +0.3%]
WolfSheep large 🔵 -0.4% [-1.0%, +0.2%] 🔵 -0.3% [-1.1%, +0.5%]
BoidFlockers small 🔵 +2.8% [+2.4%, +3.1%] 🔵 +0.3% [-0.6%, +1.2%]
BoidFlockers large 🔵 +2.8% [+2.1%, +3.3%] 🔵 -0.7% [-1.2%, -0.1%]

Copy link
Contributor

@Corvince Corvince left a comment

Choose a reason for hiding this comment

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

Looks good! Somehow my language server Pylance doesn't pick this up correctly, but I think it should, I see no error in this code

@quaquel quaquel merged commit ead9cd1 into projectmesa:main Sep 13, 2024
11 of 12 checks passed
@quaquel quaquel deleted the agentset_typing branch September 13, 2024 08:18
@EwoutH EwoutH added the maintenance Release notes label label Sep 20, 2024
EwoutH pushed a commit to EwoutH/mesa that referenced this pull request Sep 24, 2024
* make typing behavior of AgentSet.get explicit

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Release notes label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants