Skip to content

Commit

Permalink
Align wrt master.
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Feb 9, 2024
1 parent 0f12cb0 commit a5c68d5
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 26 deletions.
16 changes: 8 additions & 8 deletions docs/extract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Concentration Pathway (RCP)—and a year (e.g., SSP1, Base, 2035).

A summary report of the main variables of the scenarios
selected is generated automatically after each database export.
There is also an `online dashboard <https://premisedash-6f5a0259c487.herokuapp.com/>`_.
You can also generate it manually:

.. python::
Expand Down Expand Up @@ -141,8 +142,9 @@ If you wish to clear that cache folder, do:
From ecospold2 files
--------------------
To extract from a set of ecospold2 files, you need to point to the location of those files
in `source_file_path`, as well as indicate the database format in `source_type`:
To extract from a set of ecospold2 files, you need to point to the location of
those files in `source_file_path`, as well as indicate the database format in
`source_type`:
.. code-block:: python
Expand Down Expand Up @@ -600,7 +602,6 @@ They are necessary to model the distribution of hydrogen:
* via truck, in a liquid state
* hydrogen refuelling station
Small and large storage solutions are also provided:
* high pressure hydrogen storage tank
* geological storage tank
Expand Down Expand Up @@ -642,19 +643,18 @@ Hydrogen turbine
A dataset for a hydrogen turbine is also imported, to model the production of electricity
from hydrogen, with an efficiency of 51%. The efficiency of the H2-fed gas turbine is based
on the parameters of Ozawa_ et al. (2019), consulted here: LCI_H2_turbine_.
on the parameters of Ozawa_ et al. (2019), accessible here: LCI_H2_turbine_.
.. _Ozawa: https://doi.org/10.1016/j.ijhydene.2019.02.230
.. _LCI_H2_turbine: https://github.com/polca/premise/blob/master/premise/data/additional_inventories/lci-hydrogen-turbine.xlsx
Biofuels
--------
Inventories for energy crops- and residues-based production of bioethanol and biodiesel
are imported, and can be consulted here: LCI_biofuels_. They include the farming of the crop,
the conversion of hte biomass to fuel, as well as its distribution. The conversion process
are imported, and can be accessed here: LCI_biofuels_. They include the farming of the crop,
the conversion of the biomass to fuel, as well as its distribution. The conversion process
often leads to the production of co-products (dried distiller's grain, electricity, CO2, bagasse.).
Hence, energy, economic and system expansion partitioning approaches are available.
These inventories originate from several different sources
Expand Down Expand Up @@ -854,7 +854,7 @@ pump heat and excess heat), which are found under the following names, for each
carbon dioxide, captured from atmosphere, with a sorbent-based direct air capture system, 100ktCO2, with heat pump heat, and grid electricity all IAM regions
======================================================================================================================================================= ==================
Note that only solid sorbent DAC can use waste heat, as teh heat requirement for liquid solvent DAC
Note that only solid sorbent DAC can use waste heat, as the heat requirement for liquid solvent DAC
is too high (~900 C)
Li-ion batteries
Expand Down
7 changes: 4 additions & 3 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Workflow
As illustrated in the workflow diagram above, *premise* follows an Extract, Transform, Load (ETL_) process:

Extract the ecoinvent database from a Brightway_ project or from ecospold2_ files.
Expand the database by adding additional inventories related to future production pathways for certain commodities, such as electricity, steel, cement, etc.
Expand the database by adding additional inventories for future production pathways for certain commodities, such as electricity, steel, cement, etc.
Modify the ecoinvent database, focusing primarily on process efficiency improvements and market adjustments.
Load the updated database back into a Brightway project or export it as a set of CSV files, such as Simapro CSV files.

Expand Down Expand Up @@ -79,8 +79,9 @@ Additionally, we provided a summary of the main characteristics of each scenario

.. _CarbonBrief: https://www.carbonbrief.org/explainer-how-shared-socioeconomic-pathways-explore-future-climate-change

You can however use any other scenario files generated by REMIND or IMAGE. If you wish to use an IAM file
which has not been generated by either of these two models, you should refer to the **Mapping** section.
You can however use any other scenario files generated by REMIND or IMAGE.
If you wish to use an IAM file which has not been generated by either of these
two models, you should refer to the **Mapping** section.

.. _maintainers: mailto:[email protected]

