Skip to content

Commit

Permalink
doc: include providers and electricity_mix_zone kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbanse committed Sep 9, 2024
1 parent ea01da2 commit b9e3a80
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
20 changes: 15 additions & 5 deletions docs/tutorial/impacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,22 @@ We use impact factors to quantify environmental harm from human activities, meas

### Electricity Mix

**We currently assume by default a worldwide average impact factor for electricity consumption**. We plan to allow users to change these impact factors dynamically based on a specific country/region or with custom values.
When initializing `EcoLogits`, you can choose a specific electricity mix zone from the [ADEME Base Empreinte®](https://base-empreinte.ademe.fr/) database.

Default values (from [ADEME Base Empreinte®](https://base-empreinte.ademe.fr/)):
```python title="Choose a different electricity mix"
from ecologits import EcoLogits

EcoLogits.init()
# Impacts are computed with the world electricity mix

EcoLogits.init(electricity_mix_zone="FRA")
# Impacts are computed with the electricity mix of France
```

By default, the **world electricity mix** ("WOR" code in the [ADEME Base Empreinte®](https://base-empreinte.ademe.fr/) database) is chosen, whose values are given by:

| Impact criteria | Value | Unit |
|-----------------|------------|-----------------|
| GWP | $5.904e-1$ | $kgCO2eq / kWh$ |
| ADPe | $7.378e-7$ | $kgSbeq / kWh$ |
| PE | $9.988$ | $MJ / kWh$ |
| GWP | $5.904e-1$ | kgCO2eq / kWh |
| ADPe | $7.378e-7$ | kgSbeq / kWh |
| PE | $9.988$ | MJ / kWh |
20 changes: 17 additions & 3 deletions docs/tutorial/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,24 @@ from ecologits import EcoLogits
EcoLogits.init()

# Initialize for `openai` provider only
EcoLogits.init("openai")
EcoLogits.init(providers="openai")

# Initialize for `openai` and `anthropic` providers only
EcoLogits.init(["openai", "anthropic"])
EcoLogits.init(providers=["openai", "anthropic"])
```

It is currently not possible to un-initialize a provider at runtime. If that's the case do not hesitate to [open an issue :octicons-link-external-16:](https://github.com/genai-impact/ecologits/issues/new/choose) and explain why it could be necessary for your use case.
!!! warning "It is currently not possible to un-initialize a provider at runtime. Each time that `EcoLogits` is re-initialized with another providers, the latter will be added to the list of already initialized providers. If you think that un-initializing a provider could be necessary for your use case, please [open an issue :octicons-link-external-16:](https://github.com/genai-impact/ecologits/issues/new/choose)."

It is also possible to initialize `EcoLogits` with a different electricity mix. The latter has to be chosen among the mixes in the [ADEME Base Empreinte®](https://base-empreinte.ademe.fr/) database.

!!! info "The default electricity mix is the world mix given by [ADEME Base Empreinte®](https://base-empreinte.ademe.fr/)."

```python title="Choose a different electricity mix"
from ecologits import EcoLogits

EcoLogits.init()
# Impacts are computed with the world electricity mix

EcoLogits.init(electricity_mix_zone="FRA")
# Impacts are computed with the electricity mix of France
```

0 comments on commit b9e3a80

Please sign in to comment.