Skip to content

Commit 54060a9

Browse files
committed
reformatted all files to a line-lenght of 79
1 parent aa86691 commit 54060a9

File tree

133 files changed

+3879
-1143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+3879
-1143
lines changed

benchmarks/benchmarks/detect_clearsky.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ class DetectClear:
1212
param_names = ["ndays"]
1313

1414
def setup(self, ndays):
15-
self.times = pd.date_range(start="20180601", freq="1min", periods=1440 * ndays)
15+
self.times = pd.date_range(
16+
start="20180601", freq="1min", periods=1440 * ndays
17+
)
1618
self.lat = 35.1
1719
self.lon = -106.6
1820
self.solar_position = solarposition.get_solarposition(
@@ -22,7 +24,9 @@ def setup(self, ndays):
2224
self.solar_position["apparent_elevation"]
2325
)
2426
self.clearsky = clearsky_df["ghi"]
25-
measured_dni = clearsky_df["dni"].where((self.times.hour % 2).astype(bool), 0)
27+
measured_dni = clearsky_df["dni"].where(
28+
(self.times.hour % 2).astype(bool), 0
29+
)
2630
cos_zen = np.cos(np.deg2rad(self.solar_position["apparent_zenith"]))
2731
self.measured = measured_dni * cos_zen + clearsky_df["dhi"]
2832
self.measured *= 0.98

benchmarks/benchmarks/irradiance.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
class Irradiance:
1010
def setup(self):
11-
self.times = pd.date_range(start="20180601", freq="1min", periods=14400)
11+
self.times = pd.date_range(
12+
start="20180601", freq="1min", periods=14400
13+
)
1214
self.days = pd.date_range(start="20180601", freq="d", periods=30)
1315
self.location = location.Location(40, -80)
1416
self.solar_position = self.location.get_solarposition(self.times)

benchmarks/benchmarks/location.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99