Expand Down
9 changes: 7 additions & 2 deletions docs/transform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ Efficiency adjustment
The energy conversion efficiency of power plant datasets for specific technologies is adjusted
to align with the efficiency changes indicated by the IAM scenario.
Two approaches are posisble:
* application of a scaling factor to the inputs of the dataset relative to the current efficiency
* application of a scaling factor to the inputs of the dataset to match the absolute efficiency given by the IAM scenario
The first approach (default) preserves
Combustion-based powerplants
----------------------------
Expand Down Expand Up @@ -791,7 +796,7 @@ Typical fuel inputs for these process are natural gas, coal, coal-based coke.
Emissions of (fossil) CO2 are scaled accordingly.
Regarding the production of secondary steel (using EAF),
*premise* adjusts the input of electricity based on teh scaling factor
*premise* adjusts the input of electricity based on the scaling factor
provided by the IAM scenario.
Expand Down Expand Up @@ -823,7 +828,7 @@ from the steel sector in a given region and year is sequestered and stored,
The datatset used to that effect is from Meunier_ et al., 2020.
The dataset described the capture of CO2 from a cement plant, not a steel mill,
but it is assumed to be an acceptable approximation since the CO2 concentration
in teh flue gases should not be significantly different.
in the flue gases should not be significantly different.
To that dataset, *premise* adds another dataset that models the storage
of the CO2 underground, from Volkart_ et al, 2013.
Expand Down
2 changes: 1 addition & 1 deletion premise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__all__ = ("NewDatabase", "clear_cache", "get_regions_definition")
__version__ = (2, 0, 0, "dev0")
__version__ = (2, 0, 0, "dev1")


from .new_database import NewDatabase
Expand Down
12 changes: 6 additions & 6 deletions premise/electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from .utils import get_efficiency_solar_photovoltaics, rescale_exchanges
from .validation import ElectricityValidation

LOSS_PER_COUNTRY = DATA_DIR / "electricity" / "losses_per_country.csv"
POWERPLANT_TECHS = VARIABLES_DIR / "electricity_variables.yaml"

logger = create_logger("electricity")
Expand Down Expand Up @@ -141,7 +140,7 @@ def get_production_weighted_losses(
)

transf_loss += (
dict_loss["Transformation loss high voltage"]
dict_loss.get("Transformation loss high voltage", 0)
* dict_loss["Production volume"]
)

Expand Down Expand Up @@ -169,12 +168,13 @@ def get_production_weighted_losses(
"Production volume": 0,
},
)

transf_loss += (
dict_loss["Transformation loss medium voltage"]
dict_loss.get("Transformation loss medium voltage", 0)
* dict_loss["Production volume"]
)
distr_loss += (
dict_loss["Transmission loss to medium voltage"]
dict_loss.get("Transmission loss to medium voltage", 0)
* dict_loss["Production volume"]
)
cumul_prod += dict_loss["Production volume"]
Expand All @@ -195,11 +195,11 @@ def get_production_weighted_losses(
},
)
transf_loss += (
dict_loss["Transformation loss low voltage"]
dict_loss.get("Transformation loss low voltage", 0)
* dict_loss["Production volume"]
)
distr_loss += (
dict_loss["Transmission loss to low voltage"]
dict_loss.get("Transmission loss to low voltage", 0)
* dict_loss["Production volume"]
)
cumul_prod += dict_loss["Production volume"]
Expand Down
5 changes: 3 additions & 2 deletions premise/marginal_mixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ def fetch_volume_change(data: xr.DataArray, start_year: int, end_year: int) -> n
"""
Calculate the volume change of a market.
"""

return (
(
data.sel(year=end_year).sum(dim="variables")
- data.sel(year=start_year).sum(dim="variables")
data.interp(year=end_year).sum(dim="variables")
- data.interp(year=start_year).sum(dim="variables")
)
/ (end_year - start_year)
).values
Expand Down
3 changes: 0 additions & 3 deletions premise/new_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
import multiprocessing
import os
import pickle
import sys
from datetime import date
from functools import partial
from multiprocessing import Pool as ProcessPool
from multiprocessing import cpu_count
from multiprocessing.pool import ThreadPool as Pool
from pathlib import Path
from typing import List, Union
Expand Down
1 change: 0 additions & 1 deletion tests/test_electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from premise.electricity import Electricity
from premise.filesystem_constants import DATA_DIR

LOSS_PER_COUNTRY = DATA_DIR / "electricity" / "losses_per_country.csv"
LHV_FUELS = DATA_DIR / "fuels_lower_heating_value.txt"


Expand Down

0 comments on commit a5c68d5

Please sign in to comment.