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: Update geopandas version to fix error with fiona #183

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

davvidbaker
Copy link
Contributor

Summary

I followed all the instructions on the setup page, and this was the only obstacle preventing the model from running.

Technical Details

Implementation notes

The error I was hitting was this:

Starting the run for case test_ercot_small
Running test_ercot_small
----------------------
starting copy_files.py
----------------------
copy_files.py | 2024-09-26 21:17:30 | INFO | Starting copy_files.py
copy_files.py | 2024-09-26 21:17:30 | INFO | Copying non-region-indexed files
copy_files.py | 2024-09-26 21:17:30 | ERROR | Traceback (most recent call last):
copy_files.py | 2024-09-26 21:17:30 | ERROR |   File "/Users/david/code/ReEDS-2.0/runs/test_ercot_small/input_processing/copy_files.py", line 655, in <module>
copy_files.py | 2024-09-26 21:17:30 | ERROR | dfmap = reedsplots.get_dfmap(os.path.join(inputs_case,'..'))
copy_files.py | 2024-09-26 21:17:30 | ERROR |   File "/Users/david/code/ReEDS-2.0/postprocessing/reedsplots.py", line 142, in get_dfmap
copy_files.py | 2024-09-26 21:17:30 | ERROR | dfba = get_zonemap(case)
copy_files.py | 2024-09-26 21:17:30 | ERROR |   File "/Users/david/code/ReEDS-2.0/postprocessing/reedsplots.py", line 78, in get_zonemap
copy_files.py | 2024-09-26 21:17:30 | ERROR | gpd.read_file(os.path.join(reeds_path,'inputs','shapefiles','US_PCA'))
copy_files.py | 2024-09-26 21:17:30 | ERROR |   File "/opt/anaconda3/envs/reeds2/lib/python3.11/site-packages/geopandas/io/file.py", line 297, in _read_file
copy_files.py | 2024-09-26 21:17:30 | ERROR | return _read_file_fiona(
copy_files.py | 2024-09-26 21:17:30 | ERROR |   File "/opt/anaconda3/envs/reeds2/lib/python3.11/site-packages/geopandas/io/file.py", line 315, in _read_file_fiona
copy_files.py | 2024-09-26 21:17:30 | ERROR | if _is_zip(str(path_or_bytes)):
copy_files.py | 2024-09-26 21:17:30 | ERROR |   File "/opt/anaconda3/envs/reeds2/lib/python3.11/site-packages/geopandas/io/file.py", line 173, in _is_zip
copy_files.py | 2024-09-26 21:17:30 | ERROR | parsed = fiona.path.ParsedPath.from_uri(path)
copy_files.py | 2024-09-26 21:17:30 | ERROR | AttributeError
copy_files.py | 2024-09-26 21:17:30 | ERROR | :
copy_files.py | 2024-09-26 21:17:30 | ERROR | module 'fiona' has no attribute 'path'
copy_files.py | 2024-09-26 21:17:30 | ERROR | . Did you mean: '
copy_files.py | 2024-09-26 21:17:30 | ERROR | Path
copy_files.py | 2024-09-26 21:17:30 | ERROR | '?

This was a known issue with the old version of geopandas. Updating to 1.0.1 fixes the issue, but it's possible it might break something somewhere else, I couldn't really tell, but I figured having a note about how someone might get past this themselves is good for posterity, even if you just want to close the PR.

@pesap
Copy link
Collaborator

pesap commented Sep 27, 2024

Hi @davvidbaker ,

Thanks for contributing to the ReEDS repo! We identified this problem last week and patched our internal version to fix the fiona3 package since (if I remember correctly) geopandas does not fix the fiona version. We can merge your fix for now since the next release will come in the following weeks.

@pesap pesap added the good first issue Good for newcomers label Sep 27, 2024
@pesap pesap changed the title Update geopandas version to fix error with fiona fix: Update geopandas version to fix error with fiona Sep 27, 2024
@pesap pesap merged commit e65ed5e into NREL:main Sep 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants