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

Some examples don't work in version 0.6.0 #169

Closed
SongshGeo opened this issue Oct 14, 2023 · 2 comments
Closed

Some examples don't work in version 0.6.0 #169

SongshGeo opened this issue Oct 14, 2023 · 2 comments

Comments

@SongshGeo
Copy link

Describe the bug

mesa runserver doesn't work in example rainfall and population.

dependencies' version: mesa_geo = 0.6.0, mesa = "^2.1.2"
rasterio = "1.3.8.post2"

Traceback (most recent call last):
  File "/Users/songshgeo/Documents/VSCode/mesa_geo/examples/rainfall/run.py", line 1, in <module>
    from rainfall.server import server
  File "/Users/songshgeo/Documents/VSCode/mesa_geo/examples/rainfall/rainfall/server.py", line 46, in <module>
    server = mesa.visualization.ModularServer(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/songshgeo/Documents/VSCode/mesa_geo/.venv/lib/python3.11/site-packages/mesa_viz_tornado/ModularVisualization.py", line 354, in __init__
    self.reset_model()
  File "/Users/songshgeo/Documents/VSCode/mesa_geo/.venv/lib/python3.11/site-packages/mesa_viz_tornado/ModularVisualization.py", line 381, in reset_model
    self.model = self.model_cls(**model_params)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/songshgeo/Documents/VSCode/mesa_geo/examples/rainfall/rainfall/model.py", line 77, in __init__
    self.space.set_elevation_layer("data/elevation.asc.gz", crs="epsg:4326")
  File "/Users/songshgeo/Documents/VSCode/mesa_geo/examples/rainfall/rainfall/space.py", line 37, in set_elevation_layer
    with gzip.open(elevation_gzip_file, "rb") as elevation_file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/gzip.py", line 58, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/gzip.py", line 174, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'data/elevation.asc.gz'

Expected behavior
Open website and run server.

To Reproduce
It occurs when I run the example in a new virtual env:

pip install mesa-geo
mesa runserver rainfall

Additional context
It works when I switch to 0.5.0 version.

@wang-boyu
Copy link
Member

Sorry about this. This is probably because all examples have been moved from this repo (#128) to the mesa-examples repo under its gis folder.

However these gis examples are not yet updated to mesa-geo v0.6.0 (projectmesa/mesa-examples#59). There is a small issue with the old mesa-via-tornado visualization that labels and colors are missing (projectmesa/mesa-viz-tornado#26).

@wang-boyu
Copy link
Member

Should be fixed now that projectmesa/mesa-examples#66 is merged.

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

No branches or pull requests

2 participants