-
Notifications
You must be signed in to change notification settings - Fork 34
/
setup.py
200 lines (188 loc) · 7.71 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#################################################################################
# DISPATCHES was produced under the DOE Design Integration and Synthesis Platform
# to Advance Tightly Coupled Hybrid Energy Systems program (DISPATCHES), and is
# copyright (c) 2020-2023 by the software owners: The Regents of the University
# of California, through Lawrence Berkeley National Laboratory, National
# Technology & Engineering Solutions of Sandia, LLC, Alliance for Sustainable
# Energy, LLC, Battelle Energy Alliance, LLC, University of Notre Dame du Lac, et
# al. All rights reserved.
#
# Please see the files COPYRIGHT.md and LICENSE.md for full copyright and license
# information, respectively. Both files are also available online at the URL:
# "https://github.com/gmlc-dispatches/dispatches".
#################################################################################
"""
Project setup with setuptools
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import pathlib
import re
# this will come in handy, probably
cwd = pathlib.Path(__file__).parent.resolve()
# Parse long description from README.md file
with open("README.md") as f:
lines, capture = [], False
for line in f:
s = line.strip()
if re.match(r"#\s*[Aa]bout", s):
capture = True
elif re.match("^#", s):
break
elif capture is True:
lines.append(s)
if lines:
long_description = " ".join(lines)
else:
long_description = "DISPATCHES project"
def read_requirements(input_file):
"""Build list of requirements from a requirements.txt file
"""
req = []
for line in input_file:
s = line.strip()
c = s.find("#") # look for comment
if c != 0: # no comment (-1) or comment after start (> 0)
if c > 0: # strip trailing comment
s = s[:c]
req.append(s)
return req
class SpecialDependencies:
"""
The following packages require special treatment, as they change rapidly between release cycles.
Two separate lists of dependencies are kept:
- for_release: to be used when cutting a release of DISPATCHES
- for_prerelease: to be used for the prerelease version of DISPATCHES (i.e. the `main` branch, and all PRs targeting it)
"""
# idaes-pse: for IDAES DMF -dang 12/2020
for_release = [
# NOTE: this will fail until this idaes-pse version is available on PyPI
"idaes-pse==2.0.*",
"pyomo==6.5.*",
]
for_prerelease = [
"idaes-pse==2.0.*",
"pyomo==6.5.*",
]
SPECIAL_DEPENDENCIES = SpecialDependencies.for_prerelease
########################################################################################
setup(
name="dispatches",
url="https://github.com/gmlc-dispatches/dispatches",
version="1.3.dev0",
description="GMLC DISPATCHES software tools",
long_description=long_description,
long_description_content_type="text/plain",
author="DISPATCHES team",
# Classifiers help users find your project by categorizing it.
#
# For a list of valid classifiers, see https://pypi.org/classifiers/
classifiers=[
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 3 - Alpha",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 3 :: Only",
],
keywords="market simulation, chemical engineering, process modeling, hybrid power systems",
packages=find_packages(),
python_requires=">=3.8, <4",
install_requires=[
"pytest",
# we use jupyter notebooks
"jupyter",
# for visualizing DMF provenance
"graphviz",
"gridx-prescient>=2.2.2",
"nrel-pysam",
"utm",
"dispatches-data-packages >= 23.3.19",
"dispatches-rts-gmlc-data",
*SPECIAL_DEPENDENCIES
],
extras_require={
"teal": [
"raven-framework == 2.3 ; python_version <= '3.9' and platform_system != 'Linux'",
"teal-ravenframework == 0.4 ; python_version <= '3.9' and platform_system != 'Linux'",
"dispatches-synthetic-price-data >= 23.4.4",
],
"surrogates": [
"tslearn >= 0.5.2", # not needed for steady-state surrogates
"scikit-learn == 1.2.1", # used by RE steady-state surrogate (static_clustering_wind_pmax.pkl)
"tensorflow == 2.10.0", # to match Tensorflow version used to train RE steady-state surrogates Keras models
"tables >= 3.6.1",
"matplotlib",
"dispatches-dynamic-sweep-data >= 23.4.4",
],
},
package_data={
"": ["*.json"],
"dispatches.tests.data.prescient_5bus": ["*.csv"],
"dispatches.case_studies.renewables_case.tests": [
"rts_results_all_prices.npy",
],
"dispatches.case_studies.renewables_case.data": [
"Wind_Thermal_Dispatch.csv",
"309_WIND_1-SimulationOutputs.csv",
"44.21_-101.94_windtoolkit_2012_60min_80m.srw"
],
"dispatches.case_studies.renewables_case.data.steady_state_surrogate.dispatch_frequency":[
"ss_surrogate_param_wind_pmax.json",
"static_clustering_wind_pmax.pkl"
],
"dispatches.case_studies.renewables_case.data.steady_state_surrogate.dispatch_frequency.ss_surrogate_model_wind_pmax":[
"keras_metadata.pb",
"saved_model.pb"
],
"dispatches.case_studies.renewables_case.data.steady_state_surrogate.dispatch_frequency.ss_surrogate_model_wind_pmax.variables":[
"variables.data-00000-of-00001",
"variables.index"
],
"dispatches.case_studies.renewables_case.data.steady_state_surrogate.revenue":[
"RE_revenue_params_2_25.json"
],
"dispatches.case_studies.renewables_case.data.steady_state_surrogate.revenue.RE_revenue_2_25":[
"keras_metadata.pb",
"saved_model.pb"
],
"dispatches.case_studies.renewables_case.data.steady_state_surrogate.revenue.RE_revenue_2_25.variables":[
"variables.data-00000-of-00001",
"variables.index"
],
"dispatches.case_studies.renewables_case.data.steady_state_surrogate.rt_revenue":[
"RE_RT_revenue_params_2_25.json"
],
"dispatches.case_studies.renewables_case.data.steady_state_surrogate.rt_revenue.RT_RE_revenue_2_25":[
"keras_metadata.pb",
"saved_model.pb"
],
"dispatches.case_studies.renewables_case.data.steady_state_surrogate.rt_revenue.RT_RE_revenue_2_25.variables":[
"variables.data-00000-of-00001",
"variables.index"
],
"dispatches.case_studies.fossil_case.ultra_supercritical_plant": [
"pfd_ultra_supercritical_pc.svg",
],
"dispatches.workflow.train_market_surrogates.dynamic.tests.data":[
"inputdatatest.h5",
"revdatatest.csv",
"simdatatest.csv",
"sample_clustering_model.json"
],
},
)