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

Treat HP campaign args same as HP discount args #151

Merged
merged 6 commits into from
Dec 2, 2024

Conversation

charlotte-avery
Copy link
Collaborator

@charlotte-avery charlotte-avery commented Dec 2, 2024

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.

@charlotte-avery charlotte-avery marked this pull request as ready for review December 2, 2024 14:42
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)
Copy link
Member

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!

Copy link
Collaborator Author

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

Copy link
Member

@shengy90 shengy90 Dec 2, 2024

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.

Copy link
Member

@shengy90 shengy90 left a 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!

@charlotte-avery charlotte-avery merged commit 787504d into main Dec 2, 2024
4 checks passed
@charlotte-avery charlotte-avery deleted the allow-for-multiple-heat-pump-campaigns branch December 2, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants