-
Notifications
You must be signed in to change notification settings - Fork 16
[Enhancement] Rename core classes (ModelDF
, AgentsDF
, etc.) for clarity
#175
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
base: main
Are you sure you want to change the base?
Conversation
- Updated test_datacollector.py to replace ModelDF and AgentSetPolars with Model and AgentSet. - Modified ExampleModel and ExampleModelWithMultipleCollects to use AgentSetRegistry. - Adjusted fixtures to reflect changes in agent set classes. - Updated test_grid.py to use new Model and AgentSet classes, ensuring compatibility with the refactored code. - Changed test_modeldf.py to utilize the new Model class. - Updated dependencies in uv.lock to include mesa version 3.2.0.
- Updated import paths for AbstractAgentSet and AgentSetRegistry to reflect new module structure. - Created a new concrete implementation of AgentSetRegistry in `agentsetregistry.py`, providing a collection for managing agent sets with DataFrame-based storage. - Modified existing files to utilize the new AgentSetRegistry class, ensuring consistent usage across the codebase.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #175 +/- ##
==========================================
+ Coverage 92.51% 92.54% +0.03%
==========================================
Files 13 14 +1
Lines 1709 1717 +8
==========================================
+ Hits 1581 1589 +8
Misses 128 128 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for more information, see https://pre-commit.ci
…ctAgentSetRegistry
…-and-agentsetpolars-to-agentsetdf-for-clarity' of https://github.com/projectmesa/mesa-frames into 171-enhancement-rename-agentsetdf-to-abstractagentsetdf-and-agentsetpolars-to-agentsetdf-for-clarity
…codebase for consistency and clarity
…Model for consistency across the codebase
for more information, see https://pre-commit.ci
…tagentsetdf-and-agentsetpolars-to-agentsetdf-for-clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good!
I tried to fix the pre-commit issues - but I don't have write access to this repo!
I will need to raise a separate PR!
It is a single change so should be all good
…andas and MoneyAgentDF to MoneyAgentsConcise and MoneyAgentsNative
…alth calculations
…o MesaMoneyModel and MoneyAgent to MesaMoneyAgent; update agent sets to MoneyAgentsConcise and MoneyAgentsNative.
…larsBase to AntDFBase for consistency
…rom AbstractAgentSet to AgentSet and adjust related documentation.
This PR updates class and property names to improve clarity and align with the upcoming refactor in #172.
Changes
ModelDF
→Model
AgentsDF
→AgentSetRegistry
AgentContainer
→AbstractAgentSetRegistry
AgentSetPolars
→AgentSet
AgentSetDF
(abstract) →AbstractAgentSet
model.agents
→model.sets
Reasoning
*DF
suffix was only added to distinguish from Mesa’s classes. This is no longer necessary, since end users typically don’t import both frameworks together.AgentSetDF
andAgentSetsAccessor
for name/type/index lookup and container-aware keying #172, onlyAgentSet
will directly manage its DataFrame, while the container class (AgentSetRegistry
, exposed onmodel.sets
) is the single point of access to all agent sets.Scope