Skip to content

Commit

Permalink
Merge pull request #180 from oemof/feature/ghg_facades
Browse files Browse the repository at this point in the history
Add facades CommodityGHG and ConversionGHG
  • Loading branch information
SabineHaas authored Aug 22, 2024
2 parents a18459d + 3c6bc94 commit ba77ec1
Show file tree
Hide file tree
Showing 22 changed files with 959 additions and 26 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ Authors
* Julian Endres
* Felix Maurer
* Pierre-Francois Duc
* Sabine Haas
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Unreleased

Features
* Improve the function to infer package metadata `#173 <https://github.com/oemof/oemof-tabular/pull/173>`_
* Add facades `CommodityGHG` and `ConversionGHG` to enable multiple output flows (emissions) `#180 <https://github.com/oemof/oemof-tabular/pull/180>`_

Fixes

Expand Down
4 changes: 3 additions & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ Currently we provide the following facades:
* :py:class:`~oemof.tabular.facades.ExtractionTurbine`
* :py:class:`~oemof.tabular.facades.Commodity`
* :py:class:`~oemof.tabular.facades.Conversion`
* :py:class:`~oemof.tabular.facades.Load`.
* :py:class:`~oemof.tabular.facades.Load`
* :py:class:`~oemof.tabular.facades.Link`
* :py:class:`~oemof.tabular.facades.Excess`
* :py:class:`~oemof.tabular.facades.CommodityGHG`: a commodity unit with green house gases
* :py:class:`~oemof.tabular.facades.ConversionGHG`: a conversion unit with green house gases.

These can be mixed with all oemof solph classes if your are scripting.

Expand Down
5 changes: 5 additions & 0 deletions src/oemof/tabular/examples/datapackages/GHG/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Green house gases (GHG) example for oemof-tabular

