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 key-errors for in data_apapter.resolve_paths #121

Closed
DirkEilander opened this issue Apr 21, 2022 · 0 comments
Closed

fix key-errors for in data_apapter.resolve_paths #121

DirkEilander opened this issue Apr 21, 2022 · 0 comments
Labels
Bug Something isn't working

Comments

@DirkEilander
Copy link
Contributor

We can escape unknown keys by doubling the { }
see also https://stackoverflow.com/questions/20673316/keyerror-when-using-format-on-a-string-in-python

ref error:

File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{172729CE-4BD1-48B3-8852-95B69B4E24A4}\SVROOT\repo\hydromt_wflow\hydromt_wflow\wflow.py", line 768, in setup_gauges
gdf = self.data_catalog.get_geodataframe(
File "c:\Users\velden\Miniconda3\envs\hydromt-wflow\lib\site-packages\hydromt\data_adapter.py", line 517, in get_geodataframe
gdf = source.get_data(
File "c:\Users\velden\Miniconda3\envs\hydromt-wflow\lib\site-packages\hydromt\data_adapter.py", line 1524, in get_data
_ = self.resolve_paths() # throw nice error if data not found
File "c:\Users\velden\Miniconda3\envs\hydromt-wflow\lib\site-packages\hydromt\data_adapter.py", line 784, in resolve_paths
path = str(self.path).format(year=yr, month=mth, variable=var)
KeyError: '45c63495-0000-0000-0000-100000000000'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant