Skip to content

Commit

Permalink
I hate linters
Browse files Browse the repository at this point in the history
  • Loading branch information
max-anu committed Dec 18, 2024
1 parent 54a4ffe commit 8fe05b2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/accessvis/widgets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from .widget_base import Widget, WidgetMPL, list_widgets
from .season_widget import SeasonWidget
from .calendar_widget import CalendarWidget
from .clock_widget import ClockWidget
from .image_widget import ImageWidget
from .season_widget import SeasonWidget
from .text_widget import TextWidget
from .widget_base import Widget, WidgetMPL, list_widgets

_ = (Widget, WidgetMPL, list_widgets, SeasonWidget) # to stop the linter complaining
_ = (CalendarWidget, ClockWidget, ImageWidget, TextWidget)
_ = (Widget, WidgetMPL, list_widgets, SeasonWidget) # to stop the linter complaining
_ = (CalendarWidget, ClockWidget, ImageWidget, TextWidget)
4 changes: 2 additions & 2 deletions src/accessvis/widgets/calendar_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _update_mpl(self, fig, ax, date: datetime.datetime = None, show_year=True):
return
else:
day_of_year = date.timetuple().tm_yday - 1
position = day_of_year / 365. * np.pi * 2.0
position = day_of_year / 365.0 * np.pi * 2.0
self.arrow = ax.arrow(
position,
0,
Expand All @@ -68,7 +68,7 @@ def _update_mpl(self, fig, ax, date: datetime.datetime = None, show_year=True):
facecolor="#fff",
width=0.1,
head_length=2,
edgecolor="black"
edgecolor="black",
) # , zorder=11, width=1)

def _reset_mpl(self, fig, ax, **kwargs):
Expand Down
25 changes: 15 additions & 10 deletions src/accessvis/widgets/clock_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

class ClockWidget(WidgetMPL):
def __init__(
self,
lv,
text_colour="white",
background="black",
show_seconds=False,
show_minutes=True,
show_hours=True,
**kwargs
self,
lv,
text_colour="white",
background="black",
show_seconds=False,
show_minutes=True,
show_hours=True,
**kwargs
):
super().__init__(lv=lv, **kwargs)
self.text_colour = text_colour
Expand Down Expand Up @@ -52,10 +52,15 @@ def _update_mpl(self, fig, ax, time: datetime.time = None, **kwargs):
minute = time.minute
second = time.second
angles_h = (
2 * np.pi * hour / 12 + 2 * np.pi * minute / (12 * 60) + 2 * second / (12 * 60 * 60) - np.pi / 6.0
2 * np.pi * hour / 12
+ 2 * np.pi * minute / (12 * 60)
+ 2 * second / (12 * 60 * 60)
- np.pi / 6.0
)
angles_m = (
2 * np.pi * minute / 60 + 2 * np.pi * second / (60 * 60) - np.pi / 6.0
2 * np.pi * minute / 60
+ 2 * np.pi * second / (60 * 60)
- np.pi / 6.0
)
angles_s = 2 * np.pi * second / 60 - np.pi / 6.0

Expand Down
2 changes: 1 addition & 1 deletion src/accessvis/widgets/season_widget.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import datetime

import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
import numpy as np
from matplotlib.colors import LinearSegmentedColormap

from .widget_base import WidgetMPL

Expand Down
1 change: 0 additions & 1 deletion src/accessvis/widgets/text_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ def _update_mpl(self, fig, ax, text="", **kwargs):

def _reset_mpl(self, fig, ax, **kwargs):
self.text.set_text("")

0 comments on commit 8fe05b2

Please sign in to comment.