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

Electricity mix flexibility #66

Merged
merged 22 commits into from
Aug 28, 2024
Merged

Electricity mix flexibility #66

merged 22 commits into from
Aug 28, 2024

Conversation

adrienbanse
Copy link
Member

@adrienbanse adrienbanse commented Jul 25, 2024

This PR implements

  • ecologits/mix_repository.py A mix repository from the ADEME database csv ecologits/data/mixes.csv
  • The possibility for the user to choose a mix when calling llm_impacts
  • Modify and implement tests

@adrienbanse adrienbanse linked an issue Jul 25, 2024 that may be closed by this pull request
@adrienbanse adrienbanse marked this pull request as ready for review July 26, 2024 14:19
@adrienbanse adrienbanse requested a review from samuelrince July 26, 2024 14:20
@samuelrince samuelrince marked this pull request as draft August 5, 2024 09:24
ecologits/impacts/llm.py Outdated Show resolved Hide resolved
ecologits/impacts/llm.py Outdated Show resolved Hide resolved
ecologits/mix_repository.py Outdated Show resolved Hide resolved
ecologits/mix_repository.py Outdated Show resolved Hide resolved
ecologits/tracers/utils.py Outdated Show resolved Hide resolved
@adrienbanse adrienbanse marked this pull request as ready for review August 27, 2024 08:15
@samuelrince
Copy link
Member

Thanks @adrienbanse, this looks good!

One remark about on the usage of pycountry. As I can see, we only use the library to check if a country code exists, right? But, we could also perform this check by just looking if the code exists in the electricity mix repository. Thus, the pycountry dependency is not really necessary, so I think we can remove it. Generally speaking, the less dependence we have the better, I would say! :)

If we want to support other country code formats, we can also pre-compute them in the file. I am working the ecologits-data repository mainly for the models, but we can integrate this file later with some logic.

We can work on the interface on how to change the country code in another PR about "configuration management", what do you think?

@adrienbanse
Copy link
Member Author

@samuelrince Agreed, I removed pycountry from the PR.

Yes let's merge it as it is now, and let's open a PR in ecologits-data to handle alpha-2, alpha-3, official names etc. (and use pycountry there). I think we can even handle emoji flags 😄

Yes this PR is only for the implementation of the flexibility, now I'll start to work on a general configuration in Ecologits.init() for choosing the mix, maybe a verbose parameter, ...

@samuelrince samuelrince merged commit a0665d2 into main Aug 28, 2024
2 checks passed
@samuelrince samuelrince deleted the feat/mix branch August 28, 2024 12:33
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.

Support regional energy mixes
2 participants