-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Savings: add Belgium and update co2 with 2024 data #26435
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
Merged
Conversation
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
Contributor
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.
Hey - I've found 1 issue, and left some high level feedback:
- Consider adding an explicit
yearfield (e.g.year: 2024) alongside theco2values so it’s clear which dataset these numbers correspond to and future updates are less error-prone. - You may want to define and export a
Regiontype/interface for the{ name, co2 }objects so that any future additions (like Belgium here) are type-checked consistently across the codebase.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding an explicit `year` field (e.g. `year: 2024`) alongside the `co2` values so it’s clear which dataset these numbers correspond to and future updates are less error-prone.
- You may want to define and export a `Region` type/interface for the `{ name, co2 }` objects so that any future additions (like Belgium here) are type-checked consistently across the codebase.
## Individual Comments
### Comment 1
<location> `assets/js/components/Savings/co2Reference.ts:6-15` </location>
<code_context>
- { name: "United Kingdom", co2: 257 },
- { name: "United States", co2: 367 },
- { name: "World", co2: 436 },
+ { name: "Australia", co2: 552 },
+ { name: "Austria", co2: 103 },
+ { name: "Belgium", co2: 118 },
+ { name: "Canada", co2: 175 },
+ { name: "Czech Republic", co2: 414 },
+ { name: "Denmark", co2: 143 },
+ { name: "Estonia", co2: 341 },
+ { name: "Europe", co2: 284 },
+ { name: "Finland", co2: 72 },
+ { name: "France", co2: 44 },
+ { name: "Germany", co2: 344 },
+ { name: "Netherlands", co2: 253 },
+ { name: "Norway", co2: 31 },
+ { name: "Poland", co2: 615 },
+ { name: "Sweden", co2: 36 },
+ { name: "Switzerland", co2: 37 },
+ { name: "United Kingdom", co2: 211 },
+ { name: "United States", co2: 384 },
+ { name: "World", co2: 473 },
];
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Clarify or centralize the assumed units for `co2` values to avoid subtle misinterpretations elsewhere.
Since these values’ meaning depends on their units (e.g. gCO₂/kWh vs kgCO₂/MWh), consider exporting a shared unit constant alongside `regions` so all consumers format and convert them consistently and don’t accidentally assume a different scale.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
|
Updated the tests and added 2024 to the comments. I think adding a Region interface / or adding 2024 to the data itself is a bit to much. |
052ca88 to
0921553
Compare
Member
|
Thanks for the update! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I've added Belgium to the data points 🥳 and then noticed that the co2 data wasn't from 2024. I've updated all listed / included countries.