Skip to content

Commit

Permalink
Link fixes (may be related to latest version now erroring)
Browse files Browse the repository at this point in the history
  • Loading branch information
danuw committed Jan 30, 2024
1 parent b7483b6 commit 4cece7b
Show file tree
Hide file tree
Showing 16 changed files with 2,143 additions and 2,120 deletions.
4 changes: 2 additions & 2 deletions casdk-docs/docs/architecture/c-sharp-client-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ To do the override, define a class that inherits from
CarbonAwareParametersBaseDTO and uses the [FromQuery(Name =
"myAwesomeDisplayName")] or [JsonPropertyName("myAwesomeDisplayName")]
attribute. A second (less recommended) option is to pass the optional arg
Dictionary<string, string>? displayNameMap when you are directly creating the
`Dictionary<string, string>? displayNameMap` when you are directly creating the
object. With either option, the SDK handles updating references internally.

### Required Properties
Expand Down Expand Up @@ -212,4 +212,4 @@ as part of error reporting.

## References

<https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/>
[https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/](https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/)
2 changes: 1 addition & 1 deletion casdk-docs/docs/architecture/data-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ of, that client.
processed the request, and then processes the response before returning a
final result.

### GSF Handler <-> Data Source Contract
### GSF Handler < - > Data Source Contract

In order for the SDK to support different data sources, there is a defined
contract between the Handler and the Data tier. The handler acts as the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ We need to record the architectural decisions made on this project.

We will use Architecture Decision Records, as described by Michael Nygard in
this article:
<http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions>
[http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions)

## Consequences

Expand Down
2 changes: 1 addition & 1 deletion casdk-docs/docs/architecture/decisions/0011-cd-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ Neutral

## References

- <https://github.com/Green-Software-Foundation/carbon-aware-sdk/discussions/46>
- [https://github.com/Green-Software-Foundation/carbon-aware-sdk/discussions/46](https://github.com/Green-Software-Foundation/carbon-aware-sdk/discussions/46)
- [GitHub Packages](https://github.com/features/packages)
- [GitHub Actions](https://github.com/features/actions)
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ Approved
## Context
Electricity Maps offers two different services:
- the paid one, which has already been added to the dev branch of the Carbon Aware SDK,
- and the free one, which they also call "CO2 Signal" (<https://www.co2signal.com/>), which the Carbon Aware SDK already supports in a [branch](https://github.com/Green-Software-Foundation/carbon-aware-sdk/tree/feat/electricity-map), though it is based on an older, now outdated version of the SDK.
- and the free one, which they also call "CO2 Signal" ([https://www.co2signal.com/](https://www.co2signal.com/)), which the Carbon Aware SDK already supports in a [branch](https://github.com/Green-Software-Foundation/carbon-aware-sdk/tree/feat/electricity-map), though it is based on an older, now outdated version of the SDK.

These two services, despite being provided by the same company, use different APIs. The free API isn't just a subset of the paid one: **the endpoints are different, the tokens are different, and the responses are different**. Here's an example of two equivalent calls to these services, getting the latest value for the Carbon Intensity in France:

- ElectricityMaps free (CO2 Signal):
- Documentation: <https://docs.co2signal.com/>
- Documentation: [https://docs.co2signal.com/](https://docs.co2signal.com/)
- Request:

`curl -s 'https://api.co2signal.com/v1/latest?countryCode=FR' -H 'auth-token: myapitoken'`

- Response:

```json
{
"_disclaimer": "This data is the exclusive property of Electricity Maps and/or related parties. If you're in doubt about your rights to use this data, please contact api@co2signal.com",
"status": "ok",
Expand All @@ -31,16 +31,16 @@ These two services, despite being provided by the same company, use different AP
"carbonIntensity": "gCO2eq/kWh"
}
}

```

- ElectricityMaps paid:
- Documentation: <https://static.electricitymaps.com/api/docs/index.html>
- Documentation: [https://static.electricitymaps.com/api/docs/index.html](https://static.electricitymaps.com/api/docs/index.html)
- Request:

`curl -s 'https://api.electricitymap.org/v3/carbon-intensity/latest?zone=FR' -H 'auth-token: myapitoken'`

- Response:

```json
{
"zone": "FR",
"carbonIntensity": 103,
Expand All @@ -50,6 +50,7 @@ These two services, despite being provided by the same company, use different AP
"isEstimated": true,
"estimationMethod": "TIME_SLICER_AVERAGE"
}
```
The goal is to support both services, to maximize the usage of the Carbon Aware SDK. The question is how to handle these differences.
Treating them as the same data source would require to add some complexity, to distinguish whether an account is free or paid. This distinction would have to be either in the form of an extra parameter, or it would require the Carbon Aware SDK to test every time (at least once per session) which service is meant, using a fallback logic: try the paid service first, and if you get an error try the free one. This adds complexity, requires managing the error code, and in any case forces to make more calls, which has a negative impact on the emissions.
Expand Down
12 changes: 6 additions & 6 deletions casdk-docs/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Prerequisites:
- Docker
- VSCode (it is recommended to work in a Dev Container)
- Remote Containers extension for VSCode:
<https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers>
[https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)

The CLI can either be run locally with `dotnet` or in a container, e.g. using
VSCode Remote Containers (Dev Container). To run locally:

1. Make sure you have the repository cloned:
<https://github.com/Green-Software-Foundation/carbon-aware-sdk.git>
[https://github.com/Green-Software-Foundation/carbon-aware-sdk.git](https://github.com/Green-Software-Foundation/carbon-aware-sdk.git)
2. `git clone https://github.com/Green-Software-Foundation/carbon-aware-sdk.git`
3. Change directory to: `cd carbon-aware-sdk/src/CarbonAware.CLI/src`
4. If you have a WattTime account registered (or other data source) - you will
Expand Down Expand Up @@ -176,10 +176,10 @@ Prerequisites:
- Docker Desktop/CLI
- VSCode (it is recommended to work in a Dev Container)
- Remote Containers extension for VSCode:
<https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers>
[https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)

First we need to set up the GitHub repository
(<https://github.com/Green-Software-Foundation/carbon-aware-sdk.git>):
([https://github.com/Green-Software-Foundation/carbon-aware-sdk.git](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)):

1. `git clone https://github.com/Green-Software-Foundation/carbon-aware-sdk.git`
2. Change directory into the repository: `cd carbon-aware-sdk`
Expand Down Expand Up @@ -233,11 +233,11 @@ First we need to set up the GitHub repository
Prerequisites:

- `curl` or other tool that allows making HTTP requests (e.g. `wget`)
- Recommended: `jq` for parsing JSON output: <https://stedolan.github.io/jq/>
- Recommended: `jq` for parsing JSON output: [https://stedolan.github.io/jq/](https://stedolan.github.io/jq/)

With the API running on `localhost:5073`, we can make HTTP requests to its
endpoints, full endpoint description can be found here:
<https://github.com/Green-Software-Foundation/carbon-aware-sdk/blob/dev/src/CarbonAware.WebApi/src/README.md>
[https://github.com/Green-Software-Foundation/carbon-aware-sdk/blob/dev/src/CarbonAware.WebApi/src/README.md](https://github.com/Green-Software-Foundation/carbon-aware-sdk/blob/dev/src/CarbonAware.WebApi/src/README.md)

To get a list of all locations supported, you can use the Locations API endpoint
`/locations` referenced in
Expand Down
4 changes: 2 additions & 2 deletions casdk-docs/docs/tutorial-basics/carbon-aware-webapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ that time period.

This endpoint lists all the supported locations that the datasources potentially
can have access to. This information is coming from the `location-source/json`
files, that contain dictionaries in the form of <A Location key name,
GeoCoordinates>, for instance:
files, that contain dictionaries in the form of `<A Location key name,
GeoCoordinates>`, for instance:

```json
{
Expand Down
Loading

0 comments on commit 4cece7b

Please sign in to comment.