innoTUgrid / backend

backend services for a microgrid data API
0 stars 0 forks source link

endpoint kpi/scope_one_emissions: use same interfacer and types as scope two emissions #51

Closed Tobiasloch closed 7 months ago

Tobiasloch commented 7 months ago

The scope one emissions returns its carrier_name as source_name. This should use an equal interface. Also solar and other equal carrier_names should have the same identifier such that it can be grouped together in the frontend (for example production_of_pv should be named solar as in scope_two_emissions). Maybe a local flag could be added, like in the energy consumption endpoint.

scope_one_emissions:

     {
         "bucket": "2018-12-31T00:00:00Z",
         "source_name": "production_of_chp",
         "value": 664.8032125000024,
         "unit": "kgco2eq"
     },
     {
         "bucket": "2018-12-31T00:00:00Z",
         "source_name": "production_of_pv",
         "value": 305.56735299999553,
         "unit": "kgco2eq"
     },

scope_two_emissions:

  {
        "bucket": "2018-12-31T00:00:00Z",
        "carrier_name": "biomass",
        "value": 804.9274458072457,
        "unit": "kgco2eq"
    },
    {
        "bucket": "2018-12-31T00:00:00Z",
        "carrier_name": "coal",
        "value": 2724.287476049966,
        "unit": "kgco2eq"
    },
    {
        "bucket": "2018-12-31T00:00:00Z",
        "carrier_name": "gas",
        "value": 937.8912903039173,
        "unit": "kgco2eq"
    },
    {
        "bucket": "2018-12-31T00:00:00Z",
        "carrier_name": "hydro",
        "value": 9.836571117212483,
        "unit": "kgco2eq"
    },
    {
        "bucket": "2018-12-31T00:00:00Z",
        "carrier_name": "lignite",
        "value": 15668.758333030737,
        "unit": "kgco2eq"
    },
    {
        "bucket": "2018-12-31T00:00:00Z",
        "carrier_name": "offwind",
        "value": 21.764500523621187,
        "unit": "kgco2eq"
    },
    {
        "bucket": "2018-12-31T00:00:00Z",
        "carrier_name": "onwind",
        "value": 253.9778896549412,
        "unit": "kgco2eq"
    },
    {
        "bucket": "2018-12-31T00:00:00Z",
        "carrier_name": "solar",
        "value": 25.299261400023752,
        "unit": "kgco2eq"
    },