Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #285

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ repos:

# Make docstrings PEP 257 compliant
- repo: https://github.com/PyCQA/docformatter
rev: v1.5.1
rev: v1.6.0
hooks:
- id: docformatter
args: ['--in-place', '--make-summary-multi-line', '--pre-summary-newline']
Expand Down
7 changes: 0 additions & 7 deletions atlite/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ def convert_temperature(ds):
Return outside temperature (useful for e.g. heat pump T-dependent
coefficient of performance).
"""

# Temperature is in Kelvin
return ds["temperature"] - 273.15

Expand All @@ -224,7 +223,6 @@ def convert_soil_temperature(ds):
Return soil temperature (useful for e.g. heat pump T-dependent coefficient
of performance).
"""

# Temperature is in Kelvin

# There are nans where there is sea; by setting them
Expand Down Expand Up @@ -363,7 +361,6 @@ def heat_demand(cutout, threshold=15.0, a=1.0, constant=0.0, hour_shift=0.0, **p
You can also specify all of the general conversion arguments
documented in the `convert_and_aggregate` function.
"""

return cutout.convert_and_aggregate(
convert_func=convert_heat_demand,
threshold=threshold,
Expand Down Expand Up @@ -463,7 +460,6 @@ def convert_wind(ds, turbine):
"""
Convert wind speeds for turbine to wind energy generation.
"""

V, POW, hub_height, P = itemgetter("V", "POW", "hub_height", "P")(turbine)

wnd_hub = windm.extrapolate_wind_speed(ds, to_height=hub_height)
Expand Down Expand Up @@ -517,7 +513,6 @@ def wind(cutout, turbine, smooth=False, **params):
[1] Andresen G B, Søndergaard A A and Greiner M 2015 Energy 93, Part 1
1074 – 1088. doi:10.1016/j.energy.2015.09.071
"""

if isinstance(turbine, (str, Path)):
turbine = get_windturbineconfig(turbine)

Expand Down Expand Up @@ -598,7 +593,6 @@ def pv(cutout, panel, orientation, tracking=None, clearsky_model=None, **params)
the Performance Check of Grid Connected Systems, Freiburg, June 2004.
Eurosun (ISES Europe Solar Congress).
"""

if isinstance(panel, (str, Path)):
panel = get_solarpanelconfig(panel)
if not callable(orientation):
Expand Down Expand Up @@ -687,7 +681,6 @@ def csp(cutout, installation, technology=None, **params):
[2] Tobias Hirsch (ed.). CSPBankability Project Report, DLR, 2017.
URL: https://www.dlr.de/sf/en/desktopdefault.aspx/tabid-11126/19467_read-48251/
"""

if isinstance(installation, (str, Path)):
installation = get_cspinstallationconfig(installation)

Expand Down
1 change: 0 additions & 1 deletion atlite/csp.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def calculate_dni(ds, solar_position=None, altitude_threshold=3.75):
the solar altitude traversed by the sun within about 15 minutes in a location with
maximum solar altitude of 60 deg and 10h day time.
"""

if solar_position is None:
solar_position = SolarPosition(ds)

Expand Down
1 change: 0 additions & 1 deletion atlite/pv/orientation.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def SurfaceOrientation(ds, solar_position, orientation, tracking=None):
[1] Sproul, A. B., Derivation of the solar geometric relationships using
vector analysis, Renewable Energy, 32(7), 1187–1205 (2007).
"""

lon = deg2rad(ds["lon"])
lat = deg2rad(ds["lat"])

Expand Down
12 changes: 5 additions & 7 deletions atlite/pv/solar_panel_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ def _power_huld(irradiance, t_amb, pc):
Maximum power point tracking is assumed.

[1] Huld, T. et al., 2010. Mapping the performance of PV modules,
effects of module type and data averaging. Solar Energy, 84(2),
p.324-338. DOI: 10.1016/j.solener.2009.12.002
effects of module type and data averaging. Solar Energy, 84(2),
p.324-338. DOI: 10.1016/j.solener.2009.12.002
"""

# normalized module temperature
T_ = (pc["c_temp_amb"] * t_amb + pc["c_temp_irrad"] * irradiance) - pc["r_tmod"]

Expand Down Expand Up @@ -54,11 +53,10 @@ def _power_bofinger(irradiance, t_amb, pc):

Maximum power point tracking is assumed.

[2] Hans Beyer, Gerd Heilscher and Stefan Bofinger, 2004. A robust model
for the MPP performance of different types of PV-modules applied for the
performance check of grid connected systems.
[2] Hans Beyer, Gerd Heilscher and Stefan Bofinger, 2004. A robust
model for the MPP performance of different types of PV-modules
applied for the performance check of grid connected systems.
"""

fraction = (pc["NOCT"] - pc["Tamb"]) / pc["Intc"]

eta_ref = (
Expand Down
1 change: 0 additions & 1 deletion atlite/pv/solar_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def SolarPosition(ds, time_shift="0H"):
been implemented using numba or plain numpy for a single location at
https://github.com/pvlib/pvlib-python/blob/master/pvlib/spa.py.
"""

# Act like a getter if these return variables are already in ds
rvs = {
"solar_azimuth",
Expand Down
5 changes: 0 additions & 5 deletions atlite/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def get_windturbineconfig(turbine):
config : dict
Config with details on the turbine
"""

assert isinstance(turbine, (str, Path))

if isinstance(turbine, str) and turbine.startswith("oedb:"):
Expand Down Expand Up @@ -94,7 +93,6 @@ def get_solarpanelconfig(panel):
config : dict
Config with details on the solarpanel
"""

assert isinstance(panel, (str, Path))

if isinstance(panel, str):
Expand Down Expand Up @@ -127,7 +125,6 @@ def get_cspinstallationconfig(installation):
config : dict
Config with details on the CSP installation.
"""

assert isinstance(installation, (str, Path))

if isinstance(installation, str):
Expand Down Expand Up @@ -216,7 +213,6 @@ def windturbine_smooth(turbine, params=None):
Danish wind time series from a new global renewable energy atlas
for energy system analysis, Energy 93, Part 1 (2015) 1074–1088.
"""

if params is None or params == True:
params = {}

Expand Down Expand Up @@ -297,7 +293,6 @@ def get_oedb_windturbineconfig(search=None, **search_params):
>>> get_oedb_windturbineconfig(name="E-53/800", manufacturer="Enercon")
{'V': ..., 'POW': ..., ...}
"""

# Parse information of different allowed 'turbine' values
if isinstance(search, int):
search_params.setdefault("id", search)
Expand Down
1 change: 0 additions & 1 deletion atlite/wind.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def extrapolate_wind_speed(ds, to_height, from_height=None):
[2] https://en.wikipedia.org/w/index.php?title=Roughness_length&oldid=862127433,
Retrieved 2019-02-15.
"""

# Fast lane
to_name = "wnd{h:0d}m".format(h=int(to_height))
if to_name in ds:
Expand Down
5 changes: 2 additions & 3 deletions test/test_dynamic_line_rating.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def test_oeding_and_oswald_sample_case():

This is the same as the DIN 48204-4/84.

We do not exactly know at what ambient temperature the DIN is calculated.
30 degree is a good guess that fits.
We do not exactly know at what ambient temperature the DIN is
calculated. 30 degree is a good guess that fits.
"""
ds = {
"temperature": 30 + 273,
Expand Down Expand Up @@ -84,7 +84,6 @@ def test_suedkabel_sample_case():
typ-2xsfl2y-1x2500-rms-250-220-380-kv assume ambient temperature of 20°C,
no wind, no sun and max allowed line temperature of 90°C.
"""

ds = {
"temperature": 293,
"wnd100m": 0,
Expand Down
1 change: 0 additions & 1 deletion test/test_gis.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def test_open_closed_checks(ref, geometry, raster):

C.f. GH issue #225.
"""

res = 0.01
excluder = ExclusionContainer(ref.crs, res=res)

Expand Down
3 changes: 0 additions & 3 deletions test/test_preparation_and_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def pv_test(cutout, time=TIME):

Compare optimal orientation with flat orientation.
"""

orientation = {"slope": 0.0, "azimuth": 0.0}
cap_factor = cutout.pv(atlite.resource.solarpanels.CdTe, orientation)

Expand Down Expand Up @@ -152,7 +151,6 @@ def pv_tracking_test(cutout):
Test the atlite.Cutout.pv function with different tracking settings and
compare results.
"""

orientation = {"slope": 0.0, "azimuth": 180.0}
# tracking = None is the default option
cap_factor = cutout.pv(
Expand Down Expand Up @@ -201,7 +199,6 @@ def csp_test(cutout):
Test the atlite.Cutout.csp function with different for different settings
and technologies.
"""

## Test technology = "solar tower"
st = cutout.csp(atlite.cspinstallations.SAM_solar_tower, capacity_factor=True)

Expand Down