Skip to content

Conversation

@quaquel
Copy link
Member

@quaquel quaquel commented Dec 26, 2023

In response to the discussion in #1917, this PR contains a simple workaround if model._agent has not been set up because super().__init__ was not called when subclassing Model.

It also fixes the bug mentioned in #1917 regarding model.get_agents_of_type.

@codecov
Copy link

codecov bot commented Dec 26, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (03d0c81) 79.62% compared to head (1023588) 79.38%.

Files Patch % Lines
mesa/agent.py 42.85% 4 Missing ⚠️
mesa/model.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1928      +/-   ##
==========================================
- Coverage   79.62%   79.38%   -0.25%     
==========================================
  Files          15       15              
  Lines        1124     1130       +6     
  Branches      244      244              
==========================================
+ Hits          895      897       +2     
- Misses        198      202       +4     
  Partials       31       31              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EwoutH
Copy link
Member

EwoutH commented Dec 26, 2023

Looks good!

Co-authored-by: Ewout ter Hoeven <[email protected]>
@EwoutH EwoutH mentioned this pull request Dec 26, 2023
@Corvince
Copy link
Contributor

Thanks @quaquel for the pr and thanks @EwoutH for the review!

@Corvince Corvince merged commit 9dd07a5 into projectmesa:main Dec 27, 2023
@EwoutH EwoutH added the bug Release notes label label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants