From bee60673fb4f342774ba93b169d4366c2439fb18 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 10 Feb 2024 14:56:32 +0100 Subject: [PATCH 1/2] Add README with setup and usage instructions for Python bindings Introduce a comprehensive README for the Python bindings project of the LimeDriver library. The README includes required dependencies for both Debian/Ubuntu and Arch Linux systems, and a step-by-step guide to creating a virtual environment, installing the package using pip, and a basic usage example with Python code demonstrating how to interact with the LimeDriver library. Documentation facilitates easier onboarding and usage of the Python bindings for new users. --- README.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/README.md b/README.md index e69de29..215a19d 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,62 @@ +# Python Bindings for LimeDriver + +This is a Python package for the [LimeDriver](https://github.com/nqrduck/LimeDriver/) library. + +## Dependencies + +To build the Python bindings, you will need to have the dependencies for LimeDriver installed, as well as the Python development headers. + +### Debian/Ubuntu + +```bash +sudo apt-get install g++ cmake libhdf5-dev liblimesuite-dev python3-dev python3-pip python3-venv +``` + +### Arch Linux + +```bash +sudo pacman -S gcc cmake hdf5 limesuite python python-pip +``` + +## Installation + +It is recommended to install the Python bindings in a virtual environment. To create a new virtual environment, run the following commands: + +```bash +python3 -m venv venv +source venv/bin/activate +``` + +The Python bindings can be installed using pip: + +```bash +pip install . +``` + +## Usage + +The Python bindings provide a high-level interface to the LimeDriver library: + +```python +# Import the LimeDriver module +import limedriver + +# Set the number of pulses to generate +Npulses = 1000 + +# Create a new PyLimeConfig object +config = limedriver.PyLimeConfig(Npulses) + +# Modify the config as needed +config.srate = 1e6 + +# Execute the config on the LimeSDR +config.run() + +# Get the path to the output file +filename = config.get_path() + +# Use the built-in HDF5 reader to read the output file +data = limedriver.hdf_reader.HDF(filename) +data.print_params() +``` From 6074ca85a6b359381f4476aeb205e4ed69c6e987 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 10 Feb 2024 15:00:57 +0100 Subject: [PATCH 2/2] Updated README with submodule init instructions Expanded the setup section in the README to include instructions for initializing the LimeDriver submodule before building and installing the Python bindings. This ensures users don't encounter issues due to missing dependencies when trying to install the package. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 215a19d..a7be20b 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,13 @@ python3 -m venv venv source venv/bin/activate ``` -The Python bindings can be installed using pip: +Ensure that the LimeDriver submodule is initialized: + +```bash +git submodule update --init +``` + +Now, the Python bindings can be built and installed using pip: ```bash pip install .