-
Notifications
You must be signed in to change notification settings - Fork 154
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
gis: update four examples to use solara viz #211
Conversation
Awesome work! If others don’t get to it, I will review Monday. |
gis/geo_schelling/README.md
Outdated
``` | ||
|
||
Then open your browser to [http://127.0.0.1:8521/](http://127.0.0.1:8521/) and press `Start`. | ||
Then open your browser to [http://127.0.0.1:8765/](http://127.0.0.1:8765/) and press `Start`. |
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.
There is no "Start" button anymore. It is "▶".
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.
You're right! Fixed now.
14872eb
to
ad1e606
Compare
Also updated the agents_networks example model. Won't update any other examples in this PR. |
2671add
to
707cd0b
Compare
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.
I would do it the other way around, and keep everything in a gis/geo_sir
.
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.
Thanks for working on this, this looks really nice!
Also great that you cleaned some old files up.
Go ahead and merge!
Personally, I would highly prefer adoption this structure for all examples. It's by far the most straightforward and clearly arranged one.
|
I had some difficulties in using the flat folder structure. If from .agents import PersonAgent
ImportError: attempted relative import with no known parent package from .agents import NeighbourhoodAgent, PersonAgent
ImportError: attempted relative import with no known parent package I will then have to change all the imports from # from
from .agents import NeighbourhoodAgent, PersonAgent
# to
from agents import NeighbourhoodAgent, PersonAgent Then ___________________________________________________ ERROR collecting test_gis_examples.py ___________________________________________________
ImportError while importing test module '/Users/boyu/GitHubProjects/mesa-examples/test_gis_examples.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/Cellar/python@3.12/3.12.7/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
test_gis_examples.py:30: in <module>
@pytest.mark.parametrize("model_class", get_models("gis"))
test_gis_examples.py:17: in get_models
module = importlib.import_module(module_name)
/usr/local/Cellar/python@3.12/3.12.7/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
gis/geo_sir/model.py:7: in <module>
from agents import NeighbourhoodAgent, PersonAgent
E ModuleNotFoundError: No module named 'agents'
========================================================== short test summary info ==========================================================
ERROR test_gis_examples.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! So I simply use the updated folder structure that works for both |
Awesome! I would be totally fine with you merging faster/earlier, if you feel that would speed up your development of these models. |
Partly addresses #154.
Update the following four gis examples to use the new solara visualization:
Update their dependency of mesa-geo to v0.9.0a0.
Also update the folder structure of the geo_sir model from
to
to be consistent with other gis examples.