-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.py
107 lines (86 loc) · 2.85 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
import setuptools
import os
import platform
def get_all_files():
data_files = []
dir_path = os.path.dirname(os.path.realpath(__file__))
op_sys = platform.system().lower()
# Energyplus & Modelica files
Epath_rel = os.path.join("simulation", "energyplus")
Epath_abs = os.path.join(dir_path, Epath_rel)
Mpath_rel = os.path.join("simulation", "modelica")
Mpath_abs = os.path.join(dir_path, Mpath_rel)
# schedules files
schedules_rel = os.path.join("energym", "schedules", "ScheduleFiles")
schedules_abs = os.path.join(dir_path, schedules_rel)
Edirs = [
p for p in os.listdir(Epath_abs) if os.path.isdir(os.path.join(Epath_abs, p))
]
Mdirs = [
p for p in os.listdir(Mpath_abs) if os.path.isdir(os.path.join(Mpath_abs, p))
]
# fmus
listdirs_rel_fmus = [os.path.join(Epath_rel, p, "fmus", op_sys) for p in Edirs] + [
os.path.join(Mpath_rel, p, "fmus", op_sys) for p in Mdirs
]
listdirs_abs_fmus = [os.path.join(Epath_abs, p, "fmus", op_sys) for p in Edirs] + [
os.path.join(Mpath_abs, p, "fmus", op_sys) for p in Mdirs
]
# weather files
listdirs_rel_wea = [os.path.join(Epath_rel, p, "wf") for p in Edirs] + [
os.path.join(Mpath_rel, p, "wf") for p in Mdirs
]
listdirs_abs_wea = [os.path.join(Epath_abs, p, "wf") for p in Edirs] + [
os.path.join(Mpath_abs, p, "wf") for p in Mdirs
]
for i, d in enumerate(listdirs_abs_fmus):
files = [
os.path.join(listdirs_rel_fmus[i], f)
for f in os.listdir(d)
if f.endswith(".fmu")
]
data_files += [(listdirs_rel_fmus[i], files)]
for i, d in enumerate(listdirs_abs_wea):
files = [
os.path.join(listdirs_rel_wea[i], f)
for f in os.listdir(d)
if f.endswith(".epw") or f.endswith(".mos")
]
data_files += [(listdirs_rel_wea[i], files)]
data_files += [
(
schedules_rel,
[
os.path.join(schedules_rel, f)
for f in os.listdir(schedules_abs)
if f.endswith(".csv")
],
)
]
return data_files
data_files = get_all_files()
setuptools.setup(
name="energym",
version="0.1",
author="CSEM",
author_email="[email protected]",
description="A benchmark for controllers of energy systems",
# long_description=long_description,
# long_description_content_type="text/markdown",
url="",
packages=setuptools.find_packages(),
install_requires=[
"pandas>=0.24",
"FMPy>=0.2.14",
"scipy>=1.2.3",
"numpy>=1.16",
"matplotlib>=2.2.5",
"six>=1.13.0",
],
data_files=data_files,
classifiers=[
"Programming Language :: Python :: 3",
"License :: None",
"Operating System :: Windows :: Linux",
],
)