mwxlib 0.96.5__py3-none-any.whl → 0.96.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mwxlib might be problematic. Click here for more details.

mwx/controls.py CHANGED
@@ -16,6 +16,11 @@ import numpy as np
16
16
  from numpy import nan, inf # noqa: necessary to eval
17
17
 
18
18
 
19
+ def _Tip(*tips):
20
+ """Concatenate tips with newline char."""
21
+ return '\n'.join(filter(None, tips)).strip()
22
+
23
+
19
24
  class Param(object):
20
25
  """Standard Parameter
21
26
 
@@ -61,9 +66,7 @@ class Param(object):
61
66
  'overflow' : [],
62
67
  'underflow' : [],
63
68
  })
64
- ## Concatenate tips with newline char.
65
- tips = (handler.__doc__, updater.__doc__)
66
- self._tooltip = '\n'.join(filter(None, tips)).strip()
69
+ self._tooltip = _Tip(handler.__doc__, updater.__doc__)
67
70
 
68
71
  def __str__(self, v=None):
69
72
  v = self.value if v is None else v
@@ -1004,7 +1007,7 @@ class Button(pb.PlateButton):
1004
1007
  if handler:
1005
1008
  self.Bind(wx.EVT_BUTTON, _F(handler))
1006
1009
 
1007
- self.ToolTip = handler.__doc__
1010
+ self.ToolTip = _Tip(handler.__doc__)
1008
1011
  self.icon = icon
1009
1012
 
1010
1013
  def SetBitmap(self, bmp):
@@ -1050,7 +1053,7 @@ class ToggleButton(wx.ToggleButton):
1050
1053
  if handler:
1051
1054
  self.Bind(wx.EVT_TOGGLEBUTTON, _F(handler))
1052
1055
 
1053
- self.ToolTip = handler.__doc__
1056
+ self.ToolTip = _Tip(handler.__doc__)
1054
1057
  self.icon = icon
1055
1058
 
1056
1059
 
@@ -1093,8 +1096,8 @@ class TextCtrl(wx.Control):
1093
1096
  self._ctrl = wx.TextCtrl(self, **kwargs)
1094
1097
  self._btn = Button(self, label, None, icon,
1095
1098
  size=(-1,-1) if label or icon else (0,0))
1096
- self._ctrl.ToolTip = handler.__doc__
1097
- self._btn.ToolTip = updater.__doc__
1099
+ self._ctrl.ToolTip = _Tip(handler.__doc__)
1100
+ self._btn.ToolTip = _Tip(updater.__doc__)
1098
1101
 
1099
1102
  self.SetSizer(
1100
1103
  pack(self, (
@@ -1170,8 +1173,8 @@ class Choice(wx.Control):
1170
1173
  self._ctrl = wx.ComboBox(self, **kwargs)
1171
1174
  self._btn = Button(self, label, None, icon,
1172
1175
  size=(-1,-1) if label or icon else (0,0))
1173
- self._ctrl.ToolTip = handler.__doc__
1174
- self._btn.ToolTip = updater.__doc__
1176
+ self._ctrl.ToolTip = _Tip(handler.__doc__)
1177
+ self._btn.ToolTip = _Tip(updater.__doc__)
1175
1178
 
1176
1179
  self.SetSizer(
1177
1180
  pack(self, (
mwx/framework.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "0.96.5"
4
+ __version__ = "0.96.6"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from functools import wraps, partial
mwx/nutshell.py CHANGED
@@ -9,6 +9,7 @@ from bdb import BdbQuit
9
9
  import traceback
10
10
  import inspect
11
11
  import builtins
12
+ import operator
12
13
  import dis
13
14
  import pydoc
14
15
  import keyword
@@ -163,10 +164,19 @@ class EditorInterface(CtrlInterface):
163
164
  ## This avoids sending the `EVT_STC_NEEDSHOWN` notification.
164
165
  self.SetAutomaticFold(stc.STC_AUTOMATICFOLD_SHOW)
165
166
 
167
+ def _dunders(*objects):
168
+ ss = set()
169
+ for obj in objects:
170
+ ss |= set(x for x in dir(obj) if x.startswith('__'))
171
+ return ss
172
+
166
173
  ## Keyword(2) setting
167
174
  self.SetLexer(stc.STC_LEX_PYTHON)
168
175
  self.SetKeyWords(0, ' '.join(keyword.kwlist))
169
- self.SetKeyWords(1, ' '.join(builtins.__dict__) + ' self this')
176
+ self.SetKeyWords(1, ' '.join(builtins.__dict__)
177
+ + ' '.join(_dunders(type, int, float, str, bytes,
178
+ tuple, list, range, operator,))
179
+ + ' self this')
170
180
 
171
181
  ## AutoComp setting
172
182
  self.AutoCompSetAutoHide(False)
mwx/plugins/fft_view.py CHANGED
@@ -4,12 +4,18 @@
4
4
  import wx
5
5
  import numpy as np
6
6
  from numpy.fft import fft2,ifft2,fftshift,ifftshift
7
- ## from scipy.fftpack import fft,ifft,fft2,ifft2 Memory Leak? <scipy 0.16.1>
8
- ## import cv2
9
7
 
10
8
  from mwx.graphman import Layer
11
9
  from mwx.controls import Param
12
- import editor as edi
10
+
11
+
12
+ def fftcrop(src):
13
+ """Crop src image in 2**N square ROI centered at (x, y)."""
14
+ h, w = src.shape
15
+ m = min(h, w)
16
+ n = 1 if m < 2 else 2 ** int(np.log2(m) - 1) # +-m/2
17
+ x, y = w//2, h//2
18
+ return src[y-n:y+n, x-n:x+n]
13
19
 
14
20
 
15
21
  class Plugin(Layer):
@@ -45,7 +51,7 @@ class Plugin(Layer):
45
51
  frame = self.graph.frame
46
52
  if frame:
47
53
  self.message("FFT execution...")
48
- src = edi.fftcrop(frame.roi)
54
+ src = fftcrop(frame.roi)
49
55
  h, w = src.shape
50
56
 
51
57
  dst = fftshift(fft2(src))
@@ -233,10 +233,11 @@ class CheckList(wx.ListCtrl, ListCtrlAutoWidthMixin, CtrlInterface):
233
233
  self.Select(j, False)
234
234
 
235
235
  def on_frames_removed(self, indices):
236
- for j in reversed(indices):
237
- self.DeleteItem(j)
238
- for k in range(self.ItemCount): # id(0) を更新する
239
- self.SetItem(k, 0, str(k))
236
+ with wx.FrozenWindow(self):
237
+ for j in reversed(indices):
238
+ self.DeleteItem(j)
239
+ for k in range(self.ItemCount): # id(0) を更新する
240
+ self.SetItem(k, 0, str(k))
240
241
 
241
242
 
242
243
  class Plugin(Layer):
mwx/utilus.py CHANGED
@@ -692,7 +692,8 @@ class FSM(dict):
692
692
  " to : {}".format(self.__state),
693
693
  " action : {}".format(typename(act)),
694
694
  " args : {}".format(args),
695
- " kwargs : {}".format(kwargs))
695
+ " kwargs : {}".format(kwargs),
696
+ "")
696
697
  self.__matched_pattern = None
697
698
  return retvals
698
699
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 0.96.5
3
+ Version: 0.96.6
4
4
  Summary: A wrapper of matplotlib and wxPython (phoenix)
5
5
  Home-page: https://github.com/komoto48g/mwxlib
6
6
  Author: Kazuya O'moto
@@ -16,11 +16,9 @@ Classifier: Topic :: Scientific/Engineering :: Image Processing
16
16
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
17
  License-File: LICENSE
18
18
  Requires-Dist: wxpython
19
- Requires-Dist: numpy
20
- Requires-Dist: scipy
21
- Requires-Dist: pillow
22
19
  Requires-Dist: matplotlib
23
20
  Requires-Dist: opencv-python
21
+ Requires-Dist: scipy
24
22
 
25
23
  Project description
26
24
  ===================
@@ -1,28 +1,28 @@
1
1
  mwx/__init__.py,sha256=nN62CGTWjME7Zz2h-jIRB8MxwuErIkHPGrlBzydkF0o,643
2
2
  mwx/bookshelf.py,sha256=CjcgtHC33KR5mHp1lW6Bqfndpzr7hC8ICkFihw4kM3g,5134
3
- mwx/controls.py,sha256=CAfptYrYxHg1qix3MInXuSp3epI33gpQxf183jLPTvo,48321
4
- mwx/framework.py,sha256=9-FMc30KMYYkYCuql8k8Wa8ynjj6GTbMamZV_x5GVgs,75227
3
+ mwx/controls.py,sha256=s6yJzQyYnjCzcjXa6nbTJncxzpMI0E5zYWPn3-cFy5Q,48378
4
+ mwx/framework.py,sha256=xo6rnlRMtCtGT3FDJt2dJ8dOdelnPRoN93I1lKQO5lE,75227
5
5
  mwx/graphman.py,sha256=XoD_wbt5wrmiRf8Q3lpn_eklakE2K-rLfpzfXG1L-Pc,71269
6
6
  mwx/images.py,sha256=_-Eh3xF7Khu42ivkYp97NXIzSNGbjcidqtWjZQFGtqE,47827
7
7
  mwx/matplot2.py,sha256=-G7z0Osozm9NjLfXvX5UcdFviwbNUktjbd904_g-PqQ,33516
8
8
  mwx/matplot2g.py,sha256=22rpdkqJQEJADINPaG5htACutbt8oG1ewO8LMpxaqH4,65237
9
9
  mwx/matplot2lg.py,sha256=MDbkO0vn5yi9rwTBCBJ4rsIHcWyoGXeNTbp0xfrvTdM,27381
10
10
  mwx/mgplt.py,sha256=ITzxA97yDwr_35BUk5OqnyskSuKVDbpf2AQCKY1jHTI,5671
11
- mwx/nutshell.py,sha256=HNo8ZuhLZPKd_Cg4s9NN-KfuSXHRP_jaw1s59GVXkN4,136971
12
- mwx/utilus.py,sha256=d-cDI4n4S-v-Gya2ekbVURq686BQfFZ7S2i63wIKHQg,37298
11
+ mwx/nutshell.py,sha256=cdrg3cuF6AVU2OuR3QswSiTWrTsGIVaqrBSMuxJIjdE,137364
12
+ mwx/utilus.py,sha256=8GK_2mGY08DVN5_SGWynLKQEJsCKqvqWTDToar1XozM,37333
13
13
  mwx/wxmon.py,sha256=f3V24EF7kdMlYF7usLYK9QE5KU6fSu0jVqsvwAiA-Ag,12647
14
14
  mwx/wxpdb.py,sha256=lLowkkAgMhPFHAfklD7wZHq0qbSMjRxnBFtSajmVgME,19133
15
15
  mwx/wxwil.py,sha256=0bzSTfMEjllJheKxZPb4p8Luz6Il3V29bCLBty72U2o,5576
16
16
  mwx/wxwit.py,sha256=yU6XeCCWRBP7CLmpphjT072PfXAL30DNaxoChDX2p0I,7322
17
17
  mwx/plugins/__init__.py,sha256=jnJ-Sl9XJ_7BFDslD_r7dsbxsOT57q_IaEriV53XIGY,41
18
18
  mwx/plugins/ffmpeg_view.py,sha256=QjNqnvPEd9vCwfATU2BOO75fIOFD5LQ-Wf-BBhvZNZs,9368
19
- mwx/plugins/fft_view.py,sha256=HcnBr-y_yFdSfASPRzMLANta4SwSDShd65QWnCU3XhM,2665
20
- mwx/plugins/frame_listview.py,sha256=Li993CV0pPY23Jb8cGQkc3wVeDlHWLEe8RuDbNZeB8s,10351
19
+ mwx/plugins/fft_view.py,sha256=HVptnn1dq-Dg7AzXKJXq1dfKiy38catlrMbJkvyLM98,2790
20
+ mwx/plugins/frame_listview.py,sha256=7LDAYbl5NvmD4Ehc690IrTbcRgCALRWeLVVOT9cm9Do,10404
21
21
  mwx/plugins/line_profile.py,sha256=--9NIc3x5EfRB3L59JvD7rzENQHyiYfu7wWJo6AuMkA,820
22
22
  mwx/py/__init__.py,sha256=xykgfOytOwNuvXsfkLoumFZSTN-iBsHOjczYXngjmUE,12
23
23
  mwx/py/filling.py,sha256=KaHooM32hrGGgqw75Cbt8lAvACwC6RXadob9LGgNnEc,16806
24
- mwxlib-0.96.5.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
- mwxlib-0.96.5.dist-info/METADATA,sha256=7bmBbSe5QXryHXNY8gbPkgx7wMUMIl-wGVn_esBg5fU,1925
26
- mwxlib-0.96.5.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
27
- mwxlib-0.96.5.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
- mwxlib-0.96.5.dist-info/RECORD,,
24
+ mwxlib-0.96.6.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
+ mwxlib-0.96.6.dist-info/METADATA,sha256=8MHmMhq14c6bbvPdH1uCOk-LxYTijq_07e7ACN_bbpQ,1880
26
+ mwxlib-0.96.6.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
27
+ mwxlib-0.96.6.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
+ mwxlib-0.96.6.dist-info/RECORD,,