dynamic-characterization 1.4.2__tar.gz → 1.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/LICENSE +2 -0
- dynamic_characterization-1.4.3/PKG-INFO +121 -0
- dynamic_characterization-1.4.3/README.md +79 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/__init__.py +1 -1
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/dynamic_characterization.py +2 -1
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/__init__.py +4 -2
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/agtp.py +3 -3
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/agwp.py +6 -5
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/radiative_forcing.py +13 -6
- dynamic_characterization-1.4.3/dynamic_characterization.egg-info/PKG-INFO +121 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/pyproject.toml +1 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/tests/test_prospective.py +48 -0
- dynamic_characterization-1.4.2/PKG-INFO +0 -284
- dynamic_characterization-1.4.2/README.md +0 -243
- dynamic_characterization-1.4.2/dynamic_characterization.egg-info/PKG-INFO +0 -284
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/MANIFEST.in +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/classes.py +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/ipcc_ar6/__init__.py +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/ipcc_ar6/data/decay_multipliers.json +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/ipcc_ar6/data/hodnebrog20.csv +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/ipcc_ar6/radiative_forcing.py +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/original_temporalis_functions/__init__.py +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/original_temporalis_functions/radiative_forcing.py +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/config.py +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_001.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_002.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_003.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_004.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_009.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_010.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_011.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_012.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_013.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_014.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_015.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_016.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_017.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_018.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_019.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_020.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_021.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_022.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_023.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_024.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_025.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data/es5c12391_si_026.xlsx +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization/prospective/data_loader.py +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization.egg-info/SOURCES.txt +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization.egg-info/dependency_links.txt +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization.egg-info/requires.txt +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/dynamic_characterization.egg-info/top_level.txt +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/setup.cfg +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/tests/test_characterize_dynamic_inventory.py +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/tests/test_characterize_prospective_fallback.py +0 -0
- {dynamic_characterization-1.4.2 → dynamic_characterization-1.4.3}/tests/test_default_characterization_functions.py +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dynamic_characterization
|
|
3
|
+
Version: 1.4.3
|
|
4
|
+
Summary: Collection of functions for characterizing life cycle inventories with temporal information
|
|
5
|
+
Author-email: Timo Diepers <timo.diepers@ltt.rwth-aachen.de>
|
|
6
|
+
Maintainer-email: Timo Diepers <timo.diepers@ltt.rwth-aachen.de>
|
|
7
|
+
Project-URL: source, https://github.com/brightway-lca/dynamic_characterization
|
|
8
|
+
Project-URL: homepage, https://github.com/brightway-lca/dynamic_characterization
|
|
9
|
+
Project-URL: tracker, https://github.com/brightway-lca/dynamic_characterization/issues
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
17
|
+
Classifier: Natural Language :: English
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: pandas
|
|
24
|
+
Requires-Dist: numpy
|
|
25
|
+
Requires-Dist: bw2data
|
|
26
|
+
Requires-Dist: loguru
|
|
27
|
+
Requires-Dist: matplotlib>=3.9.4
|
|
28
|
+
Requires-Dist: openpyxl>=3.1.5
|
|
29
|
+
Provides-Extra: testing
|
|
30
|
+
Requires-Dist: pytest; extra == "testing"
|
|
31
|
+
Requires-Dist: pytest-cov; extra == "testing"
|
|
32
|
+
Requires-Dist: python-coveralls; extra == "testing"
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: build; extra == "dev"
|
|
35
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
36
|
+
Requires-Dist: pylint; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest-randomly; extra == "dev"
|
|
40
|
+
Requires-Dist: setuptools; extra == "dev"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
# dynamic_characterization
|
|
44
|
+
|
|
45
|
+
[](https://dynamic-characterization.readthedocs.io/en/latest/)
|
|
46
|
+
[](https://pypi.org/project/dynamic-characterization/)
|
|
47
|
+
[](https://anaconda.org/diepers/dynamic_characterization)
|
|
48
|
+

|
|
49
|
+
[](https://mybinder.org/v2/gh/brightway-lca/dynamic_characterization/main?labpath=notebooks%2Fdynamic_characterization_demo.ipynb)
|
|
50
|
+
|
|
51
|
+
This is a package for the dynamic characterization of Life Cycle Inventories with temporal information. It includes a collection of dynamic characterization functions for various environmental flows. We also provide a simple interface to apply these functions to an existing dynamic LCI (coming from, e.g., [bw_temporalis](https://github.com/brightway-lca/bw_temporalis), [bw_timex](https://github.com/brightway-lca/bw_timex) or [optimex](https://github.com/RWTH-LTT/optimex).
|
|
52
|
+
|
|
53
|
+
The following dynamic characterization functions are currently included:
|
|
54
|
+
|
|
55
|
+
| module | impact category | metric | covered emissions | source |
|
|
56
|
+
|--------|-----------------|--------|-------------------|--------|
|
|
57
|
+
| `ipcc_ar6` | climate change | radiative forcing, GWP | 247 GHGs | radiative efficiencies & lifetimes from [IPCC AR6 Ch.7](https://www.ipcc.ch/report/ar6/wg1/chapter/chapter-7/) |
|
|
58
|
+
| `prospective` | climate change | prospective radiative forcing, pGWP, pGTP | CO2, CH4, N2O | [Watanabe et al. (2026)](https://pubs.acs.org/doi/10.1021/acs.est.5c12391) |
|
|
59
|
+
| `original_temporalis_functions` | climate change | radiative forcing | CO2, CH4 | [bw_temporalis](https://github.com/brightway-lca/bw_temporalis/tree/main) |
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```console
|
|
64
|
+
$ pip install dynamic-characterization
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The same thing with [uv](https://docs.astral.sh/uv/) is `uv add dynamic-characterization`, and with conda `conda install -c conda-forge -c diepers dynamic_characterization`. See the [installation guide](https://dynamic-characterization.readthedocs.io/en/latest/content/installation/) for the details.
|
|
68
|
+
|
|
69
|
+
## Quick start
|
|
70
|
+
|
|
71
|
+
You bring a dynamic inventory - a DataFrame of `date`, `amount`, `flow`, `activity`, one row per emission at one point in time - and say which metric you want:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from dynamic_characterization import characterize
|
|
75
|
+
from dynamic_characterization.ipcc_ar6 import characterize_co2, characterize_ch4
|
|
76
|
+
|
|
77
|
+
df_characterized = characterize(
|
|
78
|
+
dynamic_inventory_df,
|
|
79
|
+
metric="radiative_forcing", # or GWP, pGWP, pGTP, prospective_radiative_forcing
|
|
80
|
+
characterization_functions={1: characterize_co2, 3: characterize_ch4},
|
|
81
|
+
time_horizon=100,
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Each function turns one row of the inventory into the characterized time series it causes, so the result carries a value per point in time rather than a single score.
|
|
86
|
+
|
|
87
|
+
If you work with [Brightway](https://docs.brightway.dev/en/latest/), pass an impact assessment method as `base_lcia_method` instead of the function dictionary, and the flows it characterizes are matched to our functions automatically, by name or CAS number.
|
|
88
|
+
|
|
89
|
+
## Documentation
|
|
90
|
+
|
|
91
|
+
The full documentation is at [dynamic-characterization.readthedocs.io](https://dynamic-characterization.readthedocs.io/en/latest/):
|
|
92
|
+
|
|
93
|
+
- [Usage](https://dynamic-characterization.readthedocs.io/en/latest/content/usage/) - the workflow in full, and every metric you can ask for
|
|
94
|
+
- [Prospective characterization](https://dynamic-characterization.readthedocs.io/en/latest/content/prospective/) - scenario-based characterization factors: choosing an IAM-SSP-RCP scenario, the IPCC fallback for unsupported GHGs, and scenario-dependent radiative efficiency and CO2 impulse response
|
|
95
|
+
- [Examples](https://dynamic-characterization.readthedocs.io/en/latest/content/examples/) - the demo notebooks, rendered
|
|
96
|
+
- [API reference](https://dynamic-characterization.readthedocs.io/en/latest/api/) - including how to write your own characterization function
|
|
97
|
+
|
|
98
|
+
## Contributing
|
|
99
|
+
|
|
100
|
+
Contributions are very welcome.
|
|
101
|
+
To learn more, see the [Contributor Guide][Contributor Guide].
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
Distributed under the terms of the [BSD 3-Clause license][License],
|
|
106
|
+
_dynamic_characterization_ is free and open source software.
|
|
107
|
+
|
|
108
|
+
## Issues
|
|
109
|
+
|
|
110
|
+
If you encounter any problems,
|
|
111
|
+
please [file an issue][Issue Tracker] along with a detailed description.
|
|
112
|
+
|
|
113
|
+
## Support
|
|
114
|
+
|
|
115
|
+
If you have any questions or need help, do not hesitate to contact Timo Diepers ([timo.diepers@ltt.rwth-aachen.de](mailto:timo.diepers@ltt.rwth-aachen.de))
|
|
116
|
+
|
|
117
|
+
<!-- github-only -->
|
|
118
|
+
|
|
119
|
+
[License]: https://github.com/brightway-lca/dynamic_characterization/blob/main/LICENSE
|
|
120
|
+
[Contributor Guide]: https://github.com/brightway-lca/dynamic_characterization/blob/main/CONTRIBUTING.md
|
|
121
|
+
[Issue Tracker]: https://github.com/brightway-lca/dynamic_characterization/issues
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# dynamic_characterization
|
|
2
|
+
|
|
3
|
+
[](https://dynamic-characterization.readthedocs.io/en/latest/)
|
|
4
|
+
[](https://pypi.org/project/dynamic-characterization/)
|
|
5
|
+
[](https://anaconda.org/diepers/dynamic_characterization)
|
|
6
|
+

|
|
7
|
+
[](https://mybinder.org/v2/gh/brightway-lca/dynamic_characterization/main?labpath=notebooks%2Fdynamic_characterization_demo.ipynb)
|
|
8
|
+
|
|
9
|
+
This is a package for the dynamic characterization of Life Cycle Inventories with temporal information. It includes a collection of dynamic characterization functions for various environmental flows. We also provide a simple interface to apply these functions to an existing dynamic LCI (coming from, e.g., [bw_temporalis](https://github.com/brightway-lca/bw_temporalis), [bw_timex](https://github.com/brightway-lca/bw_timex) or [optimex](https://github.com/RWTH-LTT/optimex).
|
|
10
|
+
|
|
11
|
+
The following dynamic characterization functions are currently included:
|
|
12
|
+
|
|
13
|
+
| module | impact category | metric | covered emissions | source |
|
|
14
|
+
|--------|-----------------|--------|-------------------|--------|
|
|
15
|
+
| `ipcc_ar6` | climate change | radiative forcing, GWP | 247 GHGs | radiative efficiencies & lifetimes from [IPCC AR6 Ch.7](https://www.ipcc.ch/report/ar6/wg1/chapter/chapter-7/) |
|
|
16
|
+
| `prospective` | climate change | prospective radiative forcing, pGWP, pGTP | CO2, CH4, N2O | [Watanabe et al. (2026)](https://pubs.acs.org/doi/10.1021/acs.est.5c12391) |
|
|
17
|
+
| `original_temporalis_functions` | climate change | radiative forcing | CO2, CH4 | [bw_temporalis](https://github.com/brightway-lca/bw_temporalis/tree/main) |
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```console
|
|
22
|
+
$ pip install dynamic-characterization
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The same thing with [uv](https://docs.astral.sh/uv/) is `uv add dynamic-characterization`, and with conda `conda install -c conda-forge -c diepers dynamic_characterization`. See the [installation guide](https://dynamic-characterization.readthedocs.io/en/latest/content/installation/) for the details.
|
|
26
|
+
|
|
27
|
+
## Quick start
|
|
28
|
+
|
|
29
|
+
You bring a dynamic inventory - a DataFrame of `date`, `amount`, `flow`, `activity`, one row per emission at one point in time - and say which metric you want:
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from dynamic_characterization import characterize
|
|
33
|
+
from dynamic_characterization.ipcc_ar6 import characterize_co2, characterize_ch4
|
|
34
|
+
|
|
35
|
+
df_characterized = characterize(
|
|
36
|
+
dynamic_inventory_df,
|
|
37
|
+
metric="radiative_forcing", # or GWP, pGWP, pGTP, prospective_radiative_forcing
|
|
38
|
+
characterization_functions={1: characterize_co2, 3: characterize_ch4},
|
|
39
|
+
time_horizon=100,
|
|
40
|
+
)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Each function turns one row of the inventory into the characterized time series it causes, so the result carries a value per point in time rather than a single score.
|
|
44
|
+
|
|
45
|
+
If you work with [Brightway](https://docs.brightway.dev/en/latest/), pass an impact assessment method as `base_lcia_method` instead of the function dictionary, and the flows it characterizes are matched to our functions automatically, by name or CAS number.
|
|
46
|
+
|
|
47
|
+
## Documentation
|
|
48
|
+
|
|
49
|
+
The full documentation is at [dynamic-characterization.readthedocs.io](https://dynamic-characterization.readthedocs.io/en/latest/):
|
|
50
|
+
|
|
51
|
+
- [Usage](https://dynamic-characterization.readthedocs.io/en/latest/content/usage/) - the workflow in full, and every metric you can ask for
|
|
52
|
+
- [Prospective characterization](https://dynamic-characterization.readthedocs.io/en/latest/content/prospective/) - scenario-based characterization factors: choosing an IAM-SSP-RCP scenario, the IPCC fallback for unsupported GHGs, and scenario-dependent radiative efficiency and CO2 impulse response
|
|
53
|
+
- [Examples](https://dynamic-characterization.readthedocs.io/en/latest/content/examples/) - the demo notebooks, rendered
|
|
54
|
+
- [API reference](https://dynamic-characterization.readthedocs.io/en/latest/api/) - including how to write your own characterization function
|
|
55
|
+
|
|
56
|
+
## Contributing
|
|
57
|
+
|
|
58
|
+
Contributions are very welcome.
|
|
59
|
+
To learn more, see the [Contributor Guide][Contributor Guide].
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
Distributed under the terms of the [BSD 3-Clause license][License],
|
|
64
|
+
_dynamic_characterization_ is free and open source software.
|
|
65
|
+
|
|
66
|
+
## Issues
|
|
67
|
+
|
|
68
|
+
If you encounter any problems,
|
|
69
|
+
please [file an issue][Issue Tracker] along with a detailed description.
|
|
70
|
+
|
|
71
|
+
## Support
|
|
72
|
+
|
|
73
|
+
If you have any questions or need help, do not hesitate to contact Timo Diepers ([timo.diepers@ltt.rwth-aachen.de](mailto:timo.diepers@ltt.rwth-aachen.de))
|
|
74
|
+
|
|
75
|
+
<!-- github-only -->
|
|
76
|
+
|
|
77
|
+
[License]: https://github.com/brightway-lca/dynamic_characterization/blob/main/LICENSE
|
|
78
|
+
[Contributor Guide]: https://github.com/brightway-lca/dynamic_characterization/blob/main/CONTRIBUTING.md
|
|
79
|
+
[Issue Tracker]: https://github.com/brightway-lca/dynamic_characterization/issues
|
|
@@ -735,7 +735,8 @@ def _characterize_prospective_radiative_forcing(
|
|
|
735
735
|
"""
|
|
736
736
|
Calculate prospective radiative forcing using Watanabe et al. (2026) characterization.
|
|
737
737
|
|
|
738
|
-
For GHGs available in Watanabe (CO2, CH4, N2O), uses scenario-based radiative
|
|
738
|
+
For GHGs available in Watanabe (CO2, CH4, N2O), uses scenario-based radiative
|
|
739
|
+
efficiencies; for CO2 the impulse response function is scenario-based as well.
|
|
739
740
|
For other GHGs (when fallback_to_ipcc=True), uses standard IPCC AR6 functions.
|
|
740
741
|
"""
|
|
741
742
|
return _apply_characterization_function(
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Prospective characterization factors based on Watanabe et al. (2026).
|
|
3
3
|
|
|
4
|
-
Implements scenario-based characterization using
|
|
5
|
-
efficiencies
|
|
4
|
+
Implements scenario-based characterization using IAM-SSP-RCP scenarios. Both the
|
|
5
|
+
radiative efficiencies and, for CO2, the impulse response function depend on the
|
|
6
|
+
scenario: RE changes with the projected background concentrations, and the CO2 IRF
|
|
7
|
+
changes with the carbon cycle feedbacks of the RCP. CH4 and N2O keep fixed lifetimes.
|
|
6
8
|
|
|
7
9
|
Reference: https://doi.org/10.1021/acs.est.5b01118
|
|
8
10
|
"""
|
|
@@ -93,7 +93,7 @@ def agtp_co2(
|
|
|
93
93
|
Parameters
|
|
94
94
|
----------
|
|
95
95
|
emission_year : int
|
|
96
|
-
Year of emission (
|
|
96
|
+
Year of emission (2020-2150, clamped if outside)
|
|
97
97
|
time_horizon : int
|
|
98
98
|
Integration period in years
|
|
99
99
|
time_varying_re : bool
|
|
@@ -151,7 +151,7 @@ def agtp_ch4(
|
|
|
151
151
|
Parameters
|
|
152
152
|
----------
|
|
153
153
|
emission_year : int
|
|
154
|
-
Year of emission (
|
|
154
|
+
Year of emission (2020-2150, clamped if outside)
|
|
155
155
|
time_horizon : int
|
|
156
156
|
Integration period in years
|
|
157
157
|
time_varying_re : bool
|
|
@@ -206,7 +206,7 @@ def agtp_n2o(
|
|
|
206
206
|
Parameters
|
|
207
207
|
----------
|
|
208
208
|
emission_year : int
|
|
209
|
-
Year of emission (
|
|
209
|
+
Year of emission (2020-2150, clamped if outside)
|
|
210
210
|
time_horizon : int
|
|
211
211
|
Integration period in years
|
|
212
212
|
time_varying_re : bool
|
|
@@ -51,9 +51,10 @@ def _get_year_index(emission_year: int, years: np.ndarray) -> int:
|
|
|
51
51
|
"""
|
|
52
52
|
Get index for emission year in RE data, with clamping and warnings.
|
|
53
53
|
|
|
54
|
-
RE data
|
|
54
|
+
The bounds are taken from the RE data itself (currently 2020-2150), so they
|
|
55
|
+
follow the data instead of the narrower range reported in the paper tables.
|
|
55
56
|
"""
|
|
56
|
-
min_year, max_year =
|
|
57
|
+
min_year, max_year = int(years[0]), int(years[-1])
|
|
57
58
|
|
|
58
59
|
if emission_year < min_year:
|
|
59
60
|
warnings.warn(
|
|
@@ -87,7 +88,7 @@ def agwp_co2(
|
|
|
87
88
|
Parameters
|
|
88
89
|
----------
|
|
89
90
|
emission_year : int
|
|
90
|
-
Year of emission (
|
|
91
|
+
Year of emission (2020-2150, clamped if outside)
|
|
91
92
|
time_horizon : int
|
|
92
93
|
Integration period in years
|
|
93
94
|
time_varying_re : bool
|
|
@@ -144,7 +145,7 @@ def agwp_ch4(
|
|
|
144
145
|
Parameters
|
|
145
146
|
----------
|
|
146
147
|
emission_year : int
|
|
147
|
-
Year of emission (
|
|
148
|
+
Year of emission (2020-2150, clamped if outside)
|
|
148
149
|
time_horizon : int
|
|
149
150
|
Integration period in years
|
|
150
151
|
time_varying_re : bool
|
|
@@ -195,7 +196,7 @@ def agwp_n2o(
|
|
|
195
196
|
Parameters
|
|
196
197
|
----------
|
|
197
198
|
emission_year : int
|
|
198
|
-
Year of emission (
|
|
199
|
+
Year of emission (2020-2150, clamped if outside)
|
|
199
200
|
time_horizon : int
|
|
200
201
|
Integration period in years
|
|
201
202
|
time_varying_re : bool
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Watanabe prospective characterization functions.
|
|
3
3
|
|
|
4
4
|
Returns radiative forcing time series matching the existing ipcc_ar6 API,
|
|
5
|
-
but using scenario-based radiative efficiencies
|
|
5
|
+
but using scenario-based radiative efficiencies and, for CO2, a scenario-based
|
|
6
|
+
impulse response function from Watanabe et al. (2026).
|
|
6
7
|
|
|
7
8
|
Reference: https://doi.org/10.1021/acs.est.5b01118
|
|
8
9
|
"""
|
|
@@ -47,9 +48,10 @@ def _get_year_index(emission_year: int, years: np.ndarray) -> int:
|
|
|
47
48
|
"""
|
|
48
49
|
Get index for emission year in RE data, with clamping and warnings.
|
|
49
50
|
|
|
50
|
-
RE data
|
|
51
|
+
The bounds are taken from the RE data itself (currently 2020-2150), so they
|
|
52
|
+
follow the data instead of the narrower range reported in the paper tables.
|
|
51
53
|
"""
|
|
52
|
-
min_year, max_year =
|
|
54
|
+
min_year, max_year = int(years[0]), int(years[-1])
|
|
53
55
|
|
|
54
56
|
if emission_year < min_year:
|
|
55
57
|
warnings.warn(
|
|
@@ -81,7 +83,8 @@ def characterize_co2(
|
|
|
81
83
|
"""
|
|
82
84
|
Calculate radiative forcing time series for 1 kg CO2 emission.
|
|
83
85
|
|
|
84
|
-
Uses scenario-based radiative efficiencies
|
|
86
|
+
Uses scenario-based radiative efficiencies and a scenario-based (RCP-specific)
|
|
87
|
+
CO2 impulse response function from Watanabe et al. (2026).
|
|
85
88
|
Scenario must be set via prospective.set_scenario() before calling.
|
|
86
89
|
|
|
87
90
|
Parameters
|
|
@@ -193,7 +196,9 @@ def characterize_ch4(
|
|
|
193
196
|
"""
|
|
194
197
|
Calculate radiative forcing time series for 1 kg CH4 emission.
|
|
195
198
|
|
|
196
|
-
Uses scenario-based radiative efficiencies from Watanabe et al. (2026).
|
|
199
|
+
Uses scenario-based radiative efficiencies from Watanabe et al. (2026). The
|
|
200
|
+
impulse response function uses a fixed atmospheric lifetime; only CO2 has a
|
|
201
|
+
scenario-dependent IRF.
|
|
197
202
|
Scenario must be set via prospective.set_scenario() before calling.
|
|
198
203
|
|
|
199
204
|
This includes only direct effects. For indirect effects (ozone, water vapor),
|
|
@@ -282,7 +287,9 @@ def characterize_n2o(
|
|
|
282
287
|
"""
|
|
283
288
|
Calculate radiative forcing time series for 1 kg N2O emission.
|
|
284
289
|
|
|
285
|
-
Uses scenario-based radiative efficiencies from Watanabe et al. (2026).
|
|
290
|
+
Uses scenario-based radiative efficiencies from Watanabe et al. (2026). The
|
|
291
|
+
impulse response function uses a fixed atmospheric lifetime; only CO2 has a
|
|
292
|
+
scenario-dependent IRF.
|
|
286
293
|
Scenario must be set via prospective.set_scenario() before calling.
|
|
287
294
|
|
|
288
295
|
Parameters
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dynamic_characterization
|
|
3
|
+
Version: 1.4.3
|
|
4
|
+
Summary: Collection of functions for characterizing life cycle inventories with temporal information
|
|
5
|
+
Author-email: Timo Diepers <timo.diepers@ltt.rwth-aachen.de>
|
|
6
|
+
Maintainer-email: Timo Diepers <timo.diepers@ltt.rwth-aachen.de>
|
|
7
|
+
Project-URL: source, https://github.com/brightway-lca/dynamic_characterization
|
|
8
|
+
Project-URL: homepage, https://github.com/brightway-lca/dynamic_characterization
|
|
9
|
+
Project-URL: tracker, https://github.com/brightway-lca/dynamic_characterization/issues
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
17
|
+
Classifier: Natural Language :: English
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: pandas
|
|
24
|
+
Requires-Dist: numpy
|
|
25
|
+
Requires-Dist: bw2data
|
|
26
|
+
Requires-Dist: loguru
|
|
27
|
+
Requires-Dist: matplotlib>=3.9.4
|
|
28
|
+
Requires-Dist: openpyxl>=3.1.5
|
|
29
|
+
Provides-Extra: testing
|
|
30
|
+
Requires-Dist: pytest; extra == "testing"
|
|
31
|
+
Requires-Dist: pytest-cov; extra == "testing"
|
|
32
|
+
Requires-Dist: python-coveralls; extra == "testing"
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: build; extra == "dev"
|
|
35
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
36
|
+
Requires-Dist: pylint; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest-randomly; extra == "dev"
|
|
40
|
+
Requires-Dist: setuptools; extra == "dev"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
# dynamic_characterization
|
|
44
|
+
|
|
45
|
+
[](https://dynamic-characterization.readthedocs.io/en/latest/)
|
|
46
|
+
[](https://pypi.org/project/dynamic-characterization/)
|
|
47
|
+
[](https://anaconda.org/diepers/dynamic_characterization)
|
|
48
|
+

|
|
49
|
+
[](https://mybinder.org/v2/gh/brightway-lca/dynamic_characterization/main?labpath=notebooks%2Fdynamic_characterization_demo.ipynb)
|
|
50
|
+
|
|
51
|
+
This is a package for the dynamic characterization of Life Cycle Inventories with temporal information. It includes a collection of dynamic characterization functions for various environmental flows. We also provide a simple interface to apply these functions to an existing dynamic LCI (coming from, e.g., [bw_temporalis](https://github.com/brightway-lca/bw_temporalis), [bw_timex](https://github.com/brightway-lca/bw_timex) or [optimex](https://github.com/RWTH-LTT/optimex).
|
|
52
|
+
|
|
53
|
+
The following dynamic characterization functions are currently included:
|
|
54
|
+
|
|
55
|
+
| module | impact category | metric | covered emissions | source |
|
|
56
|
+
|--------|-----------------|--------|-------------------|--------|
|
|
57
|
+
| `ipcc_ar6` | climate change | radiative forcing, GWP | 247 GHGs | radiative efficiencies & lifetimes from [IPCC AR6 Ch.7](https://www.ipcc.ch/report/ar6/wg1/chapter/chapter-7/) |
|
|
58
|
+
| `prospective` | climate change | prospective radiative forcing, pGWP, pGTP | CO2, CH4, N2O | [Watanabe et al. (2026)](https://pubs.acs.org/doi/10.1021/acs.est.5c12391) |
|
|
59
|
+
| `original_temporalis_functions` | climate change | radiative forcing | CO2, CH4 | [bw_temporalis](https://github.com/brightway-lca/bw_temporalis/tree/main) |
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```console
|
|
64
|
+
$ pip install dynamic-characterization
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The same thing with [uv](https://docs.astral.sh/uv/) is `uv add dynamic-characterization`, and with conda `conda install -c conda-forge -c diepers dynamic_characterization`. See the [installation guide](https://dynamic-characterization.readthedocs.io/en/latest/content/installation/) for the details.
|
|
68
|
+
|
|
69
|
+
## Quick start
|
|
70
|
+
|
|
71
|
+
You bring a dynamic inventory - a DataFrame of `date`, `amount`, `flow`, `activity`, one row per emission at one point in time - and say which metric you want:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from dynamic_characterization import characterize
|
|
75
|
+
from dynamic_characterization.ipcc_ar6 import characterize_co2, characterize_ch4
|
|
76
|
+
|
|
77
|
+
df_characterized = characterize(
|
|
78
|
+
dynamic_inventory_df,
|
|
79
|
+
metric="radiative_forcing", # or GWP, pGWP, pGTP, prospective_radiative_forcing
|
|
80
|
+
characterization_functions={1: characterize_co2, 3: characterize_ch4},
|
|
81
|
+
time_horizon=100,
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Each function turns one row of the inventory into the characterized time series it causes, so the result carries a value per point in time rather than a single score.
|
|
86
|
+
|
|
87
|
+
If you work with [Brightway](https://docs.brightway.dev/en/latest/), pass an impact assessment method as `base_lcia_method` instead of the function dictionary, and the flows it characterizes are matched to our functions automatically, by name or CAS number.
|
|
88
|
+
|
|
89
|
+
## Documentation
|
|
90
|
+
|
|
91
|
+
The full documentation is at [dynamic-characterization.readthedocs.io](https://dynamic-characterization.readthedocs.io/en/latest/):
|
|
92
|
+
|
|
93
|
+
- [Usage](https://dynamic-characterization.readthedocs.io/en/latest/content/usage/) - the workflow in full, and every metric you can ask for
|
|
94
|
+
- [Prospective characterization](https://dynamic-characterization.readthedocs.io/en/latest/content/prospective/) - scenario-based characterization factors: choosing an IAM-SSP-RCP scenario, the IPCC fallback for unsupported GHGs, and scenario-dependent radiative efficiency and CO2 impulse response
|
|
95
|
+
- [Examples](https://dynamic-characterization.readthedocs.io/en/latest/content/examples/) - the demo notebooks, rendered
|
|
96
|
+
- [API reference](https://dynamic-characterization.readthedocs.io/en/latest/api/) - including how to write your own characterization function
|
|
97
|
+
|
|
98
|
+
## Contributing
|
|
99
|
+
|
|
100
|
+
Contributions are very welcome.
|
|
101
|
+
To learn more, see the [Contributor Guide][Contributor Guide].
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
Distributed under the terms of the [BSD 3-Clause license][License],
|
|
106
|
+
_dynamic_characterization_ is free and open source software.
|
|
107
|
+
|
|
108
|
+
## Issues
|
|
109
|
+
|
|
110
|
+
If you encounter any problems,
|
|
111
|
+
please [file an issue][Issue Tracker] along with a detailed description.
|
|
112
|
+
|
|
113
|
+
## Support
|
|
114
|
+
|
|
115
|
+
If you have any questions or need help, do not hesitate to contact Timo Diepers ([timo.diepers@ltt.rwth-aachen.de](mailto:timo.diepers@ltt.rwth-aachen.de))
|
|
116
|
+
|
|
117
|
+
<!-- github-only -->
|
|
118
|
+
|
|
119
|
+
[License]: https://github.com/brightway-lca/dynamic_characterization/blob/main/LICENSE
|
|
120
|
+
[Contributor Guide]: https://github.com/brightway-lca/dynamic_characterization/blob/main/CONTRIBUTING.md
|
|
121
|
+
[Issue Tracker]: https://github.com/brightway-lca/dynamic_characterization/issues
|
|
@@ -22,6 +22,7 @@ classifiers = [
|
|
|
22
22
|
"Programming Language :: Python :: 3.10",
|
|
23
23
|
"Programming Language :: Python :: 3.11",
|
|
24
24
|
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"License :: OSI Approved :: BSD License",
|
|
25
26
|
"Natural Language :: English",
|
|
26
27
|
"Operating System :: OS Independent",
|
|
27
28
|
"Topic :: Scientific/Engineering"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Tests for prospective prospective characterization module."""
|
|
2
2
|
|
|
3
|
+
import warnings
|
|
3
4
|
import pytest
|
|
4
5
|
import numpy as np
|
|
5
6
|
import importlib.util
|
|
@@ -1209,3 +1210,50 @@ def test_pgtp_characterization():
|
|
|
1209
1210
|
assert pgtp_n2o > pgtp_ch4
|
|
1210
1211
|
# N2O pGTP100 should be in reasonable range (~200-400)
|
|
1211
1212
|
assert 150 < pgtp_n2o < 450
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
def test_emission_year_bounds_follow_data():
|
|
1216
|
+
"""Emission years are clamped to the range covered by the RE data, not 2030-2100."""
|
|
1217
|
+
config.set_scenario(iam="IMAGE", ssp="SSP1", rcp="2.6")
|
|
1218
|
+
|
|
1219
|
+
years = data_loader.load_re_co2("IMAGE")["_years"]
|
|
1220
|
+
assert (int(years[0]), int(years[-1])) == (2020, 2150)
|
|
1221
|
+
|
|
1222
|
+
# Years the SI tables don't report but the data covers: no warning, distinct results
|
|
1223
|
+
for year in (2020, 2025, 2120):
|
|
1224
|
+
with warnings.catch_warnings():
|
|
1225
|
+
warnings.simplefilter("error")
|
|
1226
|
+
agwp.agwp_co2(emission_year=year, time_horizon=100)
|
|
1227
|
+
|
|
1228
|
+
assert agwp.agwp_co2(emission_year=2020) != agwp.agwp_co2(emission_year=2030)
|
|
1229
|
+
|
|
1230
|
+
# Outside the data: clamped with a warning, equal to the boundary year
|
|
1231
|
+
with pytest.warns(UserWarning, match="clamping to 2020"):
|
|
1232
|
+
assert agwp.agwp_co2(emission_year=2010) == agwp.agwp_co2(emission_year=2020)
|
|
1233
|
+
|
|
1234
|
+
with pytest.warns(UserWarning, match="clamping to 2150"):
|
|
1235
|
+
assert agwp.agwp_co2(emission_year=2200) == agwp.agwp_co2(emission_year=2150)
|
|
1236
|
+
|
|
1237
|
+
|
|
1238
|
+
def test_valid_scenarios_match_data_files():
|
|
1239
|
+
"""VALID_SCENARIOS lists exactly the IAM-SSP-RCP combinations present in the data."""
|
|
1240
|
+
loaders = {
|
|
1241
|
+
"CO2": data_loader.load_re_co2,
|
|
1242
|
+
"CH4": data_loader.load_re_ch4,
|
|
1243
|
+
"N2O": data_loader.load_re_n2o,
|
|
1244
|
+
}
|
|
1245
|
+
iams = {iam for iam, _, _ in config.VALID_SCENARIOS}
|
|
1246
|
+
|
|
1247
|
+
for gas, loader in loaders.items():
|
|
1248
|
+
in_data = {
|
|
1249
|
+
(iam, ssp, rcp)
|
|
1250
|
+
for iam in iams
|
|
1251
|
+
for ssp, rcps in loader(iam).items()
|
|
1252
|
+
if ssp != "_years"
|
|
1253
|
+
for rcp in rcps
|
|
1254
|
+
}
|
|
1255
|
+
assert in_data == config.VALID_SCENARIOS, (
|
|
1256
|
+
f"{gas} RE data and VALID_SCENARIOS disagree: "
|
|
1257
|
+
f"only in data {sorted(in_data - config.VALID_SCENARIOS)}, "
|
|
1258
|
+
f"only in config {sorted(config.VALID_SCENARIOS - in_data)}"
|
|
1259
|
+
)
|