Skip to content

Commit 9d0ac8e

Browse files
pre-commit-ci[bot]Fabian Hofmann
andauthored
[pre-commit.ci] pre-commit autoupdate (#216)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 21.12b0 → 22.1.0](psf/black@21.12b0...22.1.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Fabian Hofmann <hofmann@fias.uni-frankfurt.de>
1 parent 6c69d51 commit 9d0ac8e

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
hooks:
99
- id: check-yaml
1010
- repo: https://github.com/psf/black
11-
rev: 21.12b0
11+
rev: 22.1.0
1212
hooks:
1313
- id: black
1414
- repo: https://github.com/fsfe/reuse-tool

atlite/convert.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def convert_coefficient_of_performance(ds, source, sink_T, c0, c1, c2):
266266

267267
delta_T = sink_T - source_T
268268

269-
return c0 + c1 * delta_T + c2 * delta_T ** 2
269+
return c0 + c1 * delta_T + c2 * delta_T**2
270270

271271

272272
def coefficient_of_performance(
@@ -869,11 +869,11 @@ def convert_line_rating(
869869

870870
# 1. Convective Loss, at first forced convection
871871
V = ds["wnd100m"] # typically ironmen are about 40-60 meters high
872-
mu = (1.458e-6 * Tfilm ** 1.5) / (
872+
mu = (1.458e-6 * Tfilm**1.5) / (
873873
Tfilm + 383.4 - T0
874874
) # Dynamic viscosity of air (13a)
875875
H = ds["height"]
876-
rho = (1.293 - 1.525e-4 * H + 6.379e-9 * H ** 2) / (
876+
rho = (1.293 - 1.525e-4 * H + 6.379e-9 * H**2) / (
877877
1 + 0.00367 * (Tfilm - T0)
878878
) # (14a)
879879

@@ -889,13 +889,13 @@ def convert_line_rating(
889889
) # wind direction factor
890890

891891
Tdiff = Ts - Ta
892-
qcf1 = K * (1.01 + 1.347 * reynold ** 0.52) * k * Tdiff # (3a) in [1]
893-
qcf2 = K * 0.754 * reynold ** 0.6 * k * Tdiff # (3b) in [1]
892+
qcf1 = K * (1.01 + 1.347 * reynold**0.52) * k * Tdiff # (3a) in [1]
893+
qcf2 = K * 0.754 * reynold**0.6 * k * Tdiff # (3b) in [1]
894894

895895
qcf = np.maximum(qcf1, qcf2)
896896

897897
# natural convection
898-
qcn = 3.645 * np.sqrt(rho) * D ** 0.75 * Tdiff ** 1.25
898+
qcn = 3.645 * np.sqrt(rho) * D**0.75 * Tdiff**1.25
899899

900900
# convection loss is the max between forced and natural
901901
qc = np.maximum(qcf, qcn)

atlite/pv/solar_panel_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def _power_huld(irradiance, t_amb, pc):
3535
1
3636
+ pc["k_1"] * log_G_
3737
+ pc["k_2"] * (log_G_) ** 2
38-
+ T_ * (pc["k_3"] + pc["k_4"] * log_G_ + pc["k_5"] * log_G_ ** 2)
39-
+ pc["k_6"] * (T_ ** 2)
38+
+ T_ * (pc["k_3"] + pc["k_4"] * log_G_ + pc["k_5"] * log_G_**2)
39+
+ pc["k_6"] * (T_**2)
4040
)
4141

4242
eff = eff.fillna(0.0).clip(min=0)

doc/conf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@
6666
master_doc = "index"
6767

6868
# General information about the project.
69-
project = u"atlite"
70-
author = u"The Atlite Authors"
71-
copyright = u"2016-2019" + u", " + author
72-
documentation_title = u"Atlite Documentation"
69+
project = "atlite"
70+
author = "The Atlite Authors"
71+
copyright = "2016-2019" + ", " + author
72+
documentation_title = "Atlite Documentation"
7373

7474
# The version info for the project you're documenting, acts as replacement for
7575
# |version| and |release|, also used in various other places throughout the
@@ -269,14 +269,14 @@
269269
# Grouping the document tree into LaTeX files. List of tuples
270270
# (source start file, target name, title,
271271
# author, documentclass [howto, manual, or own class]).
272-
latex_documents = [(master_doc, "atlite.tex", documentation_title, author, u"manual")]
272+
latex_documents = [(master_doc, "atlite.tex", documentation_title, author, "manual")]
273273

274274

275275
# Added for rinoh http://www.mos6581.org/rinohtype/quickstart.html
276276
rinoh_documents = [
277277
(
278278
master_doc, # top-level file (index.rst)
279-
project + u".pdf", # output (target.pdf)
279+
project + ".pdf", # output (target.pdf)
280280
documentation_title, # document title
281281
author,
282282
)

test/test_gis.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def test_shape_availability_area(ref):
314314

315315
shapes = shapes.to_crs(3035)
316316
masked, transform = shape_availability(shapes, excluder)
317-
assert np.isclose(shapes.area, masked.sum() * res ** 2)
317+
assert np.isclose(shapes.area, masked.sum() * res**2)
318318

319319

320320
def test_exclusioncontainer_geometries():
@@ -354,13 +354,13 @@ def test_shape_availability_exclude_geometry(ref):
354354
excluder.add_geometry(exclude)
355355
masked, transform = shape_availability(shapes, excluder)
356356
area = shapes.geometry[0].area # get area without warning
357-
assert isclose(3 * area / 4, masked.sum() * res ** 2)
357+
assert isclose(3 * area / 4, masked.sum() * res**2)
358358

359359
excluder = ExclusionContainer(ref.crs, res=res)
360360
excluder.add_geometry(exclude, invert=True)
361361
masked, transform = shape_availability(shapes, excluder)
362362
area = shapes.geometry[0].area # get area without warning
363-
assert isclose(area / 4, masked.sum() * res ** 2)
363+
assert isclose(area / 4, masked.sum() * res**2)
364364

365365

366366
def test_shape_availability_exclude_raster(ref, raster):
@@ -408,17 +408,17 @@ def test_shape_availability_excluder_partial_overlap(ref, raster):
408408
excluder = ExclusionContainer(ref.crs, res=res)
409409
excluder.add_raster(raster, codes=[0, 1])
410410
masked, transform = shape_availability(shapes, excluder)
411-
assert masked.sum() * (res ** 2) == area / 2
411+
assert masked.sum() * (res**2) == area / 2
412412

413413
excluder = ExclusionContainer(ref.crs, res=res)
414414
excluder.add_raster(raster, nodata=0)
415415
masked, transform = shape_availability(shapes, excluder)
416-
assert masked.sum() * (res ** 2) > area / 2
416+
assert masked.sum() * (res**2) > area / 2
417417

418418
excluder = ExclusionContainer(ref.crs, res=res)
419419
excluder.add_raster(raster, nodata=1)
420420
masked, transform = shape_availability(shapes, excluder)
421-
assert masked.sum() * (res ** 2) < area / 2
421+
assert masked.sum() * (res**2) < area / 2
422422

423423

424424
def test_shape_availability_excluder_raster_no_overlap(ref, raster):
@@ -441,12 +441,12 @@ def test_shape_availability_excluder_raster_no_overlap(ref, raster):
441441
excluder = ExclusionContainer(ref.crs, res=res)
442442
excluder.add_raster(raster, allow_no_overlap=True, codes=[1, 255], invert=True)
443443
masked, transform = shape_availability(shapes, excluder)
444-
assert masked.sum() * (res ** 2) == area
444+
assert masked.sum() * (res**2) == area
445445

446446
excluder = ExclusionContainer(ref.crs, res=res)
447447
excluder.add_raster(raster, allow_no_overlap=True, nodata=0)
448448
masked, transform = shape_availability(shapes, excluder)
449-
assert masked.sum() * (res ** 2) == area
449+
assert masked.sum() * (res**2) == area
450450

451451

452452
def test_availability_matrix_rastered(ref, raster):

test/test_preparation_and_conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def wind_test(cutout):
208208
assert production.sum() > 0
209209

210210
# Now create a better layout with same amount of installed power
211-
better_layout = (cap_factor ** 2) / (cap_factor ** 2).sum() * cap_factor.sum()
211+
better_layout = (cap_factor**2) / (cap_factor**2).sum() * cap_factor.sum()
212212
better_production = cutout.wind(
213213
atlite.windturbines.Enercon_E101_3000kW, layout=better_layout
214214
)

0 commit comments

Comments
 (0)