Skip to content

Commit 714163c

Browse files
committed
- makes mypy happy
- fixes newer matplotlib canvas color issue
1 parent b0bc3a2 commit 714163c

5 files changed

Lines changed: 16 additions & 10 deletions

File tree

src/artisanlib/canvas.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9440,7 +9440,11 @@ def redraw(self, recomputeAllDeltas:bool = True, re_smooth_foreground:bool = Tru
94409440
self.ax.spines['top'].set_sketch_params(scale, length, randomness)
94419441
# hide all spines from the delta_ax
94429442
if self.delta_ax is not None:
9443-
self.delta_ax.set_frame_on(False) # hide all splines (as the four lines above)
9443+
self.delta_ax.spines.top.set_visible(False)
9444+
self.delta_ax.spines.bottom.set_visible(False)
9445+
self.delta_ax.spines.left.set_visible(False)
9446+
self.delta_ax.spines.right.set_visible(False)
9447+
# self.delta_ax.set_frame_on(False) # hide all splines (as the four lines above) # this removes canvas background color on MPL 3.11.x, lines above don't have this issue
94449448

94459449
if self.ygrid > 0:
94469450
major_locator = ticker.MultipleLocator(self.ygrid)
@@ -12244,7 +12248,7 @@ def statstextboxBounds(self, x_pos:float, y_pos:float, textstr:str, ls:float, pr
1224412248
bbox_data = self.ax.transData.inverted().transform(bb) # zuban:ignore[arg-type] # bounding box in data space
1224512249
bbox = Bbox(bbox_data)
1224612250
t.remove()
12247-
return bbox.bounds # x0, y0, width, height. Relative to the start of the curve and self.ylimit_min
12251+
return cast(tuple[float,float,float,float], bbox.bounds) # x0, y0, width, height. Relative to the start of the curve and self.ylimit_min
1224812252
return 0,0,0,0
1224912253

1225012254
# Find the bounds for an event annotation text box

src/artisanlib/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3584,7 +3584,7 @@ def __init__(self, parent:QWidget|None = None, *, locale:str, artisanviewerFirst
35843584
self.lowerbuttondialogLayout.addStretch()
35853585
for button_widget in [self.buttonCHARGE, self.buttonDRY, self.buttonFCs, self.buttonFCe,
35863586
self.buttonSCs, self.buttonSCe, self.buttonDROP, self.buttonCOOL, self.buttonEVENT]:
3587-
self.lowerbuttondialogLayout.addWidget(cast(EventPushButton, button_widget))
3587+
self.lowerbuttondialogLayout.addWidget(button_widget) # pyright:ignore[reportUnknownArgumentType] # pyright fails to infer EventPushButton here
35883588
self.lowerbuttondialogLayout.addStretch()
35893589

35903590
def makeButtonbar() -> QFrame:
@@ -6503,6 +6503,7 @@ def updateCanvasColors(self, checkColors:bool=True) -> None:
65036503
del self.light_background_p
65046504

65056505

6506+
65066507
# called from within the sample loop thread!
65076508
def process_active_quantifiers(self) -> None:
65086509
# called every sampling interval

src/artisanlib/transposer.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,12 @@ def getTargetPhases(self) -> tuple[list[int|None], list[float|None]]:
319319
for w in self.phases_target_widgets_time:
320320
ri:int|None = None
321321
if w is not None:
322-
try:
323-
txt = w.text()
324-
ri = stringtoseconds(txt)
325-
except Exception as e: # pylint: disable=broad-except
326-
_log.error(e) # widget should not allow for malformed time string input on which stringtoseconds raises an exception
322+
txt = w.text()
323+
if txt != '':
324+
try:
325+
ri = stringtoseconds(txt)
326+
except Exception as e: # pylint: disable=broad-except
327+
_log.error(e) # widget should not allow for malformed time string input on which stringtoseconds raises an exception
327328
res_times.append(ri)
328329
if self.phases_target_widgets_percent is not None:
329330
for w in self.phases_target_widgets_percent:

src/requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ types-xlrd>=2.0.0.20260518
1616
lxml-stubs>=0.5.1
1717
mypy==2.3.0
1818
pyright==1.1.411
19-
ruff>=0.16.0
19+
ruff>=0.16.1
2020
pylint==4.0.6
2121
pre-commit>=4.6.1
2222
pytest>=9.1.1

src/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ openpyxl==3.1.5
5252
keyring==25.7.0
5353
prettytable==3.18.0
5454
lxml==6.1.1
55-
matplotlib==3.10.9 # 3.11.0/3.11.1 does not set the canvas facecolor (background color) correctly
55+
matplotlib==3.11.1
5656
jinja2==3.1.6
5757
aiohttp==3.14.3
5858
aiohttp_jinja2==1.6

0 commit comments

Comments
 (0)