[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 05/15: renamed and cleaned up a bit
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 05/15: renamed and cleaned up a bit |
Date: |
Thu, 10 Apr 2014 19:38:17 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit ac33347c3e685b25be611d4405521e36310852a8
Author: Marcus Müller <address@hidden>
Date: Mon Apr 7 22:06:05 2014 +0200
renamed and cleaned up a bit
---
gnuradio-runtime/python/pmt/pmt_to_python.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gnuradio-runtime/python/pmt/pmt_to_python.py
b/gnuradio-runtime/python/pmt/pmt_to_python.py
index 83b209d..3344eba 100644
--- a/gnuradio-runtime/python/pmt/pmt_to_python.py
+++ b/gnuradio-runtime/python/pmt/pmt_to_python.py
@@ -63,7 +63,6 @@ def pmt_from_dict(p):
d = pmt.dict_add(d, python_to_pmt(k), python_to_pmt(v))
return d
- #(numpy.float32,pmt.init_f32vector, float, pmt.f32vector_elements,
pmt.is_f32vector),
numpy_mappings = {
numpy.dtype(numpy.float32): (pmt.init_f32vector, float,
pmt.f32vector_elements, pmt.is_f32vector),
numpy.dtype(numpy.float64): (pmt.init_f64vector, float,
pmt.f64vector_elements, pmt.is_f64vector),
@@ -99,7 +98,7 @@ def uvector_to_numpy(uvector):
else:
raise ValueError("unsupported uvector data type for conversion
to numpy array %s"%(uvector))
-THE_TABLE = ( #python type, check pmt type, to python, from python
+type_mappings = ( #python type, check pmt type, to python, from python
(None, pmt.is_null, lambda x: None, lambda x: pmt.PMT_NIL),
(bool, pmt.is_bool, pmt.to_bool, pmt.from_bool),
(str, pmt.is_symbol, pmt.symbol_to_string, pmt.string_to_symbol),
@@ -115,12 +114,12 @@ THE_TABLE = ( #python type, check pmt type, to python,
from python
)
def pmt_to_python(p):
- for python_type, pmt_check, to_python, from_python in THE_TABLE:
+ for python_type, pmt_check, to_python, from_python in type_mappings:
if pmt_check(p): return to_python(p)
raise ValueError("can't convert %s type to pmt (%s)"%(type(p),p))
def python_to_pmt(p):
- for python_type, pmt_check, to_python, from_python in THE_TABLE:
+ for python_type, pmt_check, to_python, from_python in type_mappings:
if python_type is None:
if p == None: return from_python(p)
elif isinstance(p, python_type): return from_python(p)
- [Commit-gnuradio] [gnuradio] branch master updated (cd06fdc -> 4b55c7f), git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 12/15: digital: white space removal., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 10/15: grc: validate params only on focus-out, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 11/15: Merge remote-tracking branch 'mmueller/pmt_to_python-py2.6-compat', git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 06/15: Merge branch 'master' of github:gnuradio/gnuradio into pmt_to_python-py2.6-compat, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 02/15: qtgui: fixing up some minor parameters., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 09/15: grc: move FileParam to gui module, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 05/15: renamed and cleaned up a bit,
git <=
- [Commit-gnuradio] [gnuradio] 04/15: pmt_to_python: numpy_to_uvector and reverse works, QA added, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 01/15: set numpy_mappings -> dict, to fix py2.6 incompatibility, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 07/15: grc: adding param templates, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 03/15: volk: changes QA code to use volk_malloc and volk_free., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 14/15: digital: fix for issue #663., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 15/15: digital: updated test_corr_and_sync to give time sink lines default labels., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 13/15: digital: fix for issue #664., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 08/15: qtgui: changing line config params to use base_key to make cleaner., git, 2014/04/10