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

v0.41.0 master < develop #357

Merged
merged 85 commits into from
Mar 12, 2024
Merged

v0.41.0 master < develop #357

merged 85 commits into from
Mar 12, 2024

Conversation

adfarth
Copy link
Collaborator

@adfarth adfarth commented Mar 8, 2024

See #352 and #235

using Cambium instead of AVERT for CO2 emissions by default
Based on Cambium 2022 Mid-Case Scenario, LRMER CO2e (Combustion+Precombustion) 2024-2049 values
end use or busbar
This will prevent a Cambium API call with each unit test
For tests:
- changed "region_abbreviation" to "avert_region_abbreviation"
- Updated RE and Emissions expected values to account for alignment between load year and emissions year (tested with assumed AVERT emissions year of 2017 to ensure that this is why the emissions values changed)
- Added 0 grid emissions to scenario.jl when off_grid_flag is true
@adfarth adfarth changed the title v0.4.1 v0.41.0 master < develop Mar 8, 2024
@adfarth adfarth marked this pull request as ready for review March 8, 2024 23:22
@adfarth adfarth requested a review from Bill-Becker March 8, 2024 23:22
@Bill-Becker
Copy link
Collaborator

@adfarth have you run test_with_xpress.jl locally?

@adfarth
Copy link
Collaborator Author

adfarth commented Mar 11, 2024

@adfarth have you run test_with_xpress.jl locally?

Thank you for the reminder! I had not, but now I have and all tests have passed locally.

Copy link
Collaborator

@Bill-Becker Bill-Becker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there breaking changes other than expected differences in emissions accounting and results when doing emissions reduction goals or CO2 cost in the optimization?

Otherwise, just a couple of questions about runtests.jl versus test_with_xpress.jl.

test/runtests.jl Outdated
@@ -1895,6 +1982,7 @@ else # run HiGHS tests
end
end

# TODO: refresh tests and test values as needed after Cambium update; revised values are in test_with_xpress.jl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_with_xpress.jl is using a different/updated Cambium version/data?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bill-Becker These are the emissions tests that Alex commented out a while back because they weren't compatible with the HiGHS solver. The test values are slightly updated because of the AVERT data update that we made in this PR. Alex added this note to indicate that once we are able to run these tests with a non-Xpress solver, we should update the values here. Does that all make sense?

@@ -1377,6 +1377,82 @@ end
@test calculated_ghp_capex ≈ reopt_ghp_capex atol=300
end

@testset "Cambium Emissions" begin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same test as in "runtests.jl" with the HiGHS solver? If so, we don't need to add it here. We should be prioritizing adding tests to runtests.jl with an open source solver whenever possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this was exactly the same as the one in runtests. I deleted this testset in test_with_xpress in cb6d9d9

@Bill-Becker
Copy link
Collaborator

@adfarth also, just confirming again that you ran test_with_xpress.jl locally with this develop branch.

@adfarth
Copy link
Collaborator Author

adfarth commented Mar 11, 2024

@adfarth also, just confirming again that you ran test_with_xpress.jl locally with this develop branch.

Yes, confirmed that I ran this on the develop branch.

@adfarth
Copy link
Collaborator Author

adfarth commented Mar 11, 2024

Is there breaking changes other than expected differences in emissions accounting and results when doing emissions reduction goals or CO2 cost in the optimization?

Otherwise, just a couple of questions about runtests.jl versus test_with_xpress.jl.

Summary of changes at a high level:

  • Emissions results will change for all analyses (Cambium now used by default for climate emissions, health emissions from AVERT are updated to more recent version)
  • If an emissions reduction goal is added or CO2 cost considered in optimization, then optimal results will change
  • (Breaking based on change to inputs and outputs names) Updated electric_utility emissions_region to avert_emissions_region and distance_to_emissions_region_meters to distance_to_avert_emissions_region_meters in src/electric_utility.jl and results/electric_utility.jl
  • (Breaking for anyone using this export) Changed name of exported function emissions_profiles to avert_emissions_profiles
  • Changed calculation of all annual emissions results (e.g. Site.annual_emissions_tonnes_CO2) to simple annual averages (lifecycle emissions divided by analysis_years). This is because the default climate emissions from Cambium are already levelized over the analysis horizon and therefore "year_one" emissions cannot be easily obtained.

@Bill-Becker Bill-Becker self-requested a review March 12, 2024 03:27
Copy link
Collaborator

@Bill-Becker Bill-Becker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the responses - they all look good. Related to the discussion of Xpress versus HiGHS tests - does anything you added with this PR require Xpress to work properly? We are about to take Xpress down from the publicly available API.

@adfarth
Copy link
Collaborator Author

adfarth commented Mar 12, 2024

Thanks for the responses - they all look good. Related to the discussion of Xpress versus HiGHS tests - does anything you added with this PR require Xpress to work properly? We are about to take Xpress down from the publicly available API.

Not that I can think of. I think there were some emissions modeling capabilities that were timing out or failing with HiGHS (hence the commented out tests in runtests), but those are not explicitly related to any change introduced by this PR (this is just changing the data sources, not any constraints)

@adfarth adfarth merged commit 677f3d9 into master Mar 12, 2024
4 checks passed
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.

None yet

3 participants