Skip to content

Commit

Permalink
More black and pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
svenseeberg committed Jan 27, 2024
1 parent f4a6ce1 commit 9cf95e7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions opendrift_leeway_webgui/leeway/celery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Configure Celery workers
"""

import configparser
import email
import os
Expand Down
1 change: 1 addition & 0 deletions opendrift_leeway_webgui/leeway/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
For more information on this file, see :doc:`django:topics/http/urls`.
"""

from django.conf import settings
from django.conf.urls.static import static
from django.urls import include, path
Expand Down
14 changes: 8 additions & 6 deletions opendrift_leeway_webgui/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,20 @@ def main():
ax = plt.axes(projection=crs)

# base map layer
ax.add_wms(
wms="https://sgx.geodatenzentrum.de/wms_topplus_open", layers=["web"]
)
ax.add_wms(wms="https://sgx.geodatenzentrum.de/wms_topplus_open", layers=["web"])
# quote source: Kartendarstellung: © Bundesamt für Kartographie und Geodäsie
# (2021), Datenquellen:
# https://gdz.bkg.bund.de/index.php/default/wms-topplusopen-wms-topplus-open.html

stranded = None
active = None
for i in range(lon.shape[0]):
lon_max_idx = np.where(np.isnan(lon[i, ...]))[0][0] - 1 if np.isnan(lon[i, -1]) else -1
lat_max_idx = np.where(np.isnan(lat[i, ...]))[0][0] - 1 if np.isnan(lat[i, -1]) else -1
lon_max_idx = (
np.where(np.isnan(lon[i, ...]))[0][0] - 1 if np.isnan(lon[i, -1]) else -1
)
lat_max_idx = (
np.where(np.isnan(lat[i, ...]))[0][0] - 1 if np.isnan(lat[i, -1]) else -1
)

points = np.array([lon[i, ...], lat[i, ...]]).T.reshape(-1, 1, 2)
segments = np.concatenate([points[:-1], points[1:]], axis=1)
Expand Down Expand Up @@ -292,7 +294,7 @@ def main():
end = start + timedelta(hours=args.duration)

plt.title(
f"Leeway Simulation Object Type: {simulation.get_config('seed:object_type')}\n"
f"Leeway Simulation Object Type: {simulation.get_config('seed:object_type')}\n"
f" From {start.strftime('%d-%m-%Y %H:%M')} to {end.strftime('%d-%m-%Y %H:%M')} UTC"
)
fig.text(
Expand Down

0 comments on commit 9cf95e7

Please sign in to comment.