forked from Green-Software-Foundation/carbon-aware-sdk
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from microsoft/216/datasourceDocMatrix
Datasource Selection Documentation
- Loading branch information
Showing
2 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Selecting a Data Source | ||
|
||
The Carbon Aware SDK includes access to various data sources of carbon aware data, including WattTime, ElectricityMaps, and a custom JSON source. These matrices are an attempt to track what features of the Carbon Aware SDK are enabled for which data sources. | ||
|
||
## Contents | ||
|
||
- [Type of Data Sources and Configuration](#type-of-data-sources-and-configuration) | ||
- [Data Source Methods Available](#data-source-methods-available) | ||
- [Location Coverage](#location-coverage) | ||
|
||
## Type of Data Sources and Configuration | ||
|
||
In the CarbonAware SDK configuration, you can set what data source to use as the `EmissionsDataSource` and the `ForecastDataSource`. There are also certain configuration fields that must be set in order to access the raw data. | ||
| Type | WattTime | ElectricityMaps | JSON | | ||
|--------------------------|-----------|-----------------|------| | ||
| Is Emissions DataSource | ✅ | ✅ | ✅ | | ||
| Is Forecast DataSource | ✅ | ✅ | ❌ | | ||
| Makes HTTP(s) call | ✅ | ✅ | ❌ | | ||
| Can Use Custom Data | ❌ | ❌ | ✅ | | ||
| Supports Trial + Full Account | ✅ | ✅ (*[different config required](./configuration.md#electricitymaps-configuration)) | N/A | | ||
|
||
## Data Source Methods Available | ||
|
||
Not all data sources support all the routes provided in the interfaces (`IEmissionsDataSource`/`IForecastDataSource`). | ||
|
||
| Methods | WattTime | ElectricityMaps | JSON | CLI Usage | Web Api Usage | SDK Usage | ||
|--------------|:-----------:|:-----------------:|:------:|:-:|:-:|:-:| | ||
| GetCarbonIntensityAsync | ✅ | ✅ | ✅ |`emissions`|`emissions/bylocation` or `emissions/bylocations` or `emissions/bylocations/best` or `emissions/average`‑`carbon`‑`intensity` or `emissions/average`‑`carbon`‑`intensity/batch`|`GetEmissionsDataAsync(...)` or `GetBestEmissionsDataAsync(...)` or `GetAverageCarbonIntensityDataAsync(...)`| | ||
| GetCurrentForecastAsync | ✅ | ✅ | ❌ |`emissions`‑`forecasts`|`forecasts/current`|`GetCurrentForecastAsync(...)`| | ||
| GetForecastByDateAsync | ✅ | ❌ | ❌ |`emissions`‑`forecasts` ‑‑`requested`‑`at`|`forecasts/batch` with `requestedAt` field|`GetForecastByDateAsync(...)`| | ||
|
||
## Location Coverage | ||
|
||
Different data sources provide both different features (as outlined above) but also coverage of different geographic areas. It's important to note that each data source may have different region names, which are handled through the location config. | ||
|
||
- For `WattTime`, see their [interactive coverage map](https://www.watttime.org/explorer) to find the relevant zone. | ||
- For `ElectricityMaps`, see their [live map app](https://app.electricitymaps.com/map?utm_source=electricitymaps.com&utm_medium=website&utm_campaign=banner) to find the relevant zone and see current data coming in. |