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

AWY validation doesn't catch missing demand table when doing valuation #1769

Closed
phargogh opened this issue Feb 5, 2025 · 0 comments · Fixed by #1770
Closed

AWY validation doesn't catch missing demand table when doing valuation #1769

phargogh opened this issue Feb 5, 2025 · 0 comments · Fixed by #1770
Assignees
Labels
in progress This issue is actively being worked on

Comments

@phargogh
Copy link
Member

phargogh commented Feb 5, 2025

Nfamara recently contacted me about an exception he was experiencing (see below). This was caused because he had provided a valuation table, but not provided a demand table. This dependency is not clearly identified in the UG, nor is it clearly identified in validation.

ERROR:taskgraph.Task:Something went wrong when adding task create_ws_id_vector_output (13), terminating taskgraph.
Traceback (most recent call last):
  File "/Users/jdouglass/Downloads/2025-01-31-nfamara-awy/env312/lib/python3.12/site-packages/taskgraph/Task.py", line 674, in add_task
    new_task._call()
  File "/Users/jdouglass/Downloads/2025-01-31-nfamara-awy/env312/lib/python3.12/site-packages/taskgraph/Task.py", line 1093, in _call
    payload = self._func(*self._args, **self._kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jdouglass/Downloads/2025-01-31-nfamara-awy/env312/lib/python3.12/site-packages/natcap/invest/annual_water_yield.py", line 945, in write_output_vector_attributes
    compute_watershed_valuation(target_vector_path, valuation_df)
  File "/Users/jdouglass/Downloads/2025-01-31-nfamara-awy/env312/lib/python3.12/site-packages/natcap/invest/annual_water_yield.py", line 1118, in compute_watershed_valuation
    rsupply_vl = ws_feat.GetField('rsupply_vl')
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jdouglass/Downloads/2025-01-31-nfamara-awy/env312/lib/python3.12/site-packages/osgeo/ogr.py", line 4405, in GetField
    raise KeyError("Illegal field requested in GetField()")
KeyError: 'Illegal field requested in GetField()'
@phargogh phargogh added the in progress This issue is actively being worked on label Feb 5, 2025
@phargogh phargogh self-assigned this Feb 5, 2025
phargogh added a commit to phargogh/invest that referenced this issue Feb 5, 2025
The demand table is now required when the valuation table is provided.

RE:natcap#1769
phargogh added a commit to phargogh/invest that referenced this issue Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress This issue is actively being worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant