tsam 2.3.4__tar.gz → 2.3.6__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.
Files changed (98) hide show
  1. {tsam-2.3.4 → tsam-2.3.6}/LICENSE.txt +20 -20
  2. {tsam-2.3.4 → tsam-2.3.6}/MANIFEST.in +3 -3
  3. {tsam-2.3.4/tsam.egg-info → tsam-2.3.6}/PKG-INFO +225 -168
  4. tsam-2.3.4/PKG-INFO → tsam-2.3.6/README.md +167 -168
  5. {tsam-2.3.4 → tsam-2.3.6}/examples/results/paretoOptimalAggregation.csv +389 -389
  6. {tsam-2.3.4 → tsam-2.3.6}/examples/results/preprocessed_wind.csv +368 -368
  7. {tsam-2.3.4 → tsam-2.3.6}/examples/results/testperiods_hierarchical.csv +241 -241
  8. {tsam-2.3.4 → tsam-2.3.6}/examples/results/testperiods_kmeans.csv +193 -193
  9. {tsam-2.3.4 → tsam-2.3.6}/examples/results/testperiods_kmedoids.csv +1345 -1345
  10. {tsam-2.3.4 → tsam-2.3.6}/examples/results/testperiods_predefClusterOrder.csv +193 -193
  11. {tsam-2.3.4 → tsam-2.3.6}/examples/results/testperiods_predefClusterOrderAndClusterCenters.csv +193 -193
  12. {tsam-2.3.4 → tsam-2.3.6}/examples/results/testperiods_segmentation.csv +241 -241
  13. {tsam-2.3.4 → tsam-2.3.6}/examples/testdata.csv +8761 -8761
  14. tsam-2.3.6/pyproject.toml +53 -0
  15. {tsam-2.3.4 → tsam-2.3.6}/requirements.txt +6 -6
  16. {tsam-2.3.4 → tsam-2.3.6}/requirements.yml +6 -8
  17. {tsam-2.3.4 → tsam-2.3.6}/requirements_dev.txt +11 -12
  18. {tsam-2.3.4 → tsam-2.3.6}/setup.cfg +4 -4
  19. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/hyperparametertuning.py +245 -245
  20. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/periodAggregation.py +141 -141
  21. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/representations.py +167 -167
  22. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/timeseriesaggregation.py +1358 -1358
  23. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/utils/durationRepresentation.py +220 -204
  24. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/utils/k_maxoids.py +145 -145
  25. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/utils/k_medoids_contiguity.py +140 -140
  26. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/utils/k_medoids_exact.py +239 -239
  27. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/utils/segmentation.py +118 -118
  28. tsam-2.3.4/README.md → tsam-2.3.6/src/tsam.egg-info/PKG-INFO +225 -145
  29. tsam-2.3.6/src/tsam.egg-info/SOURCES.txt +54 -0
  30. {tsam-2.3.4 → tsam-2.3.6/src}/tsam.egg-info/requires.txt +9 -0
  31. {tsam-2.3.4 → tsam-2.3.6}/test/test_accuracyIndicators.py +63 -63
  32. {tsam-2.3.4 → tsam-2.3.6}/test/test_adjacent_periods.py +42 -42
  33. {tsam-2.3.4 → tsam-2.3.6}/test/test_aggregate_hiearchical.py +402 -402
  34. {tsam-2.3.4 → tsam-2.3.6}/test/test_assert_raises.py +234 -234
  35. {tsam-2.3.4 → tsam-2.3.6}/test/test_averaging.py +57 -57
  36. {tsam-2.3.4 → tsam-2.3.6}/test/test_cluster_order.py +132 -132
  37. {tsam-2.3.4 → tsam-2.3.6}/test/test_durationCurve.py +63 -63
  38. {tsam-2.3.4 → tsam-2.3.6}/test/test_durationRepresentation.py +148 -162
  39. {tsam-2.3.4 → tsam-2.3.6}/test/test_extremePeriods.py +93 -93
  40. {tsam-2.3.4 → tsam-2.3.6}/test/test_hierarchical.py +78 -78
  41. {tsam-2.3.4 → tsam-2.3.6}/test/test_hypertuneAggregation.py +170 -170
  42. {tsam-2.3.4 → tsam-2.3.6}/test/test_k_maxoids.py +59 -57
  43. {tsam-2.3.4 → tsam-2.3.6}/test/test_k_medoids.py +53 -53
  44. {tsam-2.3.4 → tsam-2.3.6}/test/test_k_medoids_contiguity.py +83 -83
  45. {tsam-2.3.4 → tsam-2.3.6}/test/test_minmaxRepresentation.py +70 -70
  46. {tsam-2.3.4 → tsam-2.3.6}/test/test_preprocess.py +43 -43
  47. {tsam-2.3.4 → tsam-2.3.6}/test/test_properties.py +208 -190
  48. {tsam-2.3.4 → tsam-2.3.6}/test/test_samemean.py +49 -81
  49. {tsam-2.3.4 → tsam-2.3.6}/test/test_segmentation.py +109 -109
  50. {tsam-2.3.4 → tsam-2.3.6}/test/test_subhourlyResolution.py +54 -54
  51. {tsam-2.3.4 → tsam-2.3.6}/test/test_subhourly_periods.py +41 -41
  52. {tsam-2.3.4 → tsam-2.3.6}/test/test_weightingFactors.py +70 -70
  53. tsam-2.3.4/.github/workflows/daily_tests.yml +0 -48
  54. tsam-2.3.4/.github/workflows/test_on_push_and_pull.yml +0 -71
  55. tsam-2.3.4/.gitignore +0 -17
  56. tsam-2.3.4/.gitlab-ci.yml +0 -11
  57. tsam-2.3.4/.readthedocs.yml +0 -15
  58. tsam-2.3.4/Makefile +0 -27
  59. tsam-2.3.4/docs/Makefile +0 -25
  60. tsam-2.3.4/docs/make.bat +0 -36
  61. tsam-2.3.4/docs/source/_static/logo.png +0 -0
  62. tsam-2.3.4/docs/source/_static/tsam-logo.png +0 -0
  63. tsam-2.3.4/docs/source/conf.py +0 -197
  64. tsam-2.3.4/docs/source/durationRepresentationDoc.rst +0 -15
  65. tsam-2.3.4/docs/source/exactKmedoidsDoc.rst +0 -15
  66. tsam-2.3.4/docs/source/furtherReadingDoc.rst +0 -28
  67. tsam-2.3.4/docs/source/gettingStartedDoc.rst +0 -85
  68. tsam-2.3.4/docs/source/hypertunedaggregationDoc.rst +0 -20
  69. tsam-2.3.4/docs/source/index.rst +0 -44
  70. tsam-2.3.4/docs/source/installationDoc.rst +0 -38
  71. tsam-2.3.4/docs/source/integratedSoftwareDoc.rst +0 -20
  72. tsam-2.3.4/docs/source/kmaxoidsDoc.rst +0 -15
  73. tsam-2.3.4/docs/source/legalNoticeDoc.rst +0 -39
  74. tsam-2.3.4/docs/source/mathematicalBackgroundDoc.rst +0 -67
  75. tsam-2.3.4/docs/source/newsDoc.rst +0 -55
  76. tsam-2.3.4/docs/source/periodAggregationDoc.rst +0 -15
  77. tsam-2.3.4/docs/source/representationsDoc.rst +0 -15
  78. tsam-2.3.4/docs/source/segmentationDoc.rst +0 -15
  79. tsam-2.3.4/docs/source/structureOfTsamDoc.rst +0 -30
  80. tsam-2.3.4/docs/source/timeseriesaggregationDoc.rst +0 -21
  81. tsam-2.3.4/examples/aggregation_example.ipynb +0 -790
  82. tsam-2.3.4/examples/aggregation_method_showcase.ipynb +0 -281
  83. tsam-2.3.4/examples/aggregation_optiinput.ipynb +0 -480
  84. tsam-2.3.4/examples/aggregation_representation.ipynb +0 -1211
  85. tsam-2.3.4/examples/aggregation_segment_period_animation.ipynb +0 -868
  86. tsam-2.3.4/examples/aggregation_segment_period_building_timeseries.ipynb +0 -329
  87. tsam-2.3.4/examples/aggregation_segment_period_opti.ipynb +0 -249
  88. tsam-2.3.4/examples/aggregation_segmentation.ipynb +0 -1883
  89. tsam-2.3.4/examples/example_k_maxoids.ipynb +0 -674
  90. tsam-2.3.4/examples/get_clustercenter_indices.py +0 -24
  91. tsam-2.3.4/examples/predefined_sequence_example.ipynb +0 -1117
  92. tsam-2.3.4/requirements_dev.yml +0 -11
  93. tsam-2.3.4/setup.py +0 -37
  94. tsam-2.3.4/tsam.egg-info/SOURCES.txt +0 -94
  95. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/__init__.py +0 -0
  96. {tsam-2.3.4 → tsam-2.3.6/src}/tsam/utils/__init__.py +0 -0
  97. {tsam-2.3.4 → tsam-2.3.6/src}/tsam.egg-info/dependency_links.txt +0 -0
  98. {tsam-2.3.4 → tsam-2.3.6/src}/tsam.egg-info/top_level.txt +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- 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)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ 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)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
