-
Notifications
You must be signed in to change notification settings - Fork 165
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
Fix data paths and model passing in GIS examples #177
Conversation
City uses a RasterLayer, which needs a model as input as of mesa-geo 0.8.0.
UrbanCell uses a Cell, which needs a model as input as of mesa-geo 0.8.0.
Agents always need a Model object to be able to use Model variables and properties, including the AgentSet.
for more information, see https://pre-commit.ci
This PR brings the score for the 7 gis examples from 2 fully passed and 1 passed with warnings, to 3 fully passed and 3 passes with warnings. |
Fix the model by passing the model object correctly
Fix the model by passing the model object correctly
Another two models pass. 5 pass, one warning, one fail. Those will be separate PRs. This one is ready for review. |
pathlib.Path improves over the older os.path methods by providing a more modern, object-oriented interface for working with filesystem paths. As can be seen, it reduces the code complexity a bit.
I noticed one other issue: But that isn't fixable from the examples alone, so something for @wang-boyu or @tpike3 to look into. I updated the tracking issues #172. Going to merge this PR. |
This commit addresses several of the remaining issues across the GIS examples: - Corrects data file paths in the population, rainfall, and urban growth models to use relative paths from the script directory. - Fixes the urban growth model by passing the model object to City and UrbanCell classes, as required by mesa-geo 0.8.0. - Updates the population model to pass the model object when creating agents, ensuring they can access Model variables and properties. - Corrects the use of `/vsigzip/` paths for GDAL compatibility. The `/vsigzip/` situation is super weird. It isn't part of the file path, but it's a "marker" a GDAL convention. See the PR message, mesa-geo#235 and https://gdal.org/user/virtual_file_systems.html#vsigzip-gzipped-file for more details.
This commit addresses several of the remaining issues across the GIS examples: - Corrects data file paths in the population, rainfall, and urban growth models to use relative paths from the script directory. - Fixes the urban growth model by passing the model object to City and UrbanCell classes, as required by mesa-geo 0.8.0. - Updates the population model to pass the model object when creating agents, ensuring they can access Model variables and properties. - Corrects the use of `/vsigzip/` paths for GDAL compatibility. The `/vsigzip/` situation is super weird. It isn't part of the file path, but it's a "marker" a GDAL convention. See the PR message, mesa-geo#235 and https://gdal.org/user/virtual_file_systems.html#vsigzip-gzipped-file for more details.
This PR addresses several of the remaining issues across the GIS examples:
/vsigzip/
paths for GDAL compatibility.The
/vsigzip/
situation is super weird. It isn't part of the file path, but it's a "marker" a GDAL convention. See projectmesa/mesa-geo#235 for more details.Part of #172.