1010
def set_solar_position(obj):
11-
obj.location = pvlib.location.Location(32, -110, altitude=700, tz="Etc/GMT+7")
11+
obj.location = pvlib.location.Location(
12+
32, -110, altitude=700, tz="Etc/GMT+7"
13+
)
1214
obj.times = pd.date_range(start="20180601", freq="3min", periods=1440)
1315
obj.days = pd.date_range(
1416
start="20180101", freq="d", periods=365, tz=obj.location.tz
@@ -28,7 +30,9 @@ def time_location_get_solarposition(self):
2830
self.location.get_solarposition(times=self.times)
2931

3032
def time_location_get_clearsky(self):
31-
self.location.get_clearsky(times=self.times, solar_position=self.solar_position)
33+
self.location.get_clearsky(
34+
times=self.times, solar_position=self.solar_position
35+
)
3236

3337

3438
class Location_0_6_1:
@@ -39,7 +43,9 @@ def setup(self):
3943
set_solar_position(self)
4044

4145
def time_location_get_sun_rise_set_transit_pyephem(self):
42-
self.location.get_sun_rise_set_transit(times=self.days, method="pyephem")
46+
self.location.get_sun_rise_set_transit(
47+
times=self.days, method="pyephem"
48+
)
4349

4450
def time_location_get_sun_rise_set_transit_spa(self):
4551
self.location.get_sun_rise_set_transit(times=self.days, method="spa")

benchmarks/benchmarks/scaling.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ def setup(self):
1212
self.n = 1000
1313
lat = np.array((9.99, 10, 10.01))
1414
lon = np.array((4.99, 5, 5.01))
15-
self.coordinates = np.array([(lati, loni) for (lati, loni) in zip(lat, lon)])
15+
self.coordinates = np.array(
16+
[(lati, loni) for (lati, loni) in zip(lat, lon)]
17+
)
1618
self.times = pd.date_range("2019-01-01", freq="1T", periods=self.n)
1719
self.positions = np.array([[0, 0], [100, 0], [100, 100], [0, 100]])
18-
self.clearsky_index = pd.Series(np.random.rand(self.n), index=self.times)
20+
self.clearsky_index = pd.Series(
21+
np.random.rand(self.n), index=self.times
22+
)
1923
self.cloud_speed = 5
2024
self.tmscales = np.array(
2125
(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096)
@@ -31,4 +35,6 @@ def time__compute_vr(self):
3135
scaling._compute_vr(self.positions, self.cloud_speed, self.tmscales)
3236

3337
def time_wvm(self):
34-
scaling.wvm(self.clearsky_index, self.positions, self.cloud_speed, dt=1)
38+
scaling.wvm(
39+
self.clearsky_index, self.positions, self.cloud_speed, dt=1
40+
)

benchmarks/benchmarks/solarposition.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ class SolarPosition:
2121
param_names = ["ndays"]
2222

2323
def setup(self, ndays):
24-
self.times = pd.date_range(start="20180601", freq="1min", periods=1440 * ndays)
24+
self.times = pd.date_range(
25+
start="20180601", freq="1min", periods=1440 * ndays
26+
)
2527
self.times_localized = self.times.tz_localize("Etc/GMT+7")
2628
self.lat = 35.1
2729
self.lon = -106.6
@@ -47,7 +49,9 @@ def time_sun_rise_set_transit_spa(self, ndays):
4749
sun_rise_set_transit_spa(self.times_daily, self.lat, self.lon)
4850

4951
def time_sun_rise_set_transit_ephem(self, ndays):
50-
solarposition.sun_rise_set_transit_ephem(self.times_daily, self.lat, self.lon)
52+
solarposition.sun_rise_set_transit_ephem(
53+
self.times_daily, self.lat, self.lon
54+
)
5155

5256
def time_sun_rise_set_transit_geometric_full_comparison(self, ndays):
5357
dayofyear = self.times_daily.dayofyear
@@ -77,5 +81,10 @@ def setup(self):
7781
def time_calc_time(self):
7882
# datetime.datetime(2020, 9, 14, 13, 24, 13, 861913, tzinfo=<UTC>)
7983
solarposition.calc_time(
80-
self.start, self.end, self.lat, self.lon, self.attribute, self.value
84+
self.start,
85+
self.end,
86+
self.lat,
87+
self.lon,
88+
self.attribute,
89+
self.value,
8190
)

benchmarks/benchmarks/solarposition_numba.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ class SolarPositionNumba:
3030
param_names = ["ndays"]
3131

3232
def setup(self, ndays):
33-
self.times = pd.date_range(start="20180601", freq="1min", periods=1440 * ndays)
33+
self.times = pd.date_range(
34+
start="20180601", freq="1min", periods=1440 * ndays
35+
)
3436
self.times_localized = self.times.tz_localize("Etc/GMT+7")
3537
self.lat = 35.1
3638
self.lon = -106.6
@@ -39,7 +41,11 @@ def setup(self, ndays):
3941
)
4042

4143
def time_spa_python(self, ndays):
42-
solarposition.spa_python(self.times_localized, self.lat, self.lon, how="numba")
44+
solarposition.spa_python(
45+
self.times_localized, self.lat, self.lon, how="numba"
46+
)
4347

4448
def time_sun_rise_set_transit_spa(self, ndays):
45-
sun_rise_set_transit_spa(self.times_daily, self.lat, self.lon, how="numba")
49+
sun_rise_set_transit_spa(
50+
self.times_daily, self.lat, self.lon, how="numba"
51+
)

benchmarks/benchmarks/temperature.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def setup(self):
2121
if Version(pvlib.__version__) >= Version("0.7.0"):
2222
kwargs = pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS["sapm"]
2323
kwargs = kwargs["open_rack_glass_glass"]
24-
self.sapm_cell_wrapper = partial(pvlib.temperature.sapm_cell, **kwargs)
24+
self.sapm_cell_wrapper = partial(
25+
pvlib.temperature.sapm_cell, **kwargs
26+
)
2527
else:
2628
sapm_celltemp = pvlib.pvsystem.sapm_celltemp
2729

benchmarks/benchmarks/tracking.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
class SingleAxis:
1111
def setup(self):
12-
self.times = pd.date_range(start="20180601", freq="1min", periods=14400)
12+
self.times = pd.date_range(
13+
start="20180601", freq="1min", periods=14400
14+
)
1315
self.lat = 35.1
1416
self.lon = -106.6
1517
self.solar_position = solarposition.get_solarposition(

docs/examples/adr-pvarray/plot_fit_to_matrix.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@
6666

6767
df["eta_rel"] = (df["p_mp"] / P_REF) / (df["irradiance"] / G_REF)
6868

69-
adr_params = fit_pvefficiency_adr(df["irradiance"], df["temperature"], df["eta_rel"])
69+
adr_params = fit_pvefficiency_adr(
70+
df["irradiance"], df["temperature"], df["eta_rel"]
71+
)
7072

7173
for k, v in adr_params.items():
7274
print("%-5s = %8.5f" % (k, v))
@@ -78,7 +80,9 @@
7880
# they are most likely evidence of the limitations of measurement accuracy.
7981
#
8082

81-
eta_rel_adr = pvefficiency_adr(df["irradiance"], df["temperature"], **adr_params)
83+
eta_rel_adr = pvefficiency_adr(
84+
df["irradiance"], df["temperature"], **adr_params
85+
)
8286

8387
plt.figure()
8488
plt.plot(df["irradiance"], df["eta_rel"], "oc", ms=8)

docs/examples/adr-pvarray/plot_simulate_fast.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ def run_pvsyst():
124124

125125
print("Elapsed time for the PVsyst model: %9.6f s" % elapsed_pvs)
126126
print("Elapsed time for the ADR model: %9.6f s" % elapsed_adr)
127-
print("ADR acceleration ratio: %9.0f x" % (elapsed_pvs / elapsed_adr))
127+
print(
128+
"ADR acceleration ratio: %9.0f x" % (elapsed_pvs / elapsed_adr)
129+
)
128130

129131
# %%
130132
#

0 commit comments

Comments
 (0)