@@ -1,3 +1,3 @@
1
- include examples/testdata.csv
2
- include examples/results/*.csv
3
- include requirements.yml
1
+ include examples/testdata.csv
2
+ include examples/results/*.csv
3
+ include requirements.yml
@@ -1,168 +1,225 @@
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
-
24
- [![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)
25
- [![badge](https://img.shields.io/badge/launch-binder-579aca.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1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CW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/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)
26
-
27
- <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>
28
-
29
- # tsam - Time Series Aggregation Module
30
- 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.
31
- 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.
32
-
33
- The documentation of the tsam code can be found [**here**](https://tsam.readthedocs.io/en/latest/index.html).
34
-
35
- ## Features
36
- * flexible handling of multidimensional time-series via the pandas module
37
- * 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
38
- * hypertuning of aggregation parameters to find the optimal combination of the number of segments inside a period and the number of typical periods
39
- * novel representation methods, keeping statistical attributes, such as the distribution
40
- * flexible integration of extreme periods as own cluster centers
41
- * weighting for the case of multidimensional time-series to represent their relevance
42
-
43
-
44
- ## Installation
45
- Directly install via pip from pypi as follows:
46
-
47
- pip install tsam
48
-
49
- of install from conda forge with the following command:
50
-
51
- conda install tsam -c conda-forge
52
-
53
- Alternatively, clone a local copy of the repository to your computer
54
-
55
- git clone https://github.com/FZJ-IEK3-VSA/tsam.git
56
-
57
- Then install tsam via pip as follow
58
-
59
- cd tsam
60
- pip install .
61
-
62
- Or install directly via python as
63
-
64
- python setup.py install
65
-
66
- 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.
67
-
68
- ### Developer installation
69
-
70
- In order to setup a virtual environment in Linux, correct the python name in the Makefile and call
71
-
72
- make setup_venv
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 contains the minimum and maximum value of the original time series
92
- ```python
93
- aggregation = tsam.TimeSeriesAggregation(raw,
94
- noTypicalPeriods = 8,
95
- hoursPerPeriod = 24,
96
- segmentation = True,
97
- noSegments = 8,
98
- representationMethod = "distributionAndMinMaxRepresentation",
99
- distributionPeriodWise = False
100
- clusterMethod = 'hierarchical'
101
- )
102
- ```
103
-
104
- Run the aggregation to typical periods
105
- ```python
106
- typPeriods = aggregation.createTypicalPeriods()
107
- ```
108
-
109
- Store the results as .csv file
110
-
111
- ```python
112
- typPeriods.to_csv('typperiods.csv')
113
- ```
114
-
115
- ### Detailed examples
116
-
117
- A [**first example**](/examples/aggregation_example.ipynb) shows the capabilites of tsam as jupyter notebook.
118
-
119
- 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.
120
-
121
- 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).
122
-
123
- ## License
124
-
125
- MIT License
126
-
127
- 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)
128
-
129
- You should have received a copy of the MIT License along with this program.
130
- If not, see https://opensource.org/licenses/MIT
131
-
132
- 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/).
133
-
134
- ## Citing and further reading
135
-
136
- If you want to use tsam in a published work, **please kindly cite** our latest journal articles:
137
- * Hoffmann et al. (2022):\
138
- [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261922004342)
139
-
140
-
141
- 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).
142
-
143
- The publications about time series aggregation for energy system optimization models published alongside the development of tsam are listed below:
144
- * Hoffmann et al. (2021):\
145
- [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261922004342)\
146
- (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
147
- * Hoffmann et al. (2021):\
148
- [**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)
149
- * Hoffmann et al. (2020):\
150
- [**A Review on Time Series Aggregation Methods for Energy System Models**](https://www.mdpi.com/1996-1073/13/3/641)
151
- * Kannengießer et al. (2019):\
152
- [**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)
153
- * Kotzur et al. (2018):\
154
- [**Time series aggregation for energy system design: Modeling seasonal storage**](https://www.sciencedirect.com/science/article/pii/S0306261918300242)\
155
- (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
156
- * Kotzur et al. (2018):\
157
- [**Impact of different time series aggregation methods on optimal energy system design**](https://www.sciencedirect.com/science/article/abs/pii/S0960148117309783)\
158
- (open access manuscript to be found [**here**](https://arxiv.org/abs/1708.00420))
159
-
160
-
161
-
162
- ## Acknowledgement
163
-
164
- 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/).
165
-
166
- <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>
167
-
168
-
1
+ Metadata-Version: 2.1
2
+ Name: tsam
3
+ Version: 2.3.6
4
+ Summary: Time series aggregation module (tsam) to create typical periods
5
+ Author-email: Leander Kotzur <leander.kotzur@googlemail.com>, Maximilian Hoffmann <maximilian.hoffmann@julumni.fz-juelich.de>
6
+ Maintainer-email: Julian Belina <j.belina@fz-juelich.de>
7
+ License: MIT License
8
+
9
+ 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)
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+ Keywords: clustering,optimization
29
+ Classifier: Development Status :: 4 - Beta
30
+ Classifier: Intended Audience :: End Users/Desktop
31
+ Classifier: Intended Audience :: Science/Research
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Natural Language :: English
34
+ Classifier: Operating System :: OS Independent
35
+ Classifier: Programming Language :: Python
36
+ Classifier: Programming Language :: Python :: 2
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
39
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
40
+ Requires-Python: <3.13,>=3.9
41
+ Description-Content-Type: text/markdown
42
+ License-File: LICENSE.txt
43
+ Requires-Dist: scikit-learn>=0.0
44
+ Requires-Dist: pandas>=2.0.3
45
+ Requires-Dist: numpy>=1.20.0
46
+ Requires-Dist: pyomo>=6.4.3
47
+ Requires-Dist: networkx
48
+ Requires-Dist: tqdm
49
+ Requires-Dist: highspy
50
+ Provides-Extra: dev
51
+ Requires-Dist: pytest; extra == "dev"
52
+ Requires-Dist: pytest-cov; extra == "dev"
53
+ Requires-Dist: codecov; extra == "dev"
54
+ Requires-Dist: sphinx; extra == "dev"
55
+ Requires-Dist: sphinx-autobuild; extra == "dev"
56
+ Requires-Dist: sphinx_book_theme; extra == "dev"
57
+ Requires-Dist: twine; extra == "dev"
58
+
59
+ [![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)
60
+ [![badge](https://img.shields.io/badge/launch-binder-579aca.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0n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SA/voila-tsam/HEAD?urlpath=voila/render/Time-Series-Aggregation-Module.ipynb)
61
+
62
+ <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>
63
+
64
+ # tsam - Time Series Aggregation Module
65
+ 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.
66
+ 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.
67
+
68
+ The documentation of the tsam code can be found [**here**](https://tsam.readthedocs.io/en/latest/index.html).
69
+
70
+ ## Features
71
+ * flexible handling of multidimensional time-series via the pandas module
72
+ * 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
73
+ * hypertuning of aggregation parameters to find the optimal combination of the number of segments inside a period and the number of typical periods
74
+ * novel representation methods, keeping statistical attributes, such as the distribution
75
+ * flexible integration of extreme periods as own cluster centers
76
+ * weighting for the case of multidimensional time-series to represent their relevance
77
+
78
+
79
+ ## Installation
80
+ 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](https://realpython.com/python-virtual-environments-a-primer/). In the following we assume you have a [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) or [conda](https://www.anaconda.com/) installation. All conda and mamba command are interchangeable.
81
+
82
+ ### Direct Installations from Package Manager Repositories
83
+
84
+ If you want to prevent any possible dependency conflicts create a new environment using the following command:
85
+
86
+ mamba create -n tsam_env python pip
87
+
88
+ Activate an existing or the newly create environment afterward
89
+
90
+ mamba activate tsam_env
91
+
92
+ Directly install via pip from pypi as follows:
93
+
94
+ pip install tsam
95
+
96
+ or install from conda forge with the following command:
97
+
98
+ conda install tsam -c conda-forge
99
+
100
+ ### Local Installation for Development
101
+ Alternatively, clone a local copy of the repository to your computer
102
+
103
+ git clone https://github.com/FZJ-IEK3-VSA/tsam.git
104
+
105
+ Change the directory of your shell into the root folder of the repository
106
+
107
+ cd tsam
108
+
109
+ For development, it is recommended to install tsam into its own environment using conda e.g.
110
+
111
+ conda env create --file=requirement.yml
112
+
113
+ Afterward activate the environment
114
+
115
+ conda activate tsam_env
116
+
117
+ Then install tsam via pip as follows
118
+
119
+
120
+ pip install -e .[dev]
121
+
122
+ ### Installation of MILP Solver for k-medoids
123
+ 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 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.
124
+
125
+ ### Developer installation
126
+
127
+ In order to setup a virtual environment in Linux, correct the python name in the Makefile and call
128
+
129
+ make setup_venv
130
+
131
+
132
+ ## Examples
133
+
134
+ ### Basic workflow
135
+
136
+ A small example how tsam can be used is decribed as follows
137
+ ```python
138
+ import pandas as pd
139
+ import tsam.timeseriesaggregation as tsam
140
+ ```
141
+
142
+
143
+ Read in the time series data set with pandas
144
+ ```python
145
+ raw = pd.read_csv('testdata.csv', index_col = 0)
146
+ ```
147
+
148
+ 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
149
+ ```python
150
+ aggregation = tsam.TimeSeriesAggregation(raw,
151
+ noTypicalPeriods = 8,
152
+ hoursPerPeriod = 24,
153
+ segmentation = True,
154
+ noSegments = 8,
155
+ representationMethod = "distributionAndMinMaxRepresentation",
156
+ distributionPeriodWise = False
157
+ clusterMethod = 'hierarchical'
158
+ )
159
+ ```
160
+
161
+ Run the aggregation to typical periods
162
+ ```python
163
+ typPeriods = aggregation.createTypicalPeriods()
164
+ ```
165
+
166
+ Store the results as .csv file
167
+
168
+ ```python
169
+ typPeriods.to_csv('typperiods.csv')
170
+ ```
171
+
172
+ ### Detailed examples
173
+
174
+ A [**first example**](/examples/aggregation_example.ipynb) shows the capabilites of tsam as jupyter notebook.
175
+
176
+ 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.
177
+
178
+ 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).
179
+
180
+ ## License
181
+
182
+ MIT License
183
+
184
+ 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)
185
+
186
+ You should have received a copy of the MIT License along with this program.
187
+ If not, see https://opensource.org/licenses/MIT
188
+
189
+ 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/).
190
+
191
+ ## Citing and further reading
192
+
193
+ If you want to use tsam in a published work, **please kindly cite** our latest journal articles:
194
+ * Hoffmann et al. (2022):\
195
+ [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261922004342)
196
+
197
+
198
+ 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).
199
+
200
+ The publications about time series aggregation for energy system optimization models published alongside the development of tsam are listed below:
201
+ * Hoffmann et al. (2021):\
202
+ [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261922004342)\
203
+ (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
204
+ * Hoffmann et al. (2021):\
205
+ [**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)
206
+ * Hoffmann et al. (2020):\
207
+ [**A Review on Time Series Aggregation Methods for Energy System Models**](https://www.mdpi.com/1996-1073/13/3/641)
208
+ * Kannengießer et al. (2019):\
209
+ [**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)
210
+ * Kotzur et al. (2018):\
211
+ [**Time series aggregation for energy system design: Modeling seasonal storage**](https://www.sciencedirect.com/science/article/pii/S0306261918300242)\
212
+ (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
213
+ * Kotzur et al. (2018):\
214
+ [**Impact of different time series aggregation methods on optimal energy system design**](https://www.sciencedirect.com/science/article/abs/pii/S0960148117309783)\
215
+ (open access manuscript to be found [**here**](https://arxiv.org/abs/1708.00420))
216
+
217
+
218
+
219
+ ## Acknowledgement
220
+
221
+ 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/).
222
+
223
+ <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>
224
+
225
+