-
Notifications
You must be signed in to change notification settings - Fork 1
Add missing wild_foods_valid_instances in the consolidated_instances … #145
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
Merged
rhunwicks
merged 6 commits into
main
from
HEA-677/Key_error_'Fishing'_in_consolidated_fixture-asset
Sep 3, 2025
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b328a1b
Add missing wild_foods_valid_instances in the consolidated_instances …
girumb b3f68f6
Blackify fixture.py see HEA-677
girumb d340f51
Merge branch 'main' into HEA-677/Key_error_'Fishing'_in_consolidated_…
girumb 53a4d5b
Add model keys 'Fishing' and 'WildFoodGathering' see HEA-677
girumb b789019
Merge branch 'main' into HEA-677/Key_error_'Fishing'_in_consolidated_…
girumb b6474bb
Address PR feedback see HEA677
girumb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -338,7 +338,9 @@ def consolidated_fixture( | |
| for model_name, instances in livelihood_activity_valid_instances.items() | ||
| if model_name != "WealthGroup" | ||
| }, | ||
| **wild_foods_valid_instances, | ||
| } | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would this be better as: # Add the wild foods and other cash income instances, if they are present
for model_name, instances in {**other_cash_income_valid_instances, **wild_foods_valid_instances}.items():
if instances and model_name != "WealthGroup":
if model_name not in consolidated_instances:
consolidated_instances[model_name] = []
consolidated_instances[model_name] += instancesThat way, if we ever have to add additional models in the future it will still work.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, agreed. Pushed the updates |
||
| # Add the wild foods and other cash income instances, if they are present | ||
| for model_name, instances in {**other_cash_income_valid_instances, **wild_foods_valid_instances}.items(): | ||
| if instances and model_name != "WealthGroup": | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@girum-air why is this required? Doesn't the code below on line 345 add the
wild_foods_valid_instances?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhunwicks the keys
FishingandWildFoodGatheringweren't in theconsolidated_instancesat the line and that raises key error -Key error 'Fishing' in consolidated_fixture assetwhen trying to append it using += We might either need the keys added with empty list to initialize, I think that is better and updated it