-
Notifications
You must be signed in to change notification settings - Fork 1
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
Treat HP campaign args same as HP discount args #151
Conversation
simulation/__main__.py
Outdated
f"Campaign target awareness must be greater than or equal to the population heat pump awareness, got campaign_target_heat_pump_awareness:{args.campaign_target_heat_pump_awareness}, heat_pump_awareness:{args.heat_pump_awareness}" | ||
if args.campaign_target_heat_pump_awareness_date is not None: | ||
# Check that target awareness inputs increase over the model horizon | ||
campaigns = sorted(args.campaign_target_heat_pump_awareness_date) |
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.
This should be a function that we unit test I think!
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.
See test_campaign_target_less_than_heat_pump_awareness_raises_value_error
in test_main
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.
Oh I mean the logic inside this if
statement - it's a pretty convoluted logic that I think we should write as a function, then test that given inputs you get expected output.
e.g.
if args.campaign_target_heat_pump_awareness_date is not None:
x = parse_campaign_dates_and_target(arg1, arg2)
# in test_main.py
def test_parse_campaign_dates_and_target():
test this function.
Increase maintainability of the code - if someone changes some stuff then this test will break, and they'd have to either update the tests (if break is intended) or fix the change to conform to the test etc.
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.
Approving but should test check_parsed_target_heat_pump_awareness
explicitly and with parametrised tests as well next time!
Run ABM with HP awareness starting at 25%, increasing to 50% at 2030 and 75% by 2034. To achieve this, allow for user to run ABM with multiple inputs for the HP awareness campaign similar to the inputs for HP discount args.
Update grant caps for BUS.