Collection of dynamic characterization functions for life cycle inventories with temporal information
Project description
dynamic_characterization
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 or bw_timex).
The following dynamic characterization functions are currently included:
impact category | metric | covered emissions | source |
---|---|---|---|
climate change | radiative forcing | CO2, CH4 | bw_temporalis |
climate change | radiative forcing | 247 GHGs from IPCC AR6 Ch.7 | bw_timex |
What do dynamic characterization functions do?
The functions are meant to work with a common input format of the dynamic inventory, collected in a pandas DataFrame that looks like this:
date | amount | flow | activity |
---|---|---|---|
101 | 33 | 1 | 2 |
312 | 21 | 4 | 2 |
Each function takes one row of this dynamic inventory dataframe (i.e. one emission at one point in time) and transform it according to some metric. The output generated by applying a very simple function to both rows of the input dataframe could look like:
date | amount | flow | activity |
---|---|---|---|
101 | 33 | 1 | 2 |
102 | 31 | 1 | 2 |
103 | 31 | 1 | 2 |
312 | 21 | 4 | 2 |
313 | 20 | 4 | 2 |
314 | 19 | 4 | 2 |
What do dynamic characterization functions look like?
Here's an example of what such a function could look like:
def characterize_something(series, period: int = 100, cumulative=False) -> pd.DataFrame:
date_beginning: np.datetime64 = series.date.to_numpy()
dates_characterized: np.ndarray = date_beginning + np.arange(
start=0, stop=period, dtype="timedelta64[Y]"
).astype("timedelta64[s]")
# let's assume some simple decay function
decay_multipliers: list = np.array(
[
1.234 * (1 - np.exp(-year / 56.789))
for year in range(period)
]
)
forcing = np.array(series.amount * decay_multipliers, dtype="float64")
if not cumulative:
forcing = np.diff(forcing, prepend=0)
return pd.DataFrame(
{
"date": np.array(dates_characterized, dtype="datetime64[s]"),
"amount": forcing,
"flow": series.flow,
"activity": series.activity,
}
)
Installation
You can install dynamic_characterization
via [pip] from [PyPI]:
$ pip install dynamic_characterization
Alternatively, you can also use conda:
$ conda install -c diepers dynamic_characterization
Contributing
Contributions are very welcome. To learn more, see the Contributor Guide.
License
Distributed under the terms of the BSD 3 Clause license, dynamic_characterization is free and open source software.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Support
If you have any questions or need help, do not hesitate to contact Timo Diepers (timo.diepers@ltt.rwth-aachen.de)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dynamic_characterization-1.0.2.tar.gz
.
File metadata
- Download URL: dynamic_characterization-1.0.2.tar.gz
- Upload date:
- Size: 953.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed3872758bf3956cea5bdf5e3c39cfff6b2e4b450e1608fc5a517f1574910e57 |
|
MD5 | 585dae1cc57a6c5256ed7ca5fca4f921 |
|
BLAKE2b-256 | 2c639f845f0b4339e2e95f39b2322b2178f1aa44598f3cfcb1e96d8f77a75af5 |
File details
Details for the file dynamic_characterization-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: dynamic_characterization-1.0.2-py3-none-any.whl
- Upload date:
- Size: 959.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a7d262d34913e01998fa356d1eba7447047b3881904dd7f4ccc1a735da910b8 |
|
MD5 | 08373f9b242bbc03a9eb4388c159a9ad |
|
BLAKE2b-256 | c4ad09c65a278284aad9de3aefa5a36f0065441e36c0465af74fce578da0f430 |