mwxlib 1.1.6__py3-none-any.whl → 1.1.7__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
@@ -73,7 +73,7 @@ class Param:
73
73
  v = self.value
74
74
  try:
75
75
  return self.__format(v)
76
- except ValueError:
76
+ except (TypeError, ValueError):
77
77
  return str(v)
78
78
 
79
79
  def __int__(self):
@@ -93,7 +93,7 @@ class Param:
93
93
  return
94
94
  elif isinstance(v, str):
95
95
  try:
96
- v = self.__eval(v.replace(',', '')) # eliminates commas; includes nan, inf
96
+ v = self.__eval(v.replace(',', '')) # eliminates commas
97
97
  except Exception:
98
98
  v = self.value
99
99
  internal_callback = False
@@ -202,9 +202,10 @@ class Param:
202
202
  def index(self):
203
203
  """A knob index -> value.
204
204
  Returns -1 if the value is not defined."""
205
- if self:
206
- return int(np.searchsorted(self.range, self.value))
207
- return -1
205
+ v = self.value
206
+ if np.isnan(v) or np.isinf(v):
207
+ return -1
208
+ return int(np.searchsorted(self.range, v))
208
209
 
209
210
  @index.setter
210
211
  def index(self, j):
@@ -267,7 +268,7 @@ class LParam(Param):
267
268
  v = self.value
268
269
  if np.isnan(v) or np.isinf(v):
269
270
  return -1
270
- return int(round((self.value - self.min) / self.step))
271
+ return int(round((v - self.min) / self.step))
271
272
 
272
273
  @index.setter
273
274
  def index(self, j):
mwx/framework.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "1.1.6"
4
+ __version__ = "1.1.7"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from contextlib import contextmanager
mwx/matplot2g.py CHANGED
@@ -235,11 +235,11 @@ class AxesImagePhantom:
235
235
 
236
236
  @unit.setter
237
237
  def unit(self, v):
238
- if v is None:
238
+ if v is None or np.isnan(v): # nan => undefined
239
239
  v = self.parent.unit
240
240
  self.__localunit = None
241
- elif np.isnan(v) or np.isinf(v):
242
- raise ValueError("The unit value cannot be NaN or Inf")
241
+ elif np.isinf(v):
242
+ raise ValueError("The unit value must not be inf")
243
243
  elif v <= 0:
244
244
  raise ValueError("The unit value must be greater than zero")
245
245
  else:
@@ -802,10 +802,8 @@ class GraphPlot(MatplotPanel):
802
802
 
803
803
  @unit.setter
804
804
  def unit(self, v):
805
- if v is None:
806
- raise ValueError("The globalunit must be non-nil value")
807
- elif np.isnan(v) or np.isinf(v):
808
- raise ValueError("Axis limits cannot be NaN or Inf")
805
+ if v is None or np.isnan(v) or np.isinf(v):
806
+ raise ValueError("The unit value must not be nan or inf")
809
807
  elif v <= 0:
810
808
  raise ValueError("The unit value must be greater than zero")
811
809
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 1.1.6
3
+ Version: 1.1.7
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,11 +1,11 @@
1
1
  mwx/__init__.py,sha256=psabnAMei5VzB2TsB2qBNLrIZMX0LiqjlXCpNGmDejk,668
2
2
  mwx/bookshelf.py,sha256=b_TMDaNIzLHoL0xbbqb3tt0BnRvhLAqaCn_pBdrigZw,7523
3
- mwx/controls.py,sha256=cNZkgwSv90lPIz61FvMtYxHIt8hJD_RQYXxsgTQIdLc,47949
4
- mwx/framework.py,sha256=kqreWhh0wfhBz70vx9b5b8XHJR6BD-TxFbopzl__Ryc,76125
3
+ mwx/controls.py,sha256=trJKRFgum3u-8f8hd6N3qk6jHt4dVqiLgE6CKK5EE4U,47971
4
+ mwx/framework.py,sha256=bgO-mgMMYZtb3cQtPzOyErEVtpSvd9RJEdqFMpcpz6c,76125
5
5
  mwx/graphman.py,sha256=LjN1R8UZxHycrgAfnl_SoTT_vHuKcSISr5VVf0cMflM,69821
6
6
  mwx/images.py,sha256=oxCn0P-emiWujSS2gUgU5TUnr5cPjix2jBcjOBDr24I,48701
7
7
  mwx/matplot2.py,sha256=RuVWXC2A_qgZRNmBBptbHDn5MyxaWBqp3ru4bP_lDE0,33150
8
- mwx/matplot2g.py,sha256=4G5uZJZzATEC3QEVZ4pGHetEDfu5NJNUFyeAaQScK5s,64495
8
+ mwx/matplot2g.py,sha256=dBAODQvSM_yf2uQUCrRO03ZOK3MycR8lEXTJfRXDlbY,64432
9
9
  mwx/matplot2lg.py,sha256=JRWjWnLJUytbSq6wxs4P0gbVUr3xoLSF6Wwqd5V_pJI,27404
10
10
  mwx/mgplt.py,sha256=M5rt-H7Uq1OHnlFvMA4a3945UBvppbR9L_mw8NL_YZ0,5602
11
11
  mwx/nutshell.py,sha256=wzcZSxTM9G2bYtIBri51-AA6JhiKrtfsh-DMgwJZ5io,141340
@@ -22,8 +22,8 @@ mwx/plugins/frame_listview.py,sha256=gowjQ-ARNonMkDSXkQgPKq4U9YBJ-vQ0jK2krBVOdCs
22
22
  mwx/plugins/line_profile.py,sha256=zzm6_7lnAnNepLbh07ordp3nRWDFQJtu719ZVjrVf8s,819
23
23
  mwx/py/__init__.py,sha256=xykgfOytOwNuvXsfkLoumFZSTN-iBsHOjczYXngjmUE,12
24
24
  mwx/py/filling.py,sha256=fumUG1F5M9TL-Dfqni4G85uk7TmvnUunTbdcPDV0vfo,16857
25
- mwxlib-1.1.6.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
26
- mwxlib-1.1.6.dist-info/METADATA,sha256=XXM7dJHiEuRk1rwo-UIfx9wfYFH6A5Vg_POkY0SPSpI,7258
27
- mwxlib-1.1.6.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
28
- mwxlib-1.1.6.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
29
- mwxlib-1.1.6.dist-info/RECORD,,
25
+ mwxlib-1.1.7.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
26
+ mwxlib-1.1.7.dist-info/METADATA,sha256=G8xDeGhF9BCMfozwYrtRmZgMltFt3QcKGv_ka5UjSEg,7258
27
+ mwxlib-1.1.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
28
+ mwxlib-1.1.7.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
29
+ mwxlib-1.1.7.dist-info/RECORD,,
File without changes