Run `scripts/infer.py` from the datapackage root directory to add the
meta data file `datapackage.json` after updating the resources of the
datapackage.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name;type;balanced
co2;bus;false
ch4;bus;false
n2o;bus;false
el_bus;bus;true
gas_bus;bus;true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name;type;carrier;amount;bus;emission_bus_0;marginal_cost;output_parameters;emission_factor_co2
green_gas_import;commodity_ghg;gas;300;gas_bus;co2;20;{"max": [1, 1, 1]};-56
fossile_gas_import;commodity_ghg;gas;200;gas_bus;co2;10;{"max": [1, 0, 0]};56
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name;type;carrier;tech;capacity;from_bus;to_bus;emission_bus_0;emission_bus_1;emission_bus_2;marginal_cost;efficiency;emission_factor_co2;emission_factor_ch4;emission_factor_n2o
gtGHG;conversion_ghg;electricity;gt;300;gas_bus;el_bus;co2;ch4;n2o;10;0.5;56;0.4;0.017
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name;type;bus;capacity
gas_excess;excess;gas_bus;1000000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name;amount;profile;type;bus
demand0;100;electricity-load-profile;load;el_bus
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name;type;carrier;tech;bus;capacity;marginal_cost
el_shortage;shortage;electricity;shortage;el_bus;100000000;100000
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
timeindex,electricity-load-profile
2011-01-01T00:00:00Z,1
2011-01-01T01:00:00Z,0.5
2011-01-01T02:00:00Z,0.1
325 changes: 325 additions & 0 deletions src/oemof/tabular/examples/datapackages/GHG/datapackage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,325 @@
{
"profile": "tabular-data-package",
"name": "GHG-test",
"oemof_tabular_version": "0.0.6dev",
"resources": [
{
"path": "data/elements/bus.csv",
"profile": "tabular-data-resource",
"name": "bus",
"format": "csv",
"mediatype": "text/csv",
"encoding": "utf-8",
"schema": {
"fields": [
{
"name": "name",
"type": "string",
"format": "default"
},
{
"name": "type",
"type": "string",
"format": "default"
},
{
"name": "balanced",
"type": "boolean",
"format": "default"
}
],
"missingValues": [
""
],
"primaryKey": "name",
"foreignKeys": []
}
},
{
"path": "data/elements/conversionGHG.csv",
"profile": "tabular-data-resource",
"name": "conversionGHG",
"format": "csv",
"mediatype": "text/csv",
"encoding": "utf-8",
"schema": {
"fields": [
{
"name": "name",
"type": "string",
"format": "default"
},
{
"name": "type",
"type": "string",
"format": "default"
},
{
"name": "carrier",
"type": "string",
"format": "default"
},
{
"name": "tech",
"type": "string",
"format": "default"
},
{
"name": "capacity",
"type": "integer",
"format": "default"
},
{
"name": "from_bus",
"type": "string",
"format": "default"
},
{
"name": "to_bus",
"type": "string",
"format": "default"
},
{
"name": "emission_bus_0",
"type": "string",
"format": "default"
},
{
"name": "emission_bus_1",
"type": "string",
"format": "default"
},
{
"name": "emission_bus_2",
"type": "string",
"format": "default"
},
{
"name": "marginal_cost",
"type": "integer",
"format": "default"
},
{
"name": "efficiency",
"type": "number",
"format": "default"
},
{
"name": "emission_factor_co2",
"type": "number",
"format": "default"
},
{
"name": "emission_factor_ch4",
"type": "number",
"format": "default"
},
{
"name": "emission_factor_n2o",
"type": "number",
"format": "default"
}
],
"foreignKeys": [
{
"fields": "from_bus",
"reference": {
"resource": "bus",
"fields": "name"
}
},
{
"fields": "to_bus",
"reference": {
"resource": "bus",
"fields": "name"
}
},
{
"fields": "emission_bus_0",
"reference": {
"resource": "bus",
"fields": "name"
}
},
{
"fields": "emission_bus_1",
"reference": {
"resource": "bus",
"fields": "name"
}
},
{
"fields": "emission_bus_2",
"reference": {
"resource": "bus",
"fields": "name"
}
}
],
"missingValues": [
""
],
"primaryKey": "name"
}
},
{
"path": "data/elements/commodityGHG_import.csv",
"profile": "tabular-data-resource",
"name": "commodityGHG_import",
"format": "csv",
"mediatype": "text/csv",
"encoding": "utf-8",
"schema": {
"fields": [
{
"name": "name",
"type": "string",
"format": "default"
},
{
"name": "type",
"type": "string",
"format": "default"
},
{
"name": "carrier",
"type": "string",
"format": "default"
},
{
"name": "amount",
"type": "integer",
"format": "default"
},
{
"name": "bus",
"type": "string",
"format": "default"
},
{
"name": "emission_bus_0",
"type": "string",
"format": "default"
},
{
"name": "marginal_cost",
"type": "integer",
"format": "default"
},
{
"name": "output_parameters",
"type": "object",
"format": "default"
},
{
"name": "emission_factor_co2",
"type": "number",
"format": "default"
}
],
"missingValues": [
""
],
"primaryKey": "name",
"foreignKeys": [
{
"fields": "bus",
"reference": {
"resource": "bus",
"fields": "name"
}
},
{
"fields": "emission_bus_0",
"reference": {
"resource": "bus",
"fields": "name"
}
}
]
}
},
{
"path": "data/elements/load.csv",
"profile": "tabular-data-resource",
"name": "load",
"format": "csv",
"mediatype": "text/csv",
"encoding": "utf-8",
"schema": {
"fields": [
{
"name": "name",
"type": "string",
"format": "default"
},
{
"name": "amount",
"type": "integer",
"format": "default"
},
{
"name": "profile",
"type": "string",
"format": "default"
},
{
"name": "type",
"type": "string",
"format": "default"
},
{
"name": "bus",
"type": "string",
"format": "default"
}
],
"missingValues": [
""
],
"primaryKey": "name",
"foreignKeys": [
{
"fields": "bus",
"reference": {
"resource": "bus",
"fields": "name"
}
},
{
"fields": "profile",
"reference": {
"resource": "load_profile"
}
}
]
}
},
{
"path": "data/sequences/load_profile.csv",
"profile": "tabular-data-resource",
"name": "load_profile",
"format": "csv",
"mediatype": "text/csv",
"encoding": "utf-8",
"schema": {
"fields": [
{
"name": "timeindex",
"type": "datetime",
"format": "default"
},
{
"name": "electricity-load-profile",
"type": "number",
"format": "default"
}
],
"missingValues": [
""
]
}
}
]
}
Loading

0 comments on commit ba77ec1

Please sign in to comment.