mwxlib 0.93.7__py3-none-any.whl → 0.93.9__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/framework.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "0.93.7"
4
+ __version__ = "0.93.9"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from functools import wraps, partial
mwx/matplot2g.py CHANGED
@@ -393,7 +393,7 @@ class GraphPlot(MatplotPanel):
393
393
  def __init__(self, *args, **kwargs):
394
394
  MatplotPanel.__init__(self, *args, **kwargs)
395
395
 
396
- def _draw_idle(v):
396
+ def _draw(v):
397
397
  self.canvas.draw_idle()
398
398
 
399
399
  self.handler.update({ # DNA<GraphPlot>
@@ -408,16 +408,16 @@ class GraphPlot(MatplotPanel):
408
408
  'frame_updated' : [ None, _F(self.writeln) ], # unit,name,ratio => update_extent
409
409
  'frame_cmapped' : [ None, _F(self.writeln) ], # cmap
410
410
  'line_draw' : [ None ],
411
- 'line_drawn' : [ None, _draw_idle ],
411
+ 'line_drawn' : [ None, _draw ],
412
412
  'line_move' : [ None ],
413
- 'line_moved' : [ None, _draw_idle ],
414
- 'line_removed' : [ None, _draw_idle ],
413
+ 'line_moved' : [ None, _draw ],
414
+ 'line_removed' : [ None, _draw ],
415
415
  'mark_draw' : [ None ],
416
- 'mark_drawn' : [ None, _draw_idle ],
417
- 'mark_removed' : [ None, _draw_idle ],
416
+ 'mark_drawn' : [ None, _draw ],
417
+ 'mark_removed' : [ None, _draw ],
418
418
  'region_draw' : [ None ],
419
- 'region_drawn' : [ None, _draw_idle ],
420
- 'region_removed' : [ None, _draw_idle ],
419
+ 'region_drawn' : [ None, _draw ],
420
+ 'region_removed' : [ None, _draw ],
421
421
  'M-up pressed' : [ None, self.OnPageUp ],
422
422
  'M-down pressed' : [ None, self.OnPageDown ],
423
423
  'pageup pressed' : [ None, self.OnPageUp ],
@@ -440,7 +440,7 @@ class GraphPlot(MatplotPanel):
440
440
  'r pressed' : (REGION, self.OnRegionAppend, self.OnEscapeSelection),
441
441
  'r+Lbutton pressed' : (REGION, self.OnRegionAppend, self.OnEscapeSelection),
442
442
  'M-Lbutton pressed' : (REGION, self.OnRegionAppend, self.OnEscapeSelection),
443
- 'escape pressed' : (NORMAL, self.OnEscapeSelection, _draw_idle),
443
+ 'escape pressed' : (NORMAL, self.OnEscapeSelection, _draw),
444
444
  'shift pressed' : (NORMAL, self.on_picker_lock),
445
445
  'shift released' : (NORMAL, self.on_picker_unlock),
446
446
  'Lbutton pressed' : (NORMAL, self.OnDragLock),
@@ -502,7 +502,7 @@ class GraphPlot(MatplotPanel):
502
502
  'right released' : (MARK, self.OnMarkShiftEnd),
503
503
  'n pressed' : (MARK, self.OnMarkSkipNext),
504
504
  'p pressed' : (MARK, self.OnMarkSkipPrevious),
505
- 'escape pressed' : (NORMAL, self.OnMarkDeselected, _draw_idle),
505
+ 'escape pressed' : (NORMAL, self.OnMarkDeselected, _draw),
506
506
  'delete pressed' : (MARK, self.OnMarkRemove),
507
507
  'space pressed' : (PAN, self.OnPanBegin),
508
508
  'ctrl pressed' : (PAN, self.OnPanBegin),
@@ -531,7 +531,7 @@ class GraphPlot(MatplotPanel):
531
531
  'down released' : (REGION, self.OnRegionShiftEnd),
532
532
  'left released' : (REGION, self.OnRegionShiftEnd),
533
533
  'right released' : (REGION, self.OnRegionShiftEnd),
534
- 'escape pressed' : (NORMAL, self.OnRegionDeselected, _draw_idle),
534
+ 'escape pressed' : (NORMAL, self.OnRegionDeselected, _draw),
535
535
  'delete pressed' : (NORMAL, self.OnRegionRemove),
536
536
  'space pressed' : (PAN, self.OnPanBegin),
537
537
  'ctrl pressed' : (PAN, self.OnPanBegin),
mwx/matplot2lg.py CHANGED
@@ -26,6 +26,10 @@ class LinePlot(MatplotPanel):
26
26
  MatplotPanel.__init__(self, *args, **kwargs)
27
27
 
28
28
  self.handler.update({ # DNA<LinePlot>
29
+ None : {
30
+ 'region_set' : [ None ],
31
+ 'region_unset' : [ None ],
32
+ },
29
33
  NORMAL : {
30
34
  'escape pressed' : (NORMAL, self.OnEscapeSelection),
31
35
  'delete pressed' : (NORMAL, self.OnEscapeSelection),
@@ -78,10 +82,12 @@ class LinePlot(MatplotPanel):
78
82
  v = np.array((a, b))
79
83
  self.__vspan.set_visible(1)
80
84
  self.__vspan.set_xy(((a,0), (a,1), (b,1), (b,0)))
85
+ self.handler('region_set', self.frame)
81
86
  else:
82
87
  self.__vspan.set_visible(0)
88
+ self.handler('region_unset', self.frame)
83
89
  self.__region = v
84
-
90
+
85
91
  @region.deleter
86
92
  def region(self):
87
93
  self.region = None
@@ -92,13 +98,14 @@ class LinePlot(MatplotPanel):
92
98
  self.__annotations = []
93
99
 
94
100
  #<matplotlib.text.Annotation>
95
- def annotation(v, xy, xytext,
96
- xycoords='data', textcoords='offset points', **arrowprops):
97
- return self.axes.annotate('' if v is None else '{:g}'.format(v),
101
+ def annotation(v, xy, xytext, xycoords='data',
102
+ textcoords='offset points', **arrowprops):
103
+ return self.axes.annotate(
104
+ '' if v is None else '{:g}'.format(v),
98
105
  xy, xytext, xycoords, textcoords, arrowprops, size='small')
99
106
 
100
- if self.__region is not None:
101
- a, b = self.__region
107
+ if self.region is not None:
108
+ a, b = self.region
102
109
  x = (b + a) / 2
103
110
  y = self.ylim[0] + 20/self.ddpu[1]
104
111
  if (b - a) > 60/self.ddpu[0]:
@@ -335,10 +342,7 @@ class Histogram(LinePlot):
335
342
  ## Motion/Drag actions (override)
336
343
  ## --------------------------------
337
344
 
338
- def OnDraw(self, evt):
339
- """Called before canvas.draw."""
340
- ## LinePlot.OnDraw(self, evt) ---> do not annotate
341
-
345
+ def annotate(self):
342
346
  if self.__frame:
343
347
  x, y = self.__frame.__data
344
348
  if len(x) > 1:
@@ -616,6 +620,14 @@ class LineProfile(LinePlot):
616
620
  Clipboard.write(o.getvalue(), verbose=0)
617
621
  self.message("Write data to clipboard.")
618
622
 
623
+ def annotate(self):
624
+ LinePlot.annotate(self)
625
+
626
+ x, y = self.plotdata
627
+ if x.size:
628
+ self.__fil.set_xy(list(chain([(x[0],0)], zip(x,y), [(x[-1],0)])))
629
+ self.writeln()
630
+
619
631
  ## --------------------------------
620
632
  ## Motion/Drag actions (override)
621
633
  ## --------------------------------
@@ -634,15 +646,6 @@ class LineProfile(LinePlot):
634
646
  self.toolbar.push_current()
635
647
  self.draw()
636
648
 
637
- def OnDraw(self, evt):
638
- """Called before canvas.draw."""
639
- LinePlot.OnDraw(self, evt)
640
-
641
- x, y = self.plotdata
642
- if x.size:
643
- self.__fil.set_xy(list(chain([(x[0],0)], zip(x,y), [(x[-1],0)])))
644
- self.writeln()
645
-
646
649
  def OnLineWidth(self, evt):
647
650
  n = -2 if evt.key[-1] == '-' else 2
648
651
  self.set_linewidth(self.__linewidth + n)
@@ -665,9 +668,6 @@ class LineProfile(LinePlot):
665
668
  """Show average value."""
666
669
  y = self.calc_average()
667
670
  if y is not None:
668
- ## self.__hline.set_ydata([y])
669
- ## self.__hline.set_visible(1)
670
- ## self.canvas.draw_idle()
671
671
  self.message(f"ya = {y:g}")
672
672
 
673
673
  def OnRegionLock(self, evt):
@@ -0,0 +1,2 @@
1
+ #! python3
2
+ """Plug-ins and add-ins."""
@@ -7,7 +7,8 @@ from numpy.fft import fft2,ifft2,fftshift,ifftshift
7
7
  ## from scipy.fftpack import fft,ifft,fft2,ifft2 Memory Leak? <scipy 0.16.1>
8
8
  ## import cv2
9
9
 
10
- from jgdk import Layer, Param
10
+ from mwx.graphman import Layer
11
+ from mwx.controls import Param
11
12
  import editor as edi
12
13
 
13
14
 
mwx/py/__init__.py CHANGED
@@ -1,2 +1 @@
1
1
  #! python3
2
- """Plug-ins / Add-ins."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 0.93.7
3
+ Version: 0.93.9
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
@@ -1,12 +1,12 @@
1
1
  mwx/__init__.py,sha256=5B4YSOuijG1Uo5-FLtLHGB52Cp_F4vnN--4wGPBx7do,2398
2
2
  mwx/bookshelf.py,sha256=FrissUYdGXLABOzJmMaQU6GXvu6n_9DVW3d5wGwQzjM,6613
3
3
  mwx/controls.py,sha256=9C1sXBwQl-oZtCb3rXoT-doW48Sv1J359toNq9ScF9M,47173
4
- mwx/framework.py,sha256=HiXX52Go64R167S9GiKs1SEbkxx-sMps88VDI9mIw5w,73951
4
+ mwx/framework.py,sha256=Q_QSjaa3EwydXi_ON56rvhxWF79M3e_uvgIFq2jw7Ho,73951
5
5
  mwx/graphman.py,sha256=SKYJFxi-TqWOALRczYz-M-2ZYEbqiZuAuKCfEIedctY,70156
6
6
  mwx/images.py,sha256=mrnUYH12I3XLVSZcEXlpVltX0XMxufbl2yRvDIQJZqc,49957
7
7
  mwx/matplot2.py,sha256=qaF_gvLoLn-TimLbRR59KUavNr1ZpZQdSMqjzJk47rk,32682
8
- mwx/matplot2g.py,sha256=Txcz3yusiFF0j1QnAS0dCGTbGrkx4VC6BZbWbjIRZnw,65585
9
- mwx/matplot2lg.py,sha256=nKXxy1XZRLTo0WijeIGd0WtQrlSpI1cxkGRwCktrJjY,27263
8
+ mwx/matplot2g.py,sha256=Ca-3RJZmSiZcvNrXmeK_lFf2fdG-0gkp7dYkCtrKi2I,65530
9
+ mwx/matplot2lg.py,sha256=tg8u7w4DxiJdPN-E197NOmbQpc_1gZkgDHYv_xUhbFA,27224
10
10
  mwx/mgplt.py,sha256=ITzxA97yDwr_35BUk5OqnyskSuKVDbpf2AQCKY1jHTI,5671
11
11
  mwx/nutshell.py,sha256=5HErOObnOprMc6gYnXV7wY-ALnlwNpmhV8f0EyipYA4,135816
12
12
  mwx/utilus.py,sha256=THDxQ-QqbHYVc8iX8qN9yxvfcf7Pvpm7sfTP9ipYvzs,37040
@@ -14,14 +14,15 @@ mwx/wxmon.py,sha256=Qk86VbuuW2rR46pqEYLur13G_aloWz5SVv6sib30YY0,12717
14
14
  mwx/wxpdb.py,sha256=2z3ZD9Oo1H-ONBHlaprkB9hrTmAI7o03sqO46ppEFE4,19129
15
15
  mwx/wxwil.py,sha256=JK1du4i1RVMbDLqN8jLRDSu_JhKEp4mhHVMElzo4yoE,5578
16
16
  mwx/wxwit.py,sha256=2gFHi-8nwWRh26RdvZ_AUP--8PDjJB8TUU72y2fBUWM,7557
17
- mwx/py/__init__.py,sha256=NzBazvjN9KMFoylsHsLiNOHbcDrNflgSwEFlkT12Rnw,39
18
- mwx/py/ffmpeg_view.py,sha256=vUYNybIJsF1JGkDzjBgDyBQvDh8e1oKHlEMY5Fwc8L4,9399
19
- mwx/py/fft_view.py,sha256=1bc6e6muXoo2EHV-w1w4glB7ecPjc6aQXlbX-UplC6I,2642
17
+ mwx/plugins/__init__.py,sha256=jnJ-Sl9XJ_7BFDslD_r7dsbxsOT57q_IaEriV53XIGY,41
18
+ mwx/plugins/ffmpeg_view.py,sha256=vUYNybIJsF1JGkDzjBgDyBQvDh8e1oKHlEMY5Fwc8L4,9399
19
+ mwx/plugins/fft_view.py,sha256=evj2kCe6N10JQczW8IajgLVrUWOihQaHQ2xiBzAsAl4,2675
20
+ mwx/plugins/frame_listview.py,sha256=T-2xSv_D2bk9fJ64aiSEe1rJRTeqaIpLVAYEUXW5vz8,10110
21
+ mwx/plugins/line_profile.py,sha256=WJB5z7F53yg4dII2R36IFZvtkSOGWT669b1HmAAXSnQ,816
22
+ mwx/py/__init__.py,sha256=xykgfOytOwNuvXsfkLoumFZSTN-iBsHOjczYXngjmUE,12
20
23
  mwx/py/filling.py,sha256=KaHooM32hrGGgqw75Cbt8lAvACwC6RXadob9LGgNnEc,16806
21
- mwx/py/frame_listview.py,sha256=T-2xSv_D2bk9fJ64aiSEe1rJRTeqaIpLVAYEUXW5vz8,10110
22
- mwx/py/line_profile.py,sha256=WJB5z7F53yg4dII2R36IFZvtkSOGWT669b1HmAAXSnQ,816
23
- mwxlib-0.93.7.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
24
- mwxlib-0.93.7.dist-info/METADATA,sha256=7uW6eS4CsshRUk0W1Qf7o4qqcpVZNJjbA-KKyWW-zQc,1925
25
- mwxlib-0.93.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
26
- mwxlib-0.93.7.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
27
- mwxlib-0.93.7.dist-info/RECORD,,
24
+ mwxlib-0.93.9.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
+ mwxlib-0.93.9.dist-info/METADATA,sha256=nAajTF4HxuXA8Mee0naQz9t8mxUyduim3U5C0Dwjo7E,1925
26
+ mwxlib-0.93.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
27
+ mwxlib-0.93.9.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
+ mwxlib-0.93.9.dist-info/RECORD,,
File without changes
File without changes
File without changes