tsam 2.2.2__py3-none-any.whl → 2.3.4__py3-none-any.whl

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.
@@ -1,167 +1,175 @@
1
- Metadata-Version: 2.1
2
- Name: tsam
3
- Version: 2.2.2
4
- Summary: Time series aggregation module (tsam) to create typical periods
5
- Home-page: https://github.com/FZJ-IEK3-VSA/tsam
6
- Author: Leander Kotzur, Maximilian Hoffmann
7
- Author-email: leander.kotzur@googlemail.com, max.hoffmann@fz-juelich.de
8
- Keywords: clustering,optimization
9
- Classifier: Development Status :: 4 - Beta
10
- Classifier: Intended Audience :: End Users/Desktop
11
- Classifier: Intended Audience :: Science/Research
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Natural Language :: English
14
- Classifier: Operating System :: OS Independent
15
- Classifier: Programming Language :: Python
16
- Classifier: Programming Language :: Python :: 2
17
- Classifier: Programming Language :: Python :: 2.7
18
- Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.4
20
- Classifier: Programming Language :: Python :: 3.5
21
- Classifier: Programming Language :: Python :: 3.6
22
- Classifier: Topic :: Scientific/Engineering :: Mathematics
23
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Description-Content-Type: text/markdown
25
- License-File: LICENSE.txt
26
- Requires-Dist: scikit-learn (>=0.0)
27
- Requires-Dist: pandas (>=0.18.1)
28
- Requires-Dist: numpy (>=1.11.0)
29
- Requires-Dist: pyomo (>=6.4.3)
30
- Requires-Dist: networkx
31
- Requires-Dist: tqdm
32
- Requires-Dist: highspy
33
-
34
- [![Build Status](https://travis-ci.com/FZJ-IEK3-VSA/tsam.svg?branch=master)](https://travis-ci.com/FZJ-IEK3-VSA/tsam) [![Version](https://img.shields.io/pypi/v/tsam.svg)](https://pypi.python.org/pypi/tsam) [![Documentation Status](https://readthedocs.org/projects/tsam/badge/?version=latest)](https://tsam.readthedocs.io/en/latest/) [![PyPI - License](https://img.shields.io/pypi/l/tsam)]((https://github.com/FZJ-IEK3-VSA/tsam/blob/master/LICENSE.txt)) [![codecov](https://codecov.io/gh/FZJ-IEK3-VSA/tsam/branch/master/graph/badge.svg)](https://codecov.io/gh/FZJ-IEK3-VSA/tsam)
35
- [![badge](https://img.shields.io/badge/launch-binder-579aca.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8gICAgoiIkJCQlJicnJ2goKCmqK+wsLC4usDAwMjP0NDQ1NbW3Nzg4ODi5+3v8PDw8/T09PX29vb39/f5+fr7+/z8/Pz9/v7+zczCxgAABC5JREFUeAHN1ul3k0UUBvCb1CTVpmpaitAG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DKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/FZJ-IEK3-VSA/voila-tsam/HEAD?urlpath=voila/render/Time-Series-Aggregation-Module.ipynb)
36
-
37
- <a href="https://www.fz-juelich.de/en/iek/iek-3"><img src="https://www.fz-juelich.de/static/media/Logo.2ceb35fc.svg" alt="Forschungszentrum Juelich Logo" width="230px"></a>
38
-
39
- # tsam - Time Series Aggregation Module
40
- 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.
41
- 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.
42
-
43
- The documentation of the tsam code can be found [**here**](https://tsam.readthedocs.io/en/latest/index.html).
44
-
45
- ## Features
46
- * flexible handling of multidimensional time-series via the pandas module
47
- * 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
48
- * hypertuning of aggregation parameters to find the optimal combination of the number of segments inside a period and the number of typical periods
49
- * novel representation methods, keeping statistical attributes, such as the distribution
50
- * flexible integration of extreme periods as own cluster centers
51
- * weighting for the case of multidimensional time-series to represent their relevance
52
-
53
-
54
- ## Installation
55
- Directly install via pip as follows:
56
-
57
- pip install tsam
58
-
59
- Alternatively, clone a local copy of the repository to your computer
60
-
61
- git clone https://github.com/FZJ-IEK3-VSA/tsam.git
62
-
63
- Then install tsam via pip as follow
64
-
65
- cd tsam
66
- pip install .
67
-
68
- Or install directly via python as
69
-
70
- python setup.py install
71
-
72
- In order to use the k-medoids clustering, make sure that you have installed a MILP solver. As default [HiGHS](https://github.com/ERGO-Code/HiGHS) is 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.
73
-
74
-
75
- ## Examples
76
-
77
- ### Basic workflow
78
-
79
- A small example how tsam can be used is decribed as follows
80
- ```python
81
- import pandas as pd
82
- import tsam.timeseriesaggregation as tsam
83
- ```
84
-
85
-
86
- Read in the time series data set with pandas
87
- ```python
88
- raw = pd.read_csv('testdata.csv', index_col = 0)
89
- ```
90
-
91
- 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
92
- ```python
93
- aggregation = tsam.TimeSeriesAggregation(raw,
94
- noTypicalPeriods = 8,
95
- hoursPerPeriod = 24,
96
- rescaleClusterPeriods = False,
97
- segmentation = True,
98
- representationMethod = "distributionRepresentation",
99
- distributionPeriodWise = False
100
- clusterMethod = 'hierarchical')
101
- ```
102
-
103
- Run the aggregation to typical periods
104
- ```python
105
- typPeriods = aggregation.createTypicalPeriods()
106
- ```
107
-
108
- Store the results as .csv file
109
-
110
- ```python
111
- typPeriods.to_csv('typperiods.csv')
112
- ```
113
-
114
- ### Detailed examples
115
-
116
- A [**first example**](/examples/aggregation_example.ipynb) shows the capabilites of tsam as jupyter notebook.
117
-
118
- A [**second example**](/examples/aggregation_optiinput.ipynb) shows in more detail how to access the relevant aggregation results required for paramtrizing e.g. an optimization.
119
-
120
- The example time series are based on a department [publication](https://www.mdpi.com/1996-1073/10/3/361) and the [test reference years of the DWD](https://www.dwd.de/DE/leistungen/testreferenzjahre/testreferenzjahre.html).
121
-
122
- ## License
123
-
124
- MIT License
125
-
126
- 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)
127
-
128
- You should have received a copy of the MIT License along with this program.
129
- If not, see https://opensource.org/licenses/MIT
130
-
131
- The core developer team sits in the [Institute of Energy and Climate Research - Techno-Economic Energy Systems Analysis (IEK-3)](https://www.fz-juelich.de/iek/iek-3/EN/Home/home_node.html) belonging to the [Forschungszentrum Jülich](https://www.fz-juelich.de/).
132
-
133
- ## Citing and further reading
134
-
135
- If you want to use tsam in a published work, **please kindly cite** our latest journal articles:
136
- * Hoffmann et al. (2022):\
137
- [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261922004342)
138
-
139
-
140
- 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**](https://www.sciencedirect.com/science/article/pii/S0960148117309783). 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**](https://www.sciencedirect.com/science/article/pii/S0306261918300242). Finally yet importantly the potential of time series aggregation to simplify mixed integer linear problems is investigated [**here**](https://www.mdpi.com/1996-1073/12/14/2825).
141
-
142
- The publications about time series aggregation for energy system optimization models published alongside the development of tsam are listed below:
143
- * Hoffmann et al. (2021):\
144
- [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261922004342)\
145
- (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
146
- * Hoffmann et al. (2021):\
147
- [**Typical periods or typical time steps? A multi-model analysis to determine the optimal temporal aggregation for energy system models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261921011545)
148
- * Hoffmann et al. (2020):\
149
- [**A Review on Time Series Aggregation Methods for Energy System Models**](https://www.mdpi.com/1996-1073/13/3/641)
150
- * Kannengießer et al. (2019):\
151
- [**Reducing Computational Load for Mixed Integer Linear Programming: An Example for a District and an Island Energy System**](https://www.mdpi.com/1996-1073/12/14/2825)
152
- * Kotzur et al. (2018):\
153
- [**Time series aggregation for energy system design: Modeling seasonal storage**](https://www.sciencedirect.com/science/article/pii/S0306261918300242)\
154
- (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
155
- * Kotzur et al. (2018):\
156
- [**Impact of different time series aggregation methods on optimal energy system design**](https://www.sciencedirect.com/science/article/abs/pii/S0960148117309783)\
157
- (open access manuscript to be found [**here**](https://arxiv.org/abs/1708.00420))
158
-
159
-
160
-
161
- ## Acknowledgement
162
-
163
- This work is supported by the Helmholtz Association under the Joint Initiative ["Energy System 2050 A Contribution of the Research Field Energy"](https://www.helmholtz.de/en/research/energy/energy_system_2050/) and the program ["Energy System Design"](https://www.esd.kit.edu/index.php) and within the [BMWi/BMWk](https://www.bmwk.de/Navigation/DE/Home/home.html) funded project [**METIS**](http://www.metis-platform.net/).
164
-
165
- <a href="https://www.helmholtz.de/en/"><img src="https://www.helmholtz.de/fileadmin/user_upload/05_aktuelles/Marke_Design/logos/HG_LOGO_S_ENG_RGB.jpg" alt="Helmholtz Logo" width="200px" style="float:right"></a>
166
-
167
-
1
+ Metadata-Version: 2.1
2
+ Name: tsam
3
+ Version: 2.3.4
4
+ Summary: Time series aggregation module (tsam) to create typical periods
5
+ Home-page: https://github.com/FZJ-IEK3-VSA/tsam
6
+ Author: Leander Kotzur, Maximilian Hoffmann
7
+ Author-email: leander.kotzur@googlemail.com, maximilian.hoffmann@julumni.fz-juelich.de
8
+ Keywords: clustering,optimization
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: End Users/Desktop
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 2
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE.txt
23
+ Requires-Dist: scikit-learn >=0.0
24
+ Requires-Dist: pandas >=2.0.3
25
+ Requires-Dist: numpy >=1.20.0
26
+ Requires-Dist: pyomo >=6.4.3
27
+ Requires-Dist: networkx
28
+ Requires-Dist: tqdm
29
+ Requires-Dist: highspy
30
+
31
+ [![daily pytest](https://github.com/FZJ-IEK3-VSA/tsam/actions/workflows/daily_tests.yml/badge.svg?branch=master)](https://github.com/FZJ-IEK3-VSA/tsam/actions) [![Version](https://img.shields.io/pypi/v/tsam.svg)](https://pypi.python.org/pypi/tsam) [![Conda Version](https://img.shields.io/conda/vn/conda-forge/tsam.svg)](https://anaconda.org/conda-forge/tsam) [![Documentation Status](https://readthedocs.org/projects/tsam/badge/?version=latest)](https://tsam.readthedocs.io/en/latest/) [![PyPI - License](https://img.shields.io/pypi/l/tsam)]((https://github.com/FZJ-IEK3-VSA/tsam/blob/master/LICENSE.txt)) [![codecov](https://codecov.io/gh/FZJ-IEK3-VSA/tsam/branch/master/graph/badge.svg)](https://codecov.io/gh/FZJ-IEK3-VSA/tsam)
32
+ [![badge](https://img.shields.io/badge/launch-binder-579aca.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJX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E9LjGMzTmqKXPLnlWVnIlQQTvxJf8ip7VgjZjyVPrjw1te5otM7RmP7xm+sK2Gv9I8Gi++BRbEkR9EBw8zRUcKxwp73xkaLiqQb+kGduJTNHG72zcW9LoJgqQxpP3/Tj//c3yB0tqzaml05/+orHLksVO+95kX7/7qgJvnjlrfr2Ggsyx0eoy9uPzN5SPd86aXggOsEKW2Prz7du3VID3/tzs/sSRs2w7ovVHKtjrX2pd7ZMlTxAYfBAL9jiDwfLkq55Tm7ifhMlTGPyCAs7RFRhn47JnlcB9RM5T97ASuZXIcVNuUDIndpDbdsfrqsOppeXl5Y+XVKdjFCTh+zGaVuj0d9zy05PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/FZJ-IEK3-VSA/voila-tsam/HEAD?urlpath=voila/render/Time-Series-Aggregation-Module.ipynb)
33
+
34
+ <a href="https://www.fz-juelich.de/en/iek/iek-3"><img src="https://www.fz-juelich.de/static/media/Logo.2ceb35fc.svg" alt="Forschungszentrum Juelich Logo" width="230px"></a>
35
+
36
+ # tsam - Time Series Aggregation Module
37
+ 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.
38
+ 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.
39
+
40
+ The documentation of the tsam code can be found [**here**](https://tsam.readthedocs.io/en/latest/index.html).
41
+
42
+ ## Features
43
+ * flexible handling of multidimensional time-series via the pandas module
44
+ * 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
45
+ * hypertuning of aggregation parameters to find the optimal combination of the number of segments inside a period and the number of typical periods
46
+ * novel representation methods, keeping statistical attributes, such as the distribution
47
+ * flexible integration of extreme periods as own cluster centers
48
+ * weighting for the case of multidimensional time-series to represent their relevance
49
+
50
+
51
+ ## Installation
52
+ Directly install via pip from pypi as follows:
53
+
54
+ pip install tsam
55
+
56
+ of install from conda forge with the following command:
57
+
58
+ conda install tsam -c conda-forge
59
+
60
+ Alternatively, clone a local copy of the repository to your computer
61
+
62
+ git clone https://github.com/FZJ-IEK3-VSA/tsam.git
63
+
64
+ Then install tsam via pip as follow
65
+
66
+ cd tsam
67
+ pip install .
68
+
69
+ Or install directly via python as
70
+
71
+ python setup.py install
72
+
73
+ In order to use the k-medoids clustering, make sure that you have installed a MILP solver. As default [HiGHS](https://github.com/ERGO-Code/HiGHS) is 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.
74
+
75
+ ### Developer installation
76
+
77
+ In order to setup a virtual environment in Linux, correct the python name in the Makefile and call
78
+
79
+ make setup_venv
80
+
81
+
82
+ ## Examples
83
+
84
+ ### Basic workflow
85
+
86
+ A small example how tsam can be used is decribed as follows
87
+ ```python
88
+ import pandas as pd
89
+ import tsam.timeseriesaggregation as tsam
90
+ ```
91
+
92
+
93
+ Read in the time series data set with pandas
94
+ ```python
95
+ raw = pd.read_csv('testdata.csv', index_col = 0)
96
+ ```
97
+
98
+ 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
99
+ ```python
100
+ aggregation = tsam.TimeSeriesAggregation(raw,
101
+ noTypicalPeriods = 8,
102
+ hoursPerPeriod = 24,
103
+ segmentation = True,
104
+ noSegments = 8,
105
+ representationMethod = "distributionAndMinMaxRepresentation",
106
+ distributionPeriodWise = False
107
+ clusterMethod = 'hierarchical'
108
+ )
109
+ ```
110
+
111
+ Run the aggregation to typical periods
112
+ ```python
113
+ typPeriods = aggregation.createTypicalPeriods()
114
+ ```
115
+
116
+ Store the results as .csv file
117
+
118
+ ```python
119
+ typPeriods.to_csv('typperiods.csv')
120
+ ```
121
+
122
+ ### Detailed examples
123
+
124
+ A [**first example**](/examples/aggregation_example.ipynb) shows the capabilites of tsam as jupyter notebook.
125
+
126
+ A [**second example**](/examples/aggregation_optiinput.ipynb) shows in more detail how to access the relevant aggregation results required for paramtrizing e.g. an optimization.
127
+
128
+ The example time series are based on a department [publication](https://www.mdpi.com/1996-1073/10/3/361) and the [test reference years of the DWD](https://www.dwd.de/DE/leistungen/testreferenzjahre/testreferenzjahre.html).
129
+
130
+ ## License
131
+
132
+ MIT License
133
+
134
+ 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)
135
+
136
+ You should have received a copy of the MIT License along with this program.
137
+ If not, see https://opensource.org/licenses/MIT
138
+
139
+ The core developer team sits in the [Institute of Energy and Climate Research - Techno-Economic Energy Systems Analysis (IEK-3)](https://www.fz-juelich.de/iek/iek-3/EN/Home/home_node.html) belonging to the [Forschungszentrum Jülich](https://www.fz-juelich.de/).
140
+
141
+ ## Citing and further reading
142
+
143
+ If you want to use tsam in a published work, **please kindly cite** our latest journal articles:
144
+ * Hoffmann et al. (2022):\
145
+ [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261922004342)
146
+
147
+
148
+ 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**](https://www.sciencedirect.com/science/article/pii/S0960148117309783). 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**](https://www.sciencedirect.com/science/article/pii/S0306261918300242). Finally yet importantly the potential of time series aggregation to simplify mixed integer linear problems is investigated [**here**](https://www.mdpi.com/1996-1073/12/14/2825).
149
+
150
+ The publications about time series aggregation for energy system optimization models published alongside the development of tsam are listed below:
151
+ * Hoffmann et al. (2021):\
152
+ [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261922004342)\
153
+ (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
154
+ * Hoffmann et al. (2021):\
155
+ [**Typical periods or typical time steps? A multi-model analysis to determine the optimal temporal aggregation for energy system models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261921011545)
156
+ * Hoffmann et al. (2020):\
157
+ [**A Review on Time Series Aggregation Methods for Energy System Models**](https://www.mdpi.com/1996-1073/13/3/641)
158
+ * Kannengießer et al. (2019):\
159
+ [**Reducing Computational Load for Mixed Integer Linear Programming: An Example for a District and an Island Energy System**](https://www.mdpi.com/1996-1073/12/14/2825)
160
+ * Kotzur et al. (2018):\
161
+ [**Time series aggregation for energy system design: Modeling seasonal storage**](https://www.sciencedirect.com/science/article/pii/S0306261918300242)\
162
+ (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
163
+ * Kotzur et al. (2018):\
164
+ [**Impact of different time series aggregation methods on optimal energy system design**](https://www.sciencedirect.com/science/article/abs/pii/S0960148117309783)\
165
+ (open access manuscript to be found [**here**](https://arxiv.org/abs/1708.00420))
166
+
167
+
168
+
169
+ ## Acknowledgement
170
+
171
+ This work is supported by the Helmholtz Association under the Joint Initiative ["Energy System 2050 A Contribution of the Research Field Energy"](https://www.helmholtz.de/en/research/energy/energy_system_2050/) and the program ["Energy System Design"](https://www.esd.kit.edu/index.php) and within the [BMWi/BMWk](https://www.bmwk.de/Navigation/DE/Home/home.html) funded project [**METIS**](http://www.metis-platform.net/).
172
+
173
+ <a href="https://www.helmholtz.de/en/"><img src="https://www.helmholtz.de/fileadmin/user_upload/05_aktuelles/Marke_Design/logos/HG_LOGO_S_ENG_RGB.jpg" alt="Helmholtz Logo" width="200px" style="float:right"></a>
174
+
175
+
@@ -0,0 +1,16 @@
1
+ tsam/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ tsam/hyperparametertuning.py,sha256=eM7m7eY80uSlwnLRxmctnis2Jv66D15Z1QD9CCMzSXE,10349
3
+ tsam/periodAggregation.py,sha256=h9CC06jBLNyyaFTMRynGUMN87fOH3NdSEug6EcTsKGA,5471
4
+ tsam/representations.py,sha256=2NL1wanBhGreCeJ8jh0aNdIx05YXEyyMJmMAVFS5-T4,7133
5
+ tsam/timeseriesaggregation.py,sha256=xLkdSmjbJnSxC0GBzF9Vc-6VMK7Y1OPOmQhdHJgymug,56963
6
+ tsam/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ tsam/utils/durationRepresentation.py,sha256=A-RjELO-58jBXbEHxxJ6TPZc2zPC560_SW7kNzw2ZPA,9463
8
+ tsam/utils/k_maxoids.py,sha256=0PyaHQMA8vtV_SuQOZ0qdcGFK46aUvOiMSQofjGkjBQ,4415
9
+ tsam/utils/k_medoids_contiguity.py,sha256=xSN9xT61oc2CPxYERhugR9hDkVCb2o8POvAiLLgrey8,5925
10
+ tsam/utils/k_medoids_exact.py,sha256=CW6BLQV2eTYtMxDmo97-6hY1HljxcvkPVrL4DQPN5IQ,7178
11
+ tsam/utils/segmentation.py,sha256=y8TPv1KEqf6ByOz7TRywm3WC9ZPhGiWvhwAcQbFibt4,6132
12
+ tsam-2.3.4.dist-info/LICENSE.txt,sha256=XEzEzumoCmdJzcp5gKT6UOtKrkH-SiGpxVbIfihkNK4,1224
13
+ tsam-2.3.4.dist-info/METADATA,sha256=d3aPs_IF8L1S92kkCuFpTmQ4I5PTUl_Q7Z8T6uJmO4A,12581
14
+ tsam-2.3.4.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
15
+ tsam-2.3.4.dist-info/top_level.txt,sha256=MFI15PnPuMv8F1hTAOXbjGu41z-l6dJbnK69WlIQNcM,5
16
+ tsam-2.3.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.38.4)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,16 +0,0 @@
1
- tsam/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- tsam/hyperparametertuning.py,sha256=v53rzO7OhW1Vb3I-g5jWWIRLvZWr2g-MZuonjGmpRwU,10104
3
- tsam/periodAggregation.py,sha256=3l1qst0FZVfrfPBFJSgcsejWjY2AGS-gFGXQClPGAVU,5316
4
- tsam/representations.py,sha256=g8sq3EbcTQKC64Phh93Fmwhzdl9RJTsAcDI_soI6P80,6966
5
- tsam/timeseriesaggregation.py,sha256=6Dnzcvu_COck43eo8U2hLkzuNP1ZP2py7i8FjXvmKyk,53048
6
- tsam/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- tsam/utils/durationRepresentation.py,sha256=oxn9Xoh4rNafFArivYO4HflZApw0C5-dM53-zUt81C8,6199
8
- tsam/utils/k_maxoids.py,sha256=LZcn9iw7Uf5roOn8r3l3nT06pqFVweEDsWbiqyqSN5M,4270
9
- tsam/utils/k_medoids_contiguity.py,sha256=utUfJc1hG3KkkAR1afa1W2oh38kbxGcnwEWtGdT_vNQ,5710
10
- tsam/utils/k_medoids_exact.py,sha256=B5qTRfjvlzeoR00AL1DVkEkLVn2ixCER5EMHTdHTsh8,6866
11
- tsam/utils/segmentation.py,sha256=Hc7k6_HWCS6NLshs8fATum7iWVir0Ji4YAalV8g-hNM,6026
12
- tsam-2.2.2.dist-info/LICENSE.txt,sha256=B8VmjbX12BUztPNAYQR4hl3s7b2Q-YYAigrV5dkNGOw,1204
13
- tsam-2.2.2.dist-info/METADATA,sha256=fwlqqjdYB_660bPzYi_oqaI8WYhMat2hylzmEN6OEZE,12099
14
- tsam-2.2.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
15
- tsam-2.2.2.dist-info/top_level.txt,sha256=MFI15PnPuMv8F1hTAOXbjGu41z-l6dJbnK69WlIQNcM,5
16
- tsam-2.2.2.dist-info/RECORD,,