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

Revert changes of #1478 and #1456 #1516

Merged
merged 4 commits into from
Nov 8, 2022
Merged

Conversation

Tortar
Copy link
Contributor

@Tortar Tortar commented Nov 7, 2022

Reverts #1478 and parts of #1456 because they introduce the bug discussed in #1515

@Tortar Tortar changed the title Revert "Use list transformation only when shuffled is True" Revert changes of #1478 and #1456 Nov 7, 2022
@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Base: 91.20% // Head: 91.26% // Increases project coverage by +0.05% 🎉

Coverage data is based on head (11106a0) compared to base (45171f3).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1516      +/-   ##
==========================================
+ Coverage   91.20%   91.26%   +0.05%     
==========================================
  Files          15       15              
  Lines        1308     1305       -3     
  Branches      225      225              
==========================================
- Hits         1193     1191       -2     
+ Misses         81       80       -1     
  Partials       34       34              
Impacted Files Coverage Δ
mesa/time.py 94.89% <100.00%> (+0.83%) ⬆️
mesa/space.py 95.73% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Tortar Tortar force-pushed the revert-1478-patch-5 branch from c9ea7e1 to 4a97be7 Compare November 7, 2022 17:36
These PRs are reverted because they
introduce the bug discussed in projectmesa#1515
@Tortar Tortar force-pushed the revert-1478-patch-5 branch from 4a97be7 to f0f8d68 Compare November 7, 2022 17:44
@Corvince
Copy link
Contributor

Corvince commented Nov 7, 2022

Thanks for the work. Would be awesome if we would have a test case for this, esp. the removing-while-running part. Do you think you could add those as well? No worries if you don't have time for that, we don't have them now so this is not a requirement for this PR to be merged

@Tortar
Copy link
Contributor Author

Tortar commented Nov 7, 2022

Will do that, but right now I can't unfortunately

if self.shuffle:
agent_keys = list(agent_keys)
self.model.random.shuffle(agent_keys)
for stage in self.stage_list:
for agent_key in agent_keys:
getattr(self._agents[agent_key], stage)() # Run stage
# We recompute the keys because some agents might have been removed
# in the previous loop.
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs to document why the casting to list is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@rht
Copy link
Contributor

rht commented Nov 8, 2022

LGTM

@rht rht merged commit bfc0e86 into projectmesa:main Nov 8, 2022
@jackiekazil jackiekazil added this to the v1.2.0 Taylor milestone Feb 27, 2023
@jackiekazil jackiekazil mentioned this pull request Mar 7, 2023
4 tasks
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.

4 participants