Skip to content

Commit

Permalink
Minor improvements to readthedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
muelleram committed May 3, 2024
1 parent b11716b commit dfec42a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions docs/content/theory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,27 @@ User input

.. dropdown:: ℹ️ More info on inputs

- The foreground system must have exchanges linked to one of the background databases. These exchanges at the intersection between foreground and background databases will be relinked by `timex_lca`.
- Temporal distributions can occur at technosphere and biosphere exchanges and can be given in various forms, see `bw_temporalis <https://github.com/brightway-lca/bw_temporalis/tree/main>`__, including absolute (e.g. 2024-03-18) or relative (e.g. 3 years before) nature and can have different temporal resolution (down to seconds but later aggregation supports resolutions down to hours).
- The foreground system must have exchanges linked to one of the background databases. These exchanges at the intersection between foreground and background databases will be relinked by ``timex_lca``.
- Temporal distributions can occur at technosphere and biosphere exchanges and can be given in various forms, see `bw_temporalis <https://github.com/brightway-lca/bw_temporalis/tree/main>`__, including absolute (e.g. 2024-03-18) or relative (e.g. 3 years before) types and can have different temporal resolution (down to seconds but later aggregation supports resolutions down to hours).
- Temporal distributions are optional. If none are provided, no delay between producing and consuming process is assumed and the timing of the consuming process is adopted also for the producing process.


Graph traversal
----------------
.. _`BW_temporalis`: https://github.com/brightway-lca/bw_temporalis/tree/main
``timex_lca`` uses the graph traversal from `BW_temporalis`_ to propagate the temporal information along the supply chain. The graph traversal is priority-first, following the most impactful node in the graph based on the static pre-calculated LCIA score for a chosen impact category.
``timex_lca`` uses the graph traversal from `bw_temporalis <https://github.com/brightway-lca/bw_temporalis/tree/main>`__ to propagate the temporal information along the supply chain. The graph traversal is priority-first, following the most impactful node in the graph based on the static pre-calculated LCIA score for a chosen impact category.
All input arguments for the graph traversal, such as maximum calculation count or cut-off, can be passed to the ``TimexLCA`` instance.

By default, only the foreground system is traversed, but nodes to be skipped during traversal can be specified by a ``edge_filter_function``.
At each process, the graph traversal uses convolution to combine the temporal distributions of the consumed exchange and the process into the resoluting combined temporal distribution of the upstream producer of the exchange.
At each process, the graph traversal uses convolution to combine the temporal distributions of the process and the exchange it consumes into the resoluting combined temporal distribution of the upstream producer of the exchange.

Process timeline
----------------
The graph traversal returns a timeline that lists the time of each technosphere exchange in the temporalized foreground system.
Exchanges that flow from same producer to the same consumer within a certain time-window (``temporal_grouping``) are grouped together.
This is done to avoid countless exchanges in the timeline, as the temporal distributions at exchange level can have arbitrary fine temporal resolutions while one may not have a similar temporal resolution at the database level.
We recommend aligning ``temporal_grouping``, which defaults to 'year', to align with the temporal resolution of the available databases.
Exchanges that flow from same producer to the same consumer within a certain time-window (``temporal_grouping``, default is 'year') are grouped together.
This is done to avoid countless exchanges in the timeline, as the temporal distributions at exchange level can have temporal resolutions down to seconds while one may not have a similar temporal resolution for the databases.
We recommend aligning ``temporal_grouping`` to the temporal resolution of the available databases.

For a simple example that consists of the following system: a process A that consumes an exchange b from a process B, which emits an emission x and both the exchange b and the emission x occur at a certain point in time
Let's consider the following system: a process A that consumes an exchange b from a process B, which emits an emission X and both the exchange b and the emission X occur at a certain point in time.


.. image:: data/example_ab_dark.svg
Expand Down Expand Up @@ -74,7 +73,7 @@ We recommend aligning ``temporal_grouping``, which defaults to 'year', to align
Time mapping
----------------
Based on the timing of the processes in the timeline, ``timex_lca`` matches the processes at the intersection between foreground and background to the best available background databases.
Available matching strategies are: closest database or linear interpolation between two closest databases based on temporal proximity. The new best-fitting background producer(s) are mapped on the same name, reference product, location as the old background producer.
Available matching strategies are closest database or linear interpolation between two closest databases based on temporal proximity. The new best-fitting background producer(s) are mapped on the same name, reference product and location as the old background producer.

