adamamer20 / mesa-frames

Extension of mesa for performance and scalability
https://adamamer20.github.io/mesa-frames/api
MIT License
6 stars 1 forks source link

Changes to AgentSetDF and AgentsDF before time.py -> CopyMixin #16

Closed adamamer20 closed 12 hours ago

adamamer20 commented 5 days ago
rht commented 4 days ago

It looks like pre-commit.ci hasn't been enabled: https://pre-commit.ci/.

adamamer20 commented 4 days ago

You're right, now it should be enabled. So now before committing i should run locally pre-commit run --all-files right?

rht commented 4 days ago

So now before committing i should run locally pre-commit run --all-files right?

For now, yes, manually. Because it will only trigger starting in the next PR. You could also add a local Git commit hook so that it is automatic.

adamamer20 commented 4 days ago

@rht The ubuntu 3.10 build is failing because typing.Self was introduced in 3.11. I have seen that this can port typing features to previous Python versions. Do you think it's worth it?

codecov-commenter commented 4 days ago

Welcome to Codecov :tada:

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

:information_source: You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered :open_umbrella:

rht commented 3 days ago

I tried adding from __future__ import annotations in agents.py. Didn't work. So I have removed my commit so that you are the sole author of this PR (otherwise it would get interpreted as 50% co-authorship without careful inspection).

Adding typing-extensions sounds good to me. Seems like a lightweight module.

adamamer20 commented 1 day ago

@rht ready to merge

rht commented 12 hours ago

Added possibility of using 'do' method with a mask in AgentSetDF, such that the Scheduler can use it to run the method only on a subset of agents (active agents in the scheduler).

Sorry for the late comment on this, but the scheduler (random activation, staged activation, etc, except for the discrete event scheduler) will be rendered obsolete, replaced with AgentSet's select-then-do.

But given that this PR has lots of other improvements, e.g. fixing the CI, I'm going to merge it, so that we can move faster. I need a working tests/CI in order to benchmark the runtime type checking libraries.

adamamer20 commented 11 hours ago

Sorry for the late comment on this, but the scheduler (random activation, staged activation, etc, except for the discrete event scheduler) will be rendered obsolete, replaced with AgentSet's select-then-do.

But given that this PR has lots of other improvements, e.g. fixing the CI, I'm going to merge it, so that we can move faster. I need a working tests/CI in order to benchmark the runtime type checking libraries.

Ah, no problem! I thought that the scheduler would be kept and the AgentSet's select-then-do was only incentivized. Anyway, all the changes in the PR are still useful because masked do is something that is needed anyway. I have implemented the interface for schedulers (apart from the discrete event scheduler, which I was leaving to its own PR) in the 9-refactoring-mesatime-schedulersbranch. I still need to implement the tests, though. At this point, if you plan on deprecating soon, I will leave it as is and start working either on mesa.space or the discrete event scheduler. What do you think?

rht commented 10 hours ago

I think I'm more looking forward to the mesa.space first, as it will unlock us a more nontrivial example.