projects
/
h5config.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e8e8a1
)
Adjust ChoiceSetting.convert_from_text to handle numpy character ndarrays.
author
W. Trevor King
<wking@drexel.edu>
Sun, 25 Sep 2011 23:39:17 +0000
(19:39 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Sun, 25 Sep 2011 23:39:17 +0000
(19:39 -0400)
h5config/config.py
patch
|
blob
|
history
diff --git
a/h5config/config.py
b/h5config/config.py
index 0dd6898228f1899b7b3597c4f10ff631c7532f22..5fab0050734e10439ae707d3a3609efdef4d2169 100644
(file)
--- a/
h5config/config.py
+++ b/
h5config/config.py
@@
-20,6
+20,8
@@
import copy as _copy
+import numpy as _numpy
+
from . import LOG as _LOG
@@
-83,6
+85,9
@@
class ChoiceSetting (Setting):
return ret.strip()
def convert_from_text(self, value):
+ if (isinstance(value, _numpy.ndarray) and
+ value.dtype.type == _numpy.string_):
+ value = str(value)
return dict(self.choices)[value]
def convert_to_text(self, value):