Modified matrices
------------------
Expand All @@ -90,10 +89,11 @@ Technosphere matrix modifications:
Biosphere matrix modifications:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Depending on the user's choice, two different biosphere matrices are created:
1. If ``TimexLCA.lci()`` is executed, the 'static' biosphere matrix is expanded, by adding the original biosphere flows for the new temporalized process copies. With this, static LCI with inputs from the time-explicit databases can be calculated.
2. If ``TimexLCA.lci(build_dynamic_biosphere=True)`` is executed, a 'dynamic' biosphere matrix, which next to the links to LCI from the time-explicit databases also contains the timing of emissions, is created. This matrix ``TimexLCA.dynamic_inventory`` and the more readable dataframe ``TimexLCA.dynamic_inventory_df`` contain the emissions of the system per biosphere flow including its timestamp and its emitting process.

For the simple system above, a schematic representation of the matrix modifications look like this:
1. If ``TimexLCA.lci()`` is executed, the 'static' biosphere matrix is expanded, by adding the original biosphere flows for the new temporalized process copies. With this, static LCI with inputs from the time-explicit databases are calculated and stored in ``TimexLCA.lca.inventory``.
2. If ``TimexLCA.lci(build_dynamic_biosphere=True)`` is executed, a 'dynamic' biosphere matrix is created, which next to the links to LCI from the time-explicit databases also contains the timing of emissions. ``build_dynamic_biosphere=True`` is the default, so it has to be set to ``False`` to skip this step. The matrix ``TimexLCA.dynamic_inventory`` and the more readable dataframe ``TimexLCA.dynamic_inventory_df`` contain the emissions of the system per biosphere flow including its timestamp and its emitting process.

For the simple system above, a schematic representation of the matrix modifications looks like this:

.. image:: data/matrix_dark.svg
:class: only-dark
Expand All @@ -105,8 +105,8 @@ Static or dynamic impact assessment
-----------------------------------
``timex_lca`` allows to use conventional static impact assessment methods, which are executed using ``TimexLCA.lcia()``.

To take advantage of the detailed temporal information at the inventory level, dynamic LCIA can be applied, uisng ``TimexLCA.dynamic_lcia()``. Users can define / import their own dynamic LCIA functions.
Out of the box, we provide dynamic LCIA functions for the climate change metrics 'radiative forcing' and 'global warming potential (GWP)' for all greenhouse gases in the IPCC AR6 report.
To take advantage of the detailed temporal information at the inventory level, dynamic LCIA can be applied, using ``TimexLCA.dynamic_lcia()``. Users can define or import their own dynamic LCIA functions.
Out of the box, we provide dynamic LCIA functions for the climate change metrics 'radiative forcing' and 'global warming potential (GWP)' for all greenhouse gases in the `IPCC AR6 report Chapter 7 Table 7.SM.7 <https://www.ipcc.ch/report/ar6/wg1/chapter/chapter-7/>`_.

The time horizon ``time_horizon``, over which both metrics are evaluated, defaults to 100 years, but can be set flexibly in years.
Additionally, both metrics can be applied with a fixed or flexible time horizon. Fixed time horizon means that the all emissions are evaluated starting from the timing of the functional unit until the end of the time horizon, meaning that later emissions are counted for shorter,
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This package enables you to account for:
- **Variable** and/or **evolving** supply chains & technologies (e.g., increasing shares of renewable electricity in the future)
- **Timing of emissions** (by applying dynamic characterization functions)

You can define temporal distributions for process and emission exchanges, which are then *automatically* propagated through the supply chain and mapped to corresponding time-explicit databases. The resulting time-explicit LCI reflects the current technology status within the production system at the actual time of each process. Also, `timex_lca` keeps track of the timing of emissions which means that you can apply dynamic characterization functions.
You can define temporal distributions for process and emission exchanges, which are then *automatically* propagated through the supply chain and mapped to corresponding time-explicit databases. The resulting time-explicit LCI reflects the current technology status within the production system at the actual time of each process. Also, `timex_lca` keeps track of the timing of emissions, which means that you can apply dynamic characterization functions.

## Use cases:
`timex_lca` is ideal for cases with:
Expand Down

0 comments on commit dfec42a

Please sign in to comment.