aboutsummaryrefslogtreecommitdiffstats
path: root/host/python
Commit message (Collapse)AuthorAgeFilesLines
* uhd: cal: Add database classMartin Braun2020-03-261-0/+19
| | | | | | This class contains methods to store and retrieve data from the local calibration database. Note that in this case, the "database" is just a bunch of files on the local filesystem.
* python: Export UHD paths utility functionsMartin Braun2020-03-122-0/+6
| | | | | | | | | All of the functions defined in uhd/utils/paths.hpp are now available in Python, with the exception of get_module_paths(). #!/usr/bin/env python3 import uhd print(uhd.get_lib_path()) # Prints location of libuhd
* python: Remove Python2-specific codeMartin Braun2020-03-121-7/+0
|
* python: Arrange file in Python module into uhd/ subdirectoryMartin Braun2020-03-108-21/+54
| | | | | | | | | | | | | | | This adds the host/python/uhd subdirectory, which will add all files that go into the actual Python module once installed. Before, all Python files were directly in host/python and got sorted into their appropriate destination folders during configuration and installation. This change doesn't change anything (Python modules will look the same as they do now), except that it makes the source tree a tad neater, but more importantly, it creates a consistent directory structure when adding submodules to the uhd module. Apart from the PyBind11-generated shared object file (which gets generated during build time), the uhd/ subdirectory in host/python exactly resembles the Python module once installed, so it's more obvious where to add new submodules and files.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-031-11/+7
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* python: Set python module suffix to conform with PEP 3149.Ryan Volz2020-02-071-1/+10
| | | | | | | | | This adds the python implementation, major and minor version numbers, and any additional flags (debug, pymalloc, wide unicode) to the extension module suffix as specified in PEP 3149. Hat tip to @isuruf: https://github.com/conda-forge/staged-recipes/pull/10076#discussion_r348721448
* python: Do not link against python lib for building an extension module.Ryan Volz2020-02-071-1/+10
| | | | | | | | | | | | This fixes a segmentation fault when trying to use the python module on OSX when built with conda (unsure why it doesn't arise otherwise). Instead of linking against the python library, it is proper to not link against the library and, for OSX builds, add linker options for "-undefined" and "dynamic_lookup". This is precisely what the CMake FindPython module does for linking against the Python::Module target. See https://blog.tim-smith.us/2015/09/python-extension-modules-os-x and https://bugs.python.org/issue36721
* python: Fix internal library name (incl. suffix) to match filename.Ryan Volz2020-02-071-7/+7
| | | | | | Instead of renaming the library file, this sets the suffix in CMake so that the filename turns out as desired and also linker references know the correct name.
* python: rfnoc: finishing noc_block_base::get_mtuBrent Stapleton2020-01-061-0/+2
| | | | | | | Adding bindings for res_source_info, which allows us to use noc_block_base::get_mtu. Fixes: 400b00c34338 ("rfnoc: adding RFNoC Python API")
* rfnoc: adding RFNoC Python APIBrent Stapleton2020-01-024-0/+26
| | | | | | | | Adding Python bindings for the RFNoC API. This includes the rfnoc_graph, noc_block_base, and several other supporting classes. Templated functions are not currently supported. For example, `rfnoc_graph::get_block` can only return the basic block controller.
* uhd: Replace usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-261-5/+0
| | | | | | | | | | | | | | | | | | | This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include <memory>. Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct.
* python: MultiUSRP: Fix send_waveforms()iprivit2019-11-131-1/+1
| | | | | | | | | | | | | The send_waveform() function takes the waveform_proto array and if it has only 1 channel, explicitly reshapes it to be (1, waveform_proto.size), or uses np.tile to replicate the waveform_proto array over X channels. It then proceeds to loop over the waveform_proto array, but attempts to do so over the channel dimension instead of looping over the actual samples. This results in sending the entire waveform_proto array regardless of the duration specified. The fix is to specify the dimension in which it crops, and not crop in dimension of the channels.
* python: Included complex.h to allow pybind to convert that data typeerickshepherdNI2019-11-011-0/+1
|
* cmake: Remove ENABLE_PYTHON3 flag and simplify Python detectionMartin Braun2019-05-241-1/+1
| | | | | | - Makes use of more modern find_package(Python2/3) if available - Moves almost all Python-related code to UHDPython.cmake - ENABLE_PYTHON3 is no longer necessary
* cmake: python: Remove stray message()Martin Braun2019-05-211-1/+0
|
* python: change CMake variable for library extBrent Stapleton2019-03-061-1/+1
| | | | | | | Changing the CMake variable used in determining the extension of the Python API library for better cross-platform support. Specifically, `CMAKE_SHARED_MODULE_SUFFIX` corresponds to .so for *nix and MacOS, which is the extension Python expects.
* python: cmake: Use native format for setup.pyTrung Tran2019-02-252-2/+3
| | | | | | | setuptools isn't compatible with Unix style path on Windows 10 machines. We need to convert any path before running setuptools. Signed-off-by: Trung Tran <trung.tran@ettus.com>
* python: Replace Boost.Python with PyBind11Martin Braun2019-02-223-158/+37
| | | | | | This does not change the Python API itself, but it is still a significant change. Most importantly, it removes the dependency on Boost.Python.
* python: Add sync source to Python APIBrent Stapleton2018-11-291-0/+9
| | | | Exposing getters, setters, and options for multi_usrp sync source.
* python: adding device_addr_t to Python APIBrent Stapleton2018-11-141-0/+1
| | | | | | | Add support for device_addr_t to the Python API. Most functions are exposed normally. The main exception is the constructor from a map of strings, which is replaced by a factory function called `make_device_addr`.
* cmake: Update coding style to use lowercase commandsMartin Braun2018-11-141-26/+26
| | | | | | | | | | | | | | | | | Also updates our coding style file. Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code (with GNU compliant sed): cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done > convert.sed \ && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \ '*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed (Make sure the backslashes don't get mangled!)
* python: Fixing Boost.Python initializer visibilityMarcus Müllr2018-08-032-2/+13
| | | | | | With Boost 1.64 to 1.65 (which, of course, Ubuntu LTS ships), the `PyInit_Libraryname` are invisible when one sets the default visibility to "hidden" (which is reasonable, and which we do).
* uhd: python: CMakeLists.txt change dll to pydTrung Tran2018-08-011-1/+7
| | | | To support python api installer
* python: Fixup for Python API install directoryBrent Stapleton2018-07-271-3/+15
| | | | | | | | | | The Python API should now be installed to `PREFIX/lib/pythonVER/dist-packages/uhd` where the PREFIX is set by CMake and the Python version is determined by the Python module `distutils`. This should match user expectations much more than the previous behavior. Behavior in Virtualenvs is unchanged.
* cmake: add support to make python api installer on windowsTrung Tran2018-07-131-6/+2
|
* Python: Remove Unnecessary Metadata AssignmentVidush2018-06-201-1/+0
|
* python: removing unnecessary configurationThibaud Marazano2018-06-201-1/+0
| | | | | | | Removed "set_tx_rate" that sets all channels initially, because the channel loop handles this. Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
* python: Separating exposed Python data structuresPaul David2018-06-208-638/+349
| | | | | | | | | - Separating exposed Python data structures into logical sections - Exposes all of the multi_usrp API - Adds a layer of Python for documentation and adding helper methods - Adds improvements and fixes to the MultiUSRP object - Includes additional exposed data structures (like time_spec_t, etc.) - Add code to release the Python GIL during long C++ calls
* python: Initial commit of Python APIAndrej Rode2018-06-205-0/+777
Initial commit of the Python API using Boost.Python. Bind the MultiUSRP API for use in Python. Bindings intended to provide as complete coverage as possible. - Wrap most multi_usrp calls - Adding multi channel send/recv examples in examples/python - Adding setuptools support - Initial attempt at binding the UHD types and filters