NREL-reV 0.12.1__py3-none-any.whl → 0.12.2__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.
- {nrel_rev-0.12.1.dist-info → nrel_rev-0.12.2.dist-info}/METADATA +4 -5
- {nrel_rev-0.12.1.dist-info → nrel_rev-0.12.2.dist-info}/RECORD +8 -9
- reV/bespoke/pack_turbs.py +15 -17
- reV/version.py +1 -1
- reV/bespoke/plotting_functions.py +0 -178
- {nrel_rev-0.12.1.dist-info → nrel_rev-0.12.2.dist-info}/WHEEL +0 -0
- {nrel_rev-0.12.1.dist-info → nrel_rev-0.12.2.dist-info}/entry_points.txt +0 -0
- {nrel_rev-0.12.1.dist-info → nrel_rev-0.12.2.dist-info}/licenses/LICENSE +0 -0
- {nrel_rev-0.12.1.dist-info → nrel_rev-0.12.2.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: NREL-reV
|
3
|
-
Version: 0.12.
|
3
|
+
Version: 0.12.2
|
4
4
|
Summary: National Renewable Energy Laboratory's (NREL's) Renewable Energy Potential(V) Model: reV
|
5
5
|
Author-email: Galen Maclaurin <galen.maclaurin@nrel.gov>
|
6
6
|
Maintainer-email: Grant Buster <gbuster@nrel.gov>, Paul Pinchuk <ppinchuk@nrel.gov>
|
@@ -18,10 +18,10 @@ Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Requires-Python: >=3.9
|
19
19
|
Description-Content-Type: text/x-rst
|
20
20
|
License-File: LICENSE
|
21
|
-
Requires-Dist: NREL-gaps<
|
21
|
+
Requires-Dist: NREL-gaps<0.8,>=0.7.0
|
22
22
|
Requires-Dist: NREL-NRWAL<1,>=0.0.7
|
23
23
|
Requires-Dist: NREL-PySAM<7,~=6.0.1
|
24
|
-
Requires-Dist: NREL-rex<
|
24
|
+
Requires-Dist: NREL-rex<0.3,>=0.2.99
|
25
25
|
Requires-Dist: numpy~=1.24.4
|
26
26
|
Requires-Dist: packaging<25,>=20.3
|
27
27
|
Requires-Dist: plotly<6,>=4.7.1
|
@@ -30,14 +30,13 @@ Requires-Dist: shapely<2
|
|
30
30
|
Provides-Extra: test
|
31
31
|
Requires-Dist: pytest<9,>=8.3.3; extra == "test"
|
32
32
|
Provides-Extra: dev
|
33
|
-
Requires-Dist: pytest<9,>=8.3.3; extra == "dev"
|
34
33
|
Requires-Dist: flake8; extra == "dev"
|
35
34
|
Requires-Dist: pre-commit; extra == "dev"
|
36
35
|
Requires-Dist: pylint; extra == "dev"
|
37
36
|
Provides-Extra: hsds
|
38
37
|
Requires-Dist: hsds<1,>=0.8.4; extra == "hsds"
|
39
38
|
Provides-Extra: build
|
40
|
-
Requires-Dist: build<1
|
39
|
+
Requires-Dist: build<2,>=1.2.2; extra == "build"
|
41
40
|
Requires-Dist: pkginfo<2,>=1.10.0; extra == "build"
|
42
41
|
Requires-Dist: twine<7,>=6.1.0; extra == "build"
|
43
42
|
Dynamic: license-file
|
@@ -1,7 +1,7 @@
|
|
1
|
-
nrel_rev-0.12.
|
1
|
+
nrel_rev-0.12.2.dist-info/licenses/LICENSE,sha256=hDwoTANtan2ZpufBlXm5C3W_PJ-mCqItvlcobgjxL7k,1526
|
2
2
|
reV/__init__.py,sha256=tXTpWu_qVo3uotfSw_TJ-gNbidGaIPPfUTwBlpCMJ-g,856
|
3
3
|
reV/cli.py,sha256=jfGGOr6QlLz8ghA7vBgx5-VgNsy4bBQo5DdHk42-q9A,1601
|
4
|
-
reV/version.py,sha256=
|
4
|
+
reV/version.py,sha256=zfErvyRqxhvVqUlNnaIzFqGx8VY8fEvhVf5NB_ieQNI,51
|
5
5
|
reV/SAM/SAM.py,sha256=3NK9rRaJzqH6wz7CU_5XguKCRhmoilOpDdFFsFgOaxQ,33163
|
6
6
|
reV/SAM/__init__.py,sha256=LJqoncyKDY5ZP5WA4kboh561bce11F9Ge645Izah0EY,240
|
7
7
|
reV/SAM/defaults.py,sha256=JQMJomX7wsbMzxKjx_IMnA_9QFsV2yWCyl_JToDVSJo,6703
|
@@ -19,9 +19,8 @@ reV/bespoke/__init__.py,sha256=vpXbyBUrUsTgK8UP_LafMjLiDg2CRG9WZLHPsOJoxek,109
|
|
19
19
|
reV/bespoke/bespoke.py,sha256=uWuYkWYiI5N50AM4yoAoLwd5CT4CE3sgBJjL_PROnmM,112503
|
20
20
|
reV/bespoke/cli_bespoke.py,sha256=b6Xu0GKpXqPX3qVJ6-z0FrO97uCsH_1dVOa4r6IvesQ,2911
|
21
21
|
reV/bespoke/gradient_free.py,sha256=URWV1yiO2jyWk3_GOpfpLV_wlgJhXXGmTUwCB3WTV0Y,12015
|
22
|
-
reV/bespoke/pack_turbs.py,sha256=
|
22
|
+
reV/bespoke/pack_turbs.py,sha256=Dcd9F8obF8LPztzeycB5kxa5hXKSCiz3jC1WeAFUx28,3508
|
23
23
|
reV/bespoke/place_turbines.py,sha256=3l8EUfXd2aeTGjHP8OlllgmaCW_I9gKJIQ9EGlWni_Y,25412
|
24
|
-
reV/bespoke/plotting_functions.py,sha256=VDJlA-fyN1O_ZA32P6EGEO7w4Ld5HnsENMx7wcayISo,5619
|
25
24
|
reV/config/__init__.py,sha256=oqFNU4JESU_fPxFmPyQNFAXLDAdzmTlPuabXTe3Rf2Y,92
|
26
25
|
reV/config/base_analysis_config.py,sha256=NvA3g5zQz8mIrV8ZSENLq0XBZGXa6RTGkwpZ76TVZj8,5615
|
27
26
|
reV/config/base_config.py,sha256=a748VQ3CRs9RVi5sSEPcaWOyH6R3t5tssaFqZntHyaE,10075
|
@@ -92,8 +91,8 @@ reV/utilities/curtailment.py,sha256=As902-2aLGnCiVEutYfAFIOwuV--_rCQhxGNOY9RB-4,
|
|
92
91
|
reV/utilities/exceptions.py,sha256=f7sRGsbFLpmL6Caq_H1cD4GfVhnLMyvYUsLPA1UVDDE,3974
|
93
92
|
reV/utilities/pytest_utils.py,sha256=T22NFEGxPOc9wRwgy0Pt2cHvw3Vam9cKwUj4AkzI7bU,3244
|
94
93
|
reV/utilities/slots.py,sha256=xsw-JuUVZ0YeoCNuwP_HxGNxFMA4xRs1tuImXHIJqaU,2618
|
95
|
-
nrel_rev-0.12.
|
96
|
-
nrel_rev-0.12.
|
97
|
-
nrel_rev-0.12.
|
98
|
-
nrel_rev-0.12.
|
99
|
-
nrel_rev-0.12.
|
94
|
+
nrel_rev-0.12.2.dist-info/METADATA,sha256=1x4NB6NRj-AhydnW05KvJ4NHKGABHxzJStt_Fji8Bh8,10911
|
95
|
+
nrel_rev-0.12.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
96
|
+
nrel_rev-0.12.2.dist-info/entry_points.txt,sha256=4IfJtZm2iMJwrbC8J0Or7VjZWnFpvCaHYVpvSWfIwDA,616
|
97
|
+
nrel_rev-0.12.2.dist-info/top_level.txt,sha256=S6YF2ZYgXUB6n28SY0K2H8YB9tMJdXQ9CyQbo6VC89M,4
|
98
|
+
nrel_rev-0.12.2.dist-info/RECORD,,
|
reV/bespoke/pack_turbs.py
CHANGED
@@ -4,10 +4,10 @@ turbine packing module.
|
|
4
4
|
"""
|
5
5
|
import numpy as np
|
6
6
|
from shapely.geometry import Polygon, MultiPolygon, Point
|
7
|
-
from reV.bespoke.plotting_functions import get_xy
|
8
7
|
from reV.utilities.exceptions import WhileLoopPackingError
|
9
8
|
|
10
9
|
|
10
|
+
|
11
11
|
class PackTurbines():
|
12
12
|
"""Framework to maximize plant capacity in a provided wind plant area.
|
13
13
|
"""
|
@@ -81,24 +81,22 @@ class PackTurbines():
|
|
81
81
|
self.turbine_y = np.array([])
|
82
82
|
|
83
83
|
|
84
|
-
def
|
85
|
-
"""
|
86
|
-
|
87
|
-
This function helps break ties in the area of two different
|
88
|
-
geometries using their exterior coordinate values.
|
84
|
+
def get_xy(A):
|
85
|
+
"""separate polygon exterior coordinates to x and y
|
89
86
|
|
90
87
|
Parameters
|
91
88
|
----------
|
92
|
-
|
93
|
-
|
94
|
-
`exterior.coords` coords attribute.
|
89
|
+
A : Polygon.exteroir.coords
|
90
|
+
Exterior coordinates from a shapely Polygon
|
95
91
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
- area of the geometry
|
101
|
-
- minimum exterior coordinate (southwest)
|
102
|
-
- maximum exterior coordinate (northeast)
|
92
|
+
Outputs
|
93
|
+
----------
|
94
|
+
x, y : array
|
95
|
+
Boundary polygon x and y coordinates
|
103
96
|
"""
|
104
|
-
|
97
|
+
x = np.zeros(len(A))
|
98
|
+
y = np.zeros(len(A))
|
99
|
+
for i, _ in enumerate(A):
|
100
|
+
x[i] = A[i][0]
|
101
|
+
y[i] = A[i][1]
|
102
|
+
return x, y
|
reV/version.py
CHANGED
@@ -1,178 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
"""
|
3
|
-
functions to plot turbine layouts and boundary polygons
|
4
|
-
"""
|
5
|
-
import numpy as np
|
6
|
-
import matplotlib.pyplot as plt
|
7
|
-
|
8
|
-
|
9
|
-
def get_xy(A):
|
10
|
-
"""separate polygon exterior coordinates to x and y
|
11
|
-
|
12
|
-
Parameters
|
13
|
-
----------
|
14
|
-
A : Polygon.exteroir.coords
|
15
|
-
Exterior coordinates from a shapely Polygon
|
16
|
-
|
17
|
-
Outputs
|
18
|
-
----------
|
19
|
-
x, y : array
|
20
|
-
Boundary polygon x and y coordinates
|
21
|
-
"""
|
22
|
-
x = np.zeros(len(A))
|
23
|
-
y = np.zeros(len(A))
|
24
|
-
for i, _ in enumerate(A):
|
25
|
-
x[i] = A[i][0]
|
26
|
-
y[i] = A[i][1]
|
27
|
-
return x, y
|
28
|
-
|
29
|
-
|
30
|
-
def plot_poly(geom, ax=None, color="black", linestyle="--", linewidth=0.5):
|
31
|
-
"""plot the wind plant boundaries
|
32
|
-
|
33
|
-
Parameters
|
34
|
-
----------
|
35
|
-
geom : Polygon | MultiPolygon
|
36
|
-
The shapely.Polygon or shapely.MultiPolygon that define the wind
|
37
|
-
plant boundary(ies).
|
38
|
-
ax : :py:class:`matplotlib.pyplot.axes`, optional
|
39
|
-
The figure axes on which the wind rose is plotted.
|
40
|
-
Defaults to :obj:`None`.
|
41
|
-
color : string, optional
|
42
|
-
The color for the wind plant boundaries
|
43
|
-
linestyle : string, optional
|
44
|
-
Style to plot the boundary lines
|
45
|
-
linewidth : float, optional
|
46
|
-
The width of the boundary lines
|
47
|
-
"""
|
48
|
-
if ax is None:
|
49
|
-
_, ax = plt.subplots()
|
50
|
-
|
51
|
-
if geom.type == 'Polygon':
|
52
|
-
exterior_coords = geom.exterior.coords[:]
|
53
|
-
x, y = get_xy(exterior_coords)
|
54
|
-
ax.fill(x, y, color="C0", alpha=0.25)
|
55
|
-
ax.plot(x, y, color=color, linestyle=linestyle, linewidth=linewidth)
|
56
|
-
|
57
|
-
for interior in geom.interiors:
|
58
|
-
interior_coords = interior.coords[:]
|
59
|
-
x, y = get_xy(interior_coords)
|
60
|
-
ax.fill(x, y, color="white", alpha=1.0)
|
61
|
-
ax.plot(x, y, "--k", linewidth=0.5)
|
62
|
-
|
63
|
-
elif geom.type == 'MultiPolygon':
|
64
|
-
|
65
|
-
for part in geom:
|
66
|
-
exterior_coords = part.exterior.coords[:]
|
67
|
-
x, y = get_xy(exterior_coords)
|
68
|
-
ax.fill(x, y, color="C0", alpha=0.25)
|
69
|
-
ax.plot(x, y, color=color, linestyle=linestyle,
|
70
|
-
linewidth=linewidth)
|
71
|
-
|
72
|
-
for interior in part.interiors:
|
73
|
-
interior_coords = interior.coords[:]
|
74
|
-
x, y = get_xy(interior_coords)
|
75
|
-
ax.fill(x, y, color="white", alpha=1.0)
|
76
|
-
ax.plot(x, y, "--k", linewidth=0.5)
|
77
|
-
return ax
|
78
|
-
|
79
|
-
|
80
|
-
def plot_turbines(x, y, r, ax=None, color="C0", nums=False):
|
81
|
-
"""plot wind turbine locations
|
82
|
-
|
83
|
-
Parameters
|
84
|
-
----------
|
85
|
-
x, y : array
|
86
|
-
Wind turbine x and y locations
|
87
|
-
r : float
|
88
|
-
Wind turbine radius
|
89
|
-
ax :py:class:`matplotlib.pyplot.axes`, optional
|
90
|
-
The figure axes on which the wind rose is plotted.
|
91
|
-
Defaults to :obj:`None`.
|
92
|
-
color : string, optional
|
93
|
-
The color for the wind plant boundaries
|
94
|
-
nums : bool, optional
|
95
|
-
Option to show the turbine numbers next to each turbine
|
96
|
-
"""
|
97
|
-
# Set up figure
|
98
|
-
if ax is None:
|
99
|
-
_, ax = plt.subplots()
|
100
|
-
|
101
|
-
n = len(x)
|
102
|
-
for i in range(n):
|
103
|
-
t = plt.Circle((x[i], y[i]), r, color=color)
|
104
|
-
ax.add_patch(t)
|
105
|
-
if nums is True:
|
106
|
-
ax.text(x[i], y[i], "%s" % (i + 1))
|
107
|
-
|
108
|
-
return ax
|
109
|
-
|
110
|
-
|
111
|
-
def plot_windrose(wind_directions, wind_speeds, wind_frequencies, ax=None,
|
112
|
-
colors=None):
|
113
|
-
"""plot windrose
|
114
|
-
|
115
|
-
Parameters
|
116
|
-
----------
|
117
|
-
wind_directions : 1D array
|
118
|
-
Wind direction samples
|
119
|
-
wind_speeds : 1D array
|
120
|
-
Wind speed samples
|
121
|
-
wind_frequencies : 2D array
|
122
|
-
Frequency of wind direction and speed samples
|
123
|
-
ax :py:class:`matplotlib.pyplot.axes`, optional
|
124
|
-
The figure axes on which the wind rose is plotted.
|
125
|
-
Defaults to :obj:`None`.
|
126
|
-
color : array, optional
|
127
|
-
The color for the different wind speed bins
|
128
|
-
"""
|
129
|
-
if ax is None:
|
130
|
-
_, ax = plt.subplots(subplot_kw=dict(polar=True))
|
131
|
-
|
132
|
-
ndirs = len(wind_directions)
|
133
|
-
nspeeds = len(wind_speeds)
|
134
|
-
|
135
|
-
if colors is None:
|
136
|
-
colors = []
|
137
|
-
for i in range(nspeeds):
|
138
|
-
colors = np.append(colors, "C%s" % i)
|
139
|
-
|
140
|
-
for i in range(ndirs):
|
141
|
-
wind_directions[i] = np.deg2rad(90.0 - wind_directions[i])
|
142
|
-
|
143
|
-
width = 0.8 * 2 * np.pi / len(wind_directions)
|
144
|
-
|
145
|
-
for i in range(ndirs):
|
146
|
-
bottom = 0.0
|
147
|
-
for j in range(nspeeds):
|
148
|
-
if i == 0:
|
149
|
-
if j < nspeeds - 1:
|
150
|
-
ax.bar(wind_directions[i], wind_frequencies[j, i],
|
151
|
-
bottom=bottom, width=width, edgecolor="black",
|
152
|
-
color=[colors[j]],
|
153
|
-
label="%s-%s m/s" % (int(wind_speeds[j]),
|
154
|
-
int(wind_speeds[j + 1]))
|
155
|
-
)
|
156
|
-
else:
|
157
|
-
ax.bar(wind_directions[i], wind_frequencies[j, i],
|
158
|
-
bottom=bottom, width=width, edgecolor="black",
|
159
|
-
color=[colors[j]],
|
160
|
-
label="%s+ m/s" % int(wind_speeds[j])
|
161
|
-
)
|
162
|
-
else:
|
163
|
-
ax.bar(wind_directions[i], wind_frequencies[j, i],
|
164
|
-
bottom=bottom, width=width, edgecolor="black",
|
165
|
-
color=[colors[j]])
|
166
|
-
bottom = bottom + wind_frequencies[j, i]
|
167
|
-
|
168
|
-
ax.legend(bbox_to_anchor=(1.3, 1), fontsize=10)
|
169
|
-
pi = np.pi
|
170
|
-
ax.set_xticks((0, pi / 4, pi / 2, 3 * pi / 4, pi, 5 * pi / 4,
|
171
|
-
3 * pi / 2, 7 * pi / 4))
|
172
|
-
ax.set_xticklabels(("E", "NE", "N", "NW", "W", "SW", "S", "SE"),
|
173
|
-
fontsize=10)
|
174
|
-
plt.yticks(fontsize=10)
|
175
|
-
|
176
|
-
plt.subplots_adjust(left=0.0, right=1.0, top=0.9, bottom=0.1)
|
177
|
-
|
178
|
-
return ax
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|