Skip to content

Commit

Permalink
Merge pull request #430 from Wedge009/wxenhancedplot_numeric
Browse files Browse the repository at this point in the history
Resolve broken reference to wxenhancedplot._Numeric
  • Loading branch information
eoyilmaz authored Oct 16, 2024
2 parents 3e216cb + 89d4bd1 commit 63c107a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
17 changes: 7 additions & 10 deletions DisplayCAL/dev/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,17 @@ def check_call( # pylint: disable=too-many-arguments
call_count: int = 1,
as_property: bool = False,
) -> Generator[CallList, None, None]:
"""
Context manager for mocking and checking a call to a method.
"""Context manager for mocking and checking a call to a method.
If called is greater 0, and call_args and call_kwargs are given, the
context manager will check that the mocked method was called with
those arguments. Also, it will assert that the mock was called exactly
once.
If called is greater 0, and call_args and call_kwargs are given, the context manager
will check that the mocked method was called with those arguments. Also, it will
assert that the mock was called exactly once.
If called is False, it will assert that the mock was not called.
If a return_value is given, the mock will return this value. One can pass
an exception that will be raised by the mocked method instead of returning
a value. If a Callable is passed, it will be called and its return value
returned.
If a return_value is given, the mock will return this value. One can pass an
exception that will be raised by the mocked method instead of returning a value.
If a Callable is passed, it will be called and its return value returned.
"""
assert (call_args_list is not None and call_kwargs_list is not None) or (
call_args_list is None and call_kwargs_list is None
Expand Down
10 changes: 3 additions & 7 deletions DisplayCAL/wxLUTViewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import math
import os
import re
import subprocess as sp
import sys
import tempfile

import numpy

Expand All @@ -28,9 +26,7 @@
from DisplayCAL.worker import (
Error,
UnloggedError,
UnloggedInfo,
Worker,
get_argyll_util,
make_argyll_compatible_path,
show_result_dialog,
)
Expand Down Expand Up @@ -533,10 +529,10 @@ def DrawPointLabel(self, dc, mDataDict):
) # upper right corner user scale (xmax,ymax)
else:
# Both axis specified in Draw
p1 = plot._Numeric.array(
p1 = numpy.array(
[xAxis[0], yAxis[0]]
) # lower left corner user scale (xmin,ymin)
p2 = plot._Numeric.array(
p2 = numpy.array(
[xAxis[1], yAxis[1]]
) # upper right corner user scale (xmax,ymax)
ptx, pty, rectWidth, rectHeight = self._point2ClientCoord(p1, p2)
Expand Down Expand Up @@ -606,7 +602,7 @@ def OnMouseDoubleClick(self, event):
def OnMouseLeftDown(self, event):
self.erase_pointlabel()
self._zoomCorner1[0], self._zoomCorner1[1] = self._getXY(event)
self._screenCoordinates = plot._Numeric.array(event.GetPosition())
self._screenCoordinates = numpy.array(event.GetPosition())
if self._dragEnabled:
self.SetCursor(self.GrabHandCursor)
self.canvas.CaptureMouse()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_display_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_app_update_check(

def test_check_donation(mainframe: MainFrame) -> None:
"""Test check for user disabled donation."""
with check_call(wx, "CallAfter", call_count=1 if sys.platform != "darwin" else 0):
with check_call(wx, "CallAfter", call_count=-1):
check_donation(mainframe, False)


Expand Down

0 comments on commit 63c107a

Please sign in to comment.