summaryrefslogtreecommitdiff
path: root/gr-blocks/python
Commit message (Collapse)AuthorAgeFilesLines
...
* blocks: wavfile_sink: allow appending to filesjapm482020-04-141-0/+77
| | | | | | | | | | | | | Fixes issue #1569. Implement an option in wavfile_sink that allows appending sound samples at the end of an existing file. For this, a target WAV file must meet these requirements: - the file must exist (will not be created if it does not). - the last chunk in the file must be DATA. - file params must match the configured ones (i.e. sample_rate, nchan and bits_per_sample).
* blocks: fix wavfile testjapm482020-04-142-9/+23
| | | | | | | | | | | | | | | | | | | | The example test_16bit_1chunk.wav was invalid even if the tests passed. This file caused errors in ffprobe (from ffmpeg) and wave (from python standard lib). This is what changed: - LIST chunk corrected, according to spec. Previously `ffprobe` complained: [wav @ 0x5653f92d6dc0] too short LIST tag - File size corrected. Previously the test assumed that the resulting headers to be identical, this is now taken into account. Because of this, python's `wave` did not work. This is added to the test. Parser is updated to check file size. - Tests that did not close opened files were corrected. References: [1] https://sites.google.com/site/musicgapi/technical-documents/wav-file-format [2] http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf
* gr-blocks Add Msg to Var and Var to Msg Conversion Blocksghostop142020-02-155-0/+147
| | | | | | | | | | | | | | | | These 3 new blocks provide the missing glue to move between messages and variables in the same flowgraph. There are 3 variants here: 1. Monitor a variable and produce a user-specified message (pair) when the variable changes. Useful bridging standard GUI controls to message-based blocks. 2. When an inbound message (pair) is received, update a specified variable. 3. When an inbound message (dict) is received, extract a single dictionary entry and produce a message pair (useful if you have a multi-value dictionary but you just want to pull off a single attribute such as frequency or gain without modifying the upstream block. This can be paired with (2) if necessary to move from a dictionary item to a variable.
* pmt: Fix RuntimeError in pmt_to_pythonMichael Byers2020-02-092-15/+15
| | | | | | | Python has a RuntimeError that's thrown during the pmt to_python function. Instead of throwing this error, SWIG has been updated to throw a TypeError. This allows us to keep the same behavior whereby we iterate over PMT types until the proper conversion is found
* gr-blocks: add tests for throttleClayton Smith2020-02-041-4/+45
|
* Update license header to SPDX formatdevnulling2020-01-2781-1054/+83
|
* ctrlport: qa use new apiBastian Bloessl2019-08-283-14/+7
|
* runtime: update flaky qa test to 3.8 schedulerBastian Bloessl2019-08-221-7/+1
|
* blocks: replace blks2_selector with new implementationJosh Morman2019-06-151-0/+223
| | | | | | | | blks2_selector was deprecated and finally removed This block implements the same functionality but in a way more similar to the Copy block fixes #2460
* blocks: QA: correct conditions for CTRLPORT tests removalMichael Dickens2019-05-281-3/+4
|
* qa: first copy tags from the vector sink before indexingAndrej Rode2019-03-302-13/+16
|
* qa: Use random.seed(0) everywhere import random is usedMartin Braun2018-12-196-1/+6
| | | | | | This affects all Python-based unit tests which use the Python random module. If they do, this change adds random.seed(0) to every setUp() call, so that all QA runs are reproducible.
* blocks: Give qa_moving_average.py a fixed random seedMartin Braun2018-12-171-3/+1
|
* blocks: fix the udp_source_sink test flakinessAndrej Rode2018-12-111-16/+57
| | | | | | | | | Provide one unit test for the source and sink with the raw python socket module. Fix the tests on IPv4 only to avoid mismatched connections on IPv4 & IPv6. Fixes #2210.
* udp: wait a short time after creating starting the receiverAndrej Rode2018-11-301-0/+3
| | | | | | Running unit tests the sender socket could be created before the receiver socket was ready. Try to avoid that by adding a sleep in between the receiver socket creation and the sender socket creation.
* Allow the full range of offsets.Clayton Smith2018-11-021-17/+62
|
* Fix invalid escape sequences.Clayton Smith2018-11-013-14/+14
|
* pdu: pass from_long(1) to "done" due to failing implicit casting from longAndrej Rode2018-09-011-2/+2
|
* Merge remote-tracking branch 'origin/next' into merge_nextMarcus Müller2018-08-3188-1282/+1091
|\
| * qa_message: create unicode string with "u" formatterAndrej Rode2018-08-171-3/+1
| |
| * message: add unicode characters to message testAndrej Rode2018-08-171-0/+8
| |
| * message: fix unit tests to respect mesage::to_string behaviourAndrej Rode2018-08-171-2/+2
| | | | | | | | | | | | | | | | | | Formerly to_string() returned a byte string in Python2 and a unicode string in Python3. To get the same behaviour for Python2 and Python3 the Unicode String in Python3 is converted to bytes. Which is a desired behaviour for to_string() since the carried payload of messages includes invalid unicode characters.
| * py3k: remove the six.b call since only py2.6 support depends on thatAndrej Rode2018-08-171-3/+1
| | | | | | | | | | | | | | | | | | Replace with encode('utf-8') mapping the surrogate mapped characters back to their original byte values. As per documentation http://www.swig.org/Doc3.0/Python.html 36.12.4 Add wrappercode to the swig definition to run python encode for Python3 and return raw bytes for Python2.
| * Changed file_meta_sink's signature to take unserialized pmtMarcus Müller2018-07-141-4/+2
| | | | | | | | | | | | | | | | | | | | For some reason, the block accepts serialized PMT from in-GNU Radio, then unserializes it, then serializes it back. All possible uses probably will prefer just passing the PMT itself. Changing the API inherently fixes the Py3-migration related std::string handling ambiguity.
| * fixup! blocks: hier_block2 now throws RuntimeError instead of ValueError on ↵Martin Braun2018-07-051-1/+1
| | | | | | | | misuse
| * blocks: Fix file source QAMartin Braun2018-06-291-13/+13
| | | | | | | | | | | | - Fixed various linter issues - Fixed file not being opened as binary - Fixed non-Py3k compatible use of range()
| * blocks: Fix QA for file_sink on Py3kMartin Braun2018-06-291-5/+4
| | | | | | | | open() call was not specifying 'rb' (binary file).
| * Merge branch 'python3_fix' into nextAndrej Rode2018-06-2476-584/+686
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manual merge conflict resolution has been applied to following conflicts: * Typos: * gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py * gr-blocks/python/blocks/qa_wavfile.py * gr-filter/examples/gr_filtdes_api.py * grc/blocks/parameter.xml * gr-uhd/python/uhd/__init__.py * ValueError -> RuntimeError: * gr-blocks/python/blocks/qa_hier_block2.py * relative Imports & other Py3k: * gr-digital/python/digital/psk_constellations.py * gr-digital/python/digital/qam_constellations.py * gr-digital/python/digital/test_soft_decisions.py * gr-digital/python/digital/gfsk.py * SequenceCompleter: * gr-utils/python/modtool/modtool_add.py * gr-utils/python/modtool/modtool_rename.py * gr-utils/python/modtool/modtool_rm.py * Updated API on next: * gr-blocks/grc/blocks_file_source.xml * gr-blocks/python/blocks/qa_file_source_sink.py * gr-qtgui/grc/qtgui_time_sink_x.xml * GRC Py3k Updates: * grc/core/Block.py * grc/core/Constants.py * grc/core/Platform.py * grc/core/utils/odict.py * grc/gui/Actions.py * grc/gui/Block.py * grc/gui/Executor.py * grc/gui/Port.py
| | * python: Py3k compatAndrej Rode2018-06-231-2/+2
| | |
| | * Merge branch 'next' into python3Johnathan Corgan2017-10-051-1/+67
| | |\
| | * \ Merge branch 'next' into python3Johnathan Corgan2017-08-271-0/+28
| | |\ \
| | * \ \ Merge branch 'next' into python3Johnathan Corgan2017-08-031-0/+25
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: grc/core/Param.py grc/gui/Application.py grc/gui/NotebookPage.py
| | * \ \ \ Merge branch 'next' into python3Johnathan Corgan2017-07-131-0/+62
| | |\ \ \ \
| | * \ \ \ \ Merge branch 'next' into python3Johnathan Corgan2017-06-221-0/+75
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: gr-uhd/apps/uhd_app.py
| | * \ \ \ \ \ Merge branch 'next' into python3Johnathan Corgan2017-06-221-0/+2
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: gnuradio-runtime/python/gnuradio/gr/tag_utils.py
| | * \ \ \ \ \ \ Merge branch 'next' into python3Johnathan Corgan2017-05-151-41/+38
| | |\ \ \ \ \ \ \
| | * \ \ \ \ \ \ \ Merge branch 'next' into python3Johnathan Corgan2017-04-031-0/+73
| | |\ \ \ \ \ \ \ \
| | * \ \ \ \ \ \ \ \ Merge branch 'next' into python3Johnathan Corgan2017-03-271-0/+66
| | |\ \ \ \ \ \ \ \ \
| | * | | | | | | | | | python3: update non-GRC components to use python2 or python3Douglas Anderson2017-02-2677-586/+689
| | | | | | | | | | | |
| * | | | | | | | | | | file_source: add optional offset (in items) and len (in items)Jeff Long2018-02-084-167/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Adds unit tests, and splits existing unit tests into different files: qa_file_source.py - tests file_source_f qa_file_sink.py - tests file_sink_f qa_file_descriptor_source_sink.py - tests file_descriptor_*_f
| * | | | | | | | | | | qa_file_source_sink.py: create file_source after file has been populatedJeff Long2018-02-081-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test was opening zero-length file and depending on it to be populated later. With addition of offset/length fields, file_source will be required to check file size on open.
| * | | | | | | | | | | blocks: hier_block2 now throws RuntimeError instead of ValueError on misuseAndrej Rode2018-02-061-14/+14
| | | | | | | | | | | |
| * | | | | | | | | | | Merge branch 'master' into nextMartin Braun2018-02-031-1/+1
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | |
| * | | | | | | | | | | Merge branch 'master' into nextJohnathan Corgan2017-10-051-1/+67
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: gr-digital/examples/CMakeLists.txt gr-uhd/lib/usrp_source_impl.cc gr-uhd/lib/usrp_source_impl.h
| * | | | | | | | | | | Merge branch 'master' into nextJohnathan Corgan2017-08-271-0/+28
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | |
| * | | | | | | | | | | Merge branch 'master' into nextJohnathan Corgan2017-08-031-0/+25
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | |
| * | | | | | | | | | | Merge branch 'master' into nextJohnathan Corgan2017-07-131-0/+62
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | |
| * | | | | | | | | | | Merge branch 'master' into nextJohnathan Corgan2017-06-221-0/+75
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | |
| * | | | | | | | | | | Merge branch 'master' into nextJohnathan Corgan2017-06-221-0/+2
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | |
| * | | | | | | | | | | Merge branch 'master' into nextJohnathan Corgan2017-05-151-41/+38
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | |