Skip to content

Conversation

@EwoutH
Copy link
Member

@EwoutH EwoutH commented Aug 25, 2024

Fix the data path import errors in the geo_schelling, geo_schelling_points and geo_sir models.

The problem was that many models are called from different place, and might be imported or not. The os.path.dirname(os.path.abspath(__file__)) part gives the absolute path of the current file and then the directory it's in. From there we can robustly move to the location where the data is located, no matter if we're running locally or not.

Part of #172.

Fix the data path import errors in the geo_schelling, geo_schelling_points and geo_sir models.
@EwoutH EwoutH mentioned this pull request Aug 25, 2024
31 tasks
@EwoutH
Copy link
Member Author

EwoutH commented Aug 25, 2024

With this PR the first 2 gis models now pass, GeoSchellingPoints and GeoSir.

@EwoutH EwoutH merged commit bbf5ad2 into projectmesa:main Aug 25, 2024
@EwoutH
Copy link
Member Author

EwoutH commented Aug 25, 2024

@rht if you have the time I would still like to know if you like this style of resolving path errors.

@rht
Copy link
Contributor

rht commented Aug 25, 2024

Yes, fine with me. Though you could use Path object instead, with / as joiner.

EwoutH added a commit to EwoutH/mesa-examples that referenced this pull request Sep 3, 2024
Fix the data path import errors in the geo_schelling, geo_schelling_points and geo_sir models.
EwoutH added a commit to EwoutH/mesa-examples that referenced this pull request Sep 20, 2024
Fix the data path import errors in the geo_schelling, geo_schelling_points and geo_sir models.
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

Successfully merging this pull request may close these issues.

2 participants