tsam
Time series aggregation module (tsam). Determines typical operation periods or dereases the temporal resolution. Accelerates model or experiment runs.
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org, sciencedirect.com, mdpi.com -
✓Committers with academic emails
11 of 25 committers (44.0%) from academic institutions -
✓Institutional organization owner
Organization fzj-iek3-vsa has institutional domain (www.fz-juelich.de) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.1%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Time series aggregation module (tsam). Determines typical operation periods or dereases the temporal resolution. Accelerates model or experiment runs.
Basic Info
- Host: GitHub
- Owner: FZJ-IEK3-VSA
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://tsam.readthedocs.io/
- Size: 11.2 MB
Statistics
- Stars: 164
- Watchers: 13
- Forks: 37
- Open Issues: 4
- Releases: 23
Topics
Metadata Files
README.md
tsam - Time Series Aggregation Module
tsam is a python package which uses different machine learning algorithms for the aggregation of time series. The data aggregation can be performed in two freely combinable dimensions: By representing the time series by a user-defined number of typical periods or by decreasing the temporal resolution. tsam was originally designed for reducing the computational load for large-scale energy system optimization models by aggregating their input data, but is applicable for all types of time series, e.g., weather data, load data, both simultaneously or other arbitrary groups of time series.
The documentation of the tsam code can be found here.
Features
- flexible handling of multidimensional time-series via the pandas module
- different aggregation methods implemented (averaging, k-means, exact k-medoids, hierarchical, k-maxoids, k-medoids with contiguity), which are based on scikit-learn, or self-programmed with pyomo
- hypertuning of aggregation parameters to find the optimal combination of the number of segments inside a period and the number of typical periods
- novel representation methods, keeping statistical attributes, such as the distribution
- flexible integration of extreme periods as own cluster centers
- weighting for the case of multidimensional time-series to represent their relevance
Installation
It is recommended to install tsam within its own environment. If you are no familiar with python environments, plaese consider to read some external documentation. In the following we assume you have a mamba or conda installation. All conda and mamba command are interchangeable.
Direct Installations from Package Manager Repositories
If you want to prevent any possible dependency conflicts create a new environment using the following command:
mamba create -n tsam_env python pip
Activate an existing or the newly create environment afterward
mamba activate tsam_env
Directly install via pip from pypi as follows:
pip install tsam
or install from conda forge with the following command:
conda install tsam -c conda-forge
Local Installation for Development
Alternatively, clone a local copy of the repository to your computer
git clone https://github.com/FZJ-IEK3-VSA/tsam.git
Change the directory of your shell into the root folder of the repository
cd tsam
For development, it is recommended to install tsam into its own environment using conda e.g.
conda env create --file=requirement.yml
Afterward activate the environment
conda activate tsam_env
Then install tsam via pip as follows
pip install -e .[dev]
Installation of MILP Solver for k-medoids
In order to use the k-medoids clustering, make sure that you have installed a MILP solver. As default HiGHS is installed and used. Nevertheless, in case you have access to a license we recommend commercial solvers (e.g. Gurobi or CPLEX) since they have a better performance.
Developer installation
In order to setup a virtual environment in Linux, correct the python name in the Makefile and call
make setup_venv
Examples
Basic workflow
A small example how tsam can be used is decribed as follows
python
import pandas as pd
import tsam.timeseriesaggregation as tsam
Read in the time series data set with pandas
python
raw = pd.read_csv('testdata.csv', index_col = 0)
Initialize an aggregation object and define the length of a single period, the number of typical periods, the number of segments in each period, the aggregation method and the representation method - here duration/distribution representation which contains the minimum and maximum value of the original time series
python
aggregation = tsam.TimeSeriesAggregation(raw,
noTypicalPeriods = 8,
hoursPerPeriod = 24,
segmentation = True,
noSegments = 8,
representationMethod = "distributionAndMinMaxRepresentation",
distributionPeriodWise = False
clusterMethod = 'hierarchical'
)
Run the aggregation to typical periods
python
typPeriods = aggregation.createTypicalPeriods()
Store the results as .csv file
python
typPeriods.to_csv('typperiods.csv')
Detailed examples
A first example shows the capabilites of tsam as jupyter notebook.
A second example shows in more detail how to access the relevant aggregation results required for paramtrizing e.g. an optimization.
The example time series are based on a department publication and the test reference years of the DWD.
License
MIT License
Copyright (C) 2016-2022 Leander Kotzur (FZJ IEK-3), Maximilian Hoffmann (FZJ IEK-3), Peter Markewitz (FZJ IEK-3), Martin Robinius (FZJ IEK-3), Detlef Stolten (FZJ IEK-3)
You should have received a copy of the MIT License along with this program. If not, see https://opensource.org/licenses/MIT
The core developer team sits in the Institute of Energy and Climate Research - Techno-Economic Energy Systems Analysis (IEK-3) belonging to the Forschungszentrum Jülich.
Citing and further reading
If you want to use tsam in a published work, please kindly cite our latest journal articles: * Hoffmann et al. (2022):\ The Pareto-Optimal Temporal Aggregation of Energy System Models
If you are further interested in the impact of time series aggregation on the cost-optimal results on different energy system use cases, you can find a publication which validates the methods and describes their cababilites via the following link. A second publication introduces a method how to model state variables (e.g. the state of charge of energy storage components) between the aggregated typical periods which can be found here. Finally yet importantly the potential of time series aggregation to simplify mixed integer linear problems is investigated here.
The publications about time series aggregation for energy system optimization models published alongside the development of tsam are listed below: * Hoffmann et al. (2021):\ The Pareto-Optimal Temporal Aggregation of Energy System Models\ (open access manuscript to be found here) * Hoffmann et al. (2021):\ Typical periods or typical time steps? A multi-model analysis to determine the optimal temporal aggregation for energy system models * Hoffmann et al. (2020):\ A Review on Time Series Aggregation Methods for Energy System Models * Kannengießer et al. (2019):\ Reducing Computational Load for Mixed Integer Linear Programming: An Example for a District and an Island Energy System * Kotzur et al. (2018):\ Time series aggregation for energy system design: Modeling seasonal storage\ (open access manuscript to be found here) * Kotzur et al. (2018):\ Impact of different time series aggregation methods on optimal energy system design\ (open access manuscript to be found here)
Acknowledgement
This work is supported by the Helmholtz Association under the Joint Initiative "Energy System 2050 A Contribution of the Research Field Energy" and the program "Energy System Design" and within the BMWi/BMWk funded project METIS.
Owner
- Name: Forschungszentrum Jülich - Jülich Systems Analysis
- Login: FZJ-IEK3-VSA
- Kind: organization
- Location: Forschungszentrum Jülich
- Website: https://www.fz-juelich.de/iek/iek-3/EN/Home/home_node.html
- Repositories: 16
- Profile: https://github.com/FZJ-IEK3-VSA
Institute of Climate and Energy Systems (ICE)
GitHub Events
Total
- Create event: 3
- Release event: 1
- Issues event: 4
- Watch event: 16
- Issue comment event: 10
- Push event: 5
- Pull request review event: 4
- Pull request event: 5
- Fork event: 4
Last Year
- Create event: 3
- Release event: 1
- Issues event: 4
- Watch event: 16
- Issue comment event: 10
- Push event: 5
- Pull request review event: 4
- Pull request event: 5
- Fork event: 4
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| maximilian-hoffmann | m****n@f****e | 95 |
| l-kotzur | l****r@f****e | 79 |
| l-kotzur | l****r@g****m | 54 |
| Leander Kotzur | l****r@r****e | 26 |
| j.schoenau | j****u@f****e | 10 |
| julian-belina | 5****a@u****m | 9 |
| Julian Schönau | 6****e@u****m | 7 |
| Cord Kaldemeyer | c****r@f****e | 4 |
| Fabian Neumann | f****n@o****e | 4 |
| Samuel Letellier-Duchesne | s****e@m****m | 4 |
| Amedeo Paolo Ceruti | g****z@m****e | 3 |
| Robert Schwarz | r****t@d****l | 3 |
| maximilian-hoffmann | 4****n@u****m | 3 |
| Lars Schellhas | l****s@o****m | 2 |
| Philipp Dunkel | 8****j@u****m | 2 |
| andreas smolenko | a****o@f****e | 2 |
| jo-omoyele | 1****e@u****m | 2 |
| simnh | s****t@u****e | 2 |
| Amedeo Ceruti | a****i@t****e | 1 |
| Dilara Gulcin Caglayan | d****n@f****e | 1 |
| Francesco Witte | g****b@w****h | 1 |
| Leander Kotzur | l****r@i****e | 1 |
| ar-fu | a****s@r****e | 1 |
| noah80 | n****0@u****m | 1 |
| rodo | r****d@d****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 38
- Total pull requests: 63
- Average time to close issues: 6 months
- Average time to close pull requests: 24 days
- Total issue authors: 18
- Total pull request authors: 20
- Average comments per issue: 2.71
- Average comments per pull request: 1.19
- Merged pull requests: 49
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 7
- Pull requests: 12
- Average time to close issues: 2 months
- Average time to close pull requests: 4 days
- Issue authors: 3
- Pull request authors: 5
- Average comments per issue: 2.29
- Average comments per pull request: 1.83
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ckaldemeyer (7)
- l-kotzur (6)
- julian-belina (4)
- l-welder (4)
- adbuerger (2)
- sbruche (2)
- phil-fzj (2)
- curiousleo (1)
- jacob-mannhardt (1)
- alicia-le (1)
- mfleschutz (1)
- fneum (1)
- SilkeJo (1)
- larsschellhas (1)
- samuelduchesne (1)
Pull Request Authors
- l-kotzur (26)
- maximilian-hoffmann (7)
- OfficialCodexplosive (7)
- julian-belina (6)
- larsschellhas (3)
- phil-fzj (3)
- ddceruti (3)
- jo-omoyele (2)
- samuelduchesne (2)
- ar-fu (2)
- fneum (2)
- dcaglayan (1)
- ckaldemeyer (1)
- rschwarz (1)
- swit22 (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- pypi 10,955 last-month
-
Total dependent packages: 7
(may contain duplicates) -
Total dependent repositories: 29
(may contain duplicates) - Total versions: 66
- Total maintainers: 5
pypi.org: tsam
Time series aggregation module (tsam) to create typical periods
- Documentation: https://tsam.readthedocs.io/
- License: MIT License Copyright (c) 2017 Leander Kotzur (FZJ IEK-3), Maximilian Hoffmann (FZJ IEK-3), Peter Markewitz (FZJ IEK-3), Martin Robinius (FZJ IEK-3), Detlef Stolten (FZJ IEK-3) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 2.3.9
published 8 months ago
Rankings
Maintainers (5)
proxy.golang.org: github.com/FZJ-IEK3-VSA/tsam
- Documentation: https://pkg.go.dev/github.com/FZJ-IEK3-VSA/tsam#section-documentation
- License: mit
-
Latest release: v2.3.5+incompatible
published over 1 year ago
Rankings
proxy.golang.org: github.com/fzj-iek3-vsa/tsam
- Documentation: https://pkg.go.dev/github.com/fzj-iek3-vsa/tsam#section-documentation
- License: mit
-
Latest release: v2.3.5+incompatible
published over 1 year ago
Rankings
conda-forge.org: tsam
- Homepage: https://github.com/FZJ-IEK3-VSA/tsam
- License: MIT
-
Latest release: 2.0.1
published almost 4 years ago
Rankings
Dependencies
- networkx *
- numpy >=1.11.0
- pandas >=0.18.1
- pyomo >=5.3
- scikit-learn >=0.0
- tqdm *
- actions/checkout v2 composite
- actions/setup-python v2 composite
- pytest * development
- sphinx * development
- sphinx-autobuild * development
- sphinx_book_theme * development
- twine * development
