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

Fix 3 data path imports in gis models #176

Merged
merged 1 commit into from
Aug 25, 2024

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
1 of 3 checks passed
@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