Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Oct 8, 2023
2 parents 4dfec23 + fb22795 commit d97906d
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 924 deletions.
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# scenario-example-bread ![GitHub release (latest by date)](https://img.shields.io/github/v/release/premise-community-scenarios/scenario-example-bread) [![DOI](https://zenodo.org/badge/496564841.svg)](https://zenodo.org/badge/latestdoi/496564841)
# exercise-car-europe ![GitHub release (latest by date)](https://img.shields.io/github/v/release/premise-community-scenarios/scenario-example-bread) [![DOI](https://zenodo.org/badge/496564841.svg)](https://zenodo.org/badge/latestdoi/496564841)


Description
-----------

This is an example of a repository containing a custom prospective scenario for breadmaking, to be used in premise.
This is a data package that contains all the files necessary for premise to implement
this custom scenario. This is a dummy scenario to illustrate the principle of custom scenarios and their use alongside IAM scenarios.
Use this scenario as a template for your own custom scenario.
This is an example of a repository containing a custom prospective scenario for analysing the environmental
impacts of the future European car fleet.

Sourced from publication
------------------------
Expand All @@ -17,18 +15,18 @@ None
Data validation
---------------

Goodtables.io [![goodtables.io](https://goodtables.io/badge/github/premise-community-scenarios/scenario-example-bread.svg)](https://goodtables.io/github/premise-community-scenarios/scenario-example-bread)
None

Test
----

GitHubAction ![example workflow](https://github.com/premise-community-scenarios/scenario-example-bread/actions/workflows/main.yml/badge.svg?branch=main)
GitHubAction ![example workflow](https://github.com/premise-community-scenarios/exercise-car-europe/actions/workflows/main.yml/badge.svg?branch=main)


Ecoinvent database compatibility
--------------------------------

ecoinvent 3.8 cut-off
ecoinvent 3.9.1 cut-off

IAM scenario compatibility
---------------------------
Expand All @@ -47,8 +45,8 @@ How to use it?
from datapackage import Package


fp = r"https://raw.githubusercontent.com/premise-community-scenarios/scenario-example-bread/main/datapackage.json"
bread_scenario = Package(fp)
fp = r"https://raw.githubusercontent.com/romainsacchi/exercise-car-europe/main/datapackage.json"
cars_scenario = Package(fp)

bw.projects.set_current("your_bw_project")

Expand All @@ -57,11 +55,11 @@ How to use it?
{"model":"image", "pathway":"SSP2-Base", "year":2050,},
{"model":"image", "pathway":"SSP2-RCP26", "year":2030,},
],
source_db="ecoinvent 3.8 cutoff",
source_version="3.8",
source_db="ecoinvent 3.9.1 cutoff",
source_version="3.9",
key='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
external_scenarios=[
bread_scenario, # <-- list datapackage objects here
cars_scenario, # <-- list datapackage objects here
]
)

Expand Down
219 changes: 51 additions & 168 deletions configuration_file/config.yaml
Original file line number Diff line number Diff line change
@@ -1,199 +1,82 @@
# Configuration file for custom scenarios for `premise`

# in this example, we have three technologies: ADD, SDM, DSM
# to represent bread baking
# these technologies will be made specific to each IAM region, unless
# exception are specified
# then, market for bread will be created for each IAM region

---

# `production pathways` lists the different technologies
production pathways:
# name given to a technology: this name is internal to premise
ADD:
# variables to look for in the scenario_data file to fetch production volumes
# values fetched from the scenario_data file as production volumes are used to calculate
# the supply share if markets are to be built
ICEV:
production volume:
# `variable` in `production volume` refers to the variable name in the scenario_data file
variable: Production|Baking|Bread|Activated Dough Development
# OPTIONAL: `efficiency` and underlying `variable` refers to the values to look for in the scenario_data file
# if the technology is believed to improve over time.
efficiency:
- variable: Efficiency|Baking|Bread|Activated Dough Development (Elec and steam)
# OPTIONAL: reference year to calculate efficiency delta from
reference year: 2025
# OPTIONAL: `includes` is optional, and indicates if the efficiency gains apply only on certain input or flows
# of the dataset
includes:
# efficiency gains will only apply to flows whose name contains `electricity`
technosphere:
- electricity
# efficiency gains will only apply to flows whose name contains `Water`
# case sensitive!!!
biosphere:
- Water
- variable: Efficiency|Baking|Bread|Activated Dough Development (Salt)
# OPTIONAL: `includes` is optional, and indicates if the efficiency gains apply only on certain input or flows
# of the dataset
includes:
# efficiency gains will only apply to flows whose name contains `electricity`
technosphere:
- salt

# dataset in the imported inventories that represents the technology
variable: Share|ICEV
ecoinvent alias:
# name of the dataset
name: bread production, activated dough development
# reference product of the dataset
reference product: bread
# indicate whether the dataset exists in the original database
# or if it should be sourced from the inventories folder
exists in original database: False
regionalize: True
name: market for transport, passenger car with internal combustion engine
reference product: transport, passenger car with internal combustion engine

# OPTIONAL: if the dataset should not be duplicated for a specific list of regions
# in this case, the dataset will not be duplicated for the IAM region "BRA"
except regions:
- BRA
SDM:
BEV:
production volume:
variable: Production|Baking|Bread|Straight Dough Method
efficiency:
- variable: Efficiency|Baking|Bread|Straight Dough Method
variable: Share|BEV
ecoinvent alias:
name: bread production, straight dough method
reference product: bread
exists in original database: False
regionalize: True
except regions:
- USA
name: market for transport, passenger car, electric
reference product: transport, passenger car, electric

DSM:
EURO3:
production volume:
variable: Production|Baking|Bread|Delayed Salt Method
efficiency:
- variable: Efficiency|Baking|Bread|Delayed Salt Method
variable: Share|EURO-3
ecoinvent alias:
name: bread production, delayed salt method
reference product: bread
exists in original database: False
regionalize: True
except regions:
- WEU
- USA
# OPTIONAL: if the dataset should replace one or several specific providers in the database
# in this case, `bread production, delayed salt method` will replace
# `NMC111 hydroxide production, for Li-ion battery` wherever it is used
replaces:
- name: NMC111 hydroxide production, for Li-ion battery
product: NMC111 hydroxide
replaces in:
- name: market for NMC111 hydroxide
reference product: NMC111 hydroxide
# OPTIONAL: if the new dataset replaces another,
# but the substitution ratio is not 1:1
# it can be specified here
replacement ratio: 0.75
name: market for transport, passenger car, EURO 3
reference product: transport, passenger car, EURO 3

BC:
EURO4:
production volume:
variable: Production|Baking|Bread|Breadcrumbs
variable: Share|EURO-4
ecoinvent alias:
name: breadcrumbs production
reference product: breadcrumbs
exists in original database: True
regionalize: True
name: market for transport, passenger car, EURO 4
reference product: transport, passenger car, EURO 4

CP:
EURO5:
production volume:
variable: Production|Copper|Cake
variable: Share|EURO-5
ecoinvent alias:
name: cobalt production
reference product: copper cake
exists in original database: True
regionalize: True
name: market for transport, passenger car, EURO 5
reference product: transport, passenger car, EURO 5

ALM:
EURO6:
production volume:
variable: Production|Almond
variable: Share|EURO-6
ecoinvent alias:
name: almond production
reference product: almond
exists in original database: True
regionalize: True
name: transport, passenger car, large size, petrol, EURO 6
reference product: transport, passenger car, large size, petrol, EURO 6
exists in original database: False
efficiency:
- variable: Efficiency|EURO-6
includes:
technosphere:
- market for petrol, low-sulfur
biosphere:
- Carbon dioxide, fossil


BAN:
production volume:
variable: Production|Banana
ecoinvent alias:
name: banana production
reference product: banana
exists in original database: True
regionalize: True

# OPTIONAL: if a market needs to be created
markets:
# name of the market dataset
- name: market for bread
# reference product of the market dataset
reference product: bread
# unit of the market dataset
unit: kilogram
# names of datasets that should compose the market
- name: transport, passenger car with internal combustion engine (new)
reference product: transport, passenger car with internal combustion engine
unit: kilometer
includes:
- ADD
- SDM
- DSM
- EURO3
- EURO4
- EURO5
- EURO6

# OPTIONAL: if the new market is supposed to replace one or several other providers
# in the database.
# in this case, `market for bread` will replace providers of carbon back and clay bricks.
replaces:
- name: market for carbon
product: carbon
operator: contains
- name: market for clay brick
product: clay brick
# OPTIONAL: if the substitution ratio between `market for bread` and the providers to be replaced
# is not 1:1, then a replacement ratio can be specified
replacement ratio: 1.05
# OPTIONAL: if the new market should not be created for all IAM region, this can be specified here
except regions:
- JAP
- name: market for croissants
# reference product of the market dataset
reference product: croissants
# unit of the market dataset
unit: kilogram
# names of datasets that should compose the market
- name: transport, passenger car with internal combustion engine
product: transport, passenger car with internal combustion engine
operator: equals

- name: transport, passenger car (new)
reference product: transport, passenger car
unit: kilometer
includes:
- BC
- CP
- ALM
- BAN
- ICEV
- BEV

# OPTIONAL: if the new market is supposed to replace one or several other providers
# in the database.
# in this case, `market for croissants` will replace providers of carbon back and clay bricks.
# case-insensitive, must contain this string in `name`and `reference product`
replaces:
- name: market for tap water
product: tap water
- name: market for cement, Portland
product: cement, Portland
replaces in:
- name: concrete production
reference product: concrete
operator: contains
- name: electricity production
reference product: electricity
operator: contains

# OPTIONAL: if the substitution ratio between `market for bread` and the providers to be replaced
# is not 1:1, then a replacement ratio can be specified
replacement ratio: 1.15
# OPTIONAL: if the new market should not be created for all IAM region, this can be specified here
except regions:
- JAP
- name: transport, passenger car
product: transport, passenger car
37 changes: 6 additions & 31 deletions datapackage.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"profile": "data-package",
"name": "scenario-example-bread",
"title": "Scenario Example Bread",
"description": "A scenario example of prospective bread scenario to be used in premise",
"name": "exercise-car-europe",
"title": "Exercise: projection for passenger cars in Europe",
"description": "A scenario example of prospective analysis for passenger car fleets in Europe",
"version": "0.0.3",
"contributors":[{
"title": "Romain Sacchi",
"email": "[email protected]"
}],
"dependencies": {
"premise": ">=1.2.5"
"premise": ">=1.7.4"
},
"ecoinvent": {
"version": "3.8",
"version": "3.9",
"system model": "cut-off"
},
"scenarios": {
Expand Down Expand Up @@ -123,31 +123,6 @@
"name": "2050",
"type": "number",
"format": "default"
},
{
"name": "2060",
"type": "number",
"format": "default"
},
{
"name": "2070",
"type": "number",
"format": "default"
},
{
"name": "2080",
"type": "number",
"format": "default"
},
{
"name": "2090",
"type": "number",
"format": "default"
},
{
"name": "2100",
"type": "number",
"format": "default"
}
],
"missingValues": [
Expand All @@ -156,7 +131,7 @@
}
},
{
"path": "inventories/lci-bread.csv",
"path": "inventories/lci-car.csv",
"profile": "data-resource",
"name": "inventories",
"format": "csv",
Expand Down
2 changes: 0 additions & 2 deletions goodtables.yml

This file was deleted.

Loading

0 comments on commit d97906d

Please sign in to comment.