Compare commits
9 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e9610e9261 | ||
![]() |
f86b162889 | ||
![]() |
4d9a980471 | ||
4a7cdd16b2 | |||
![]() |
51fc0a393d | ||
![]() |
64cda090f0 | ||
![]() |
c0299e9232 | ||
![]() |
2af14f0272 | ||
![]() |
294a95f121 |
8 changed files with 53 additions and 29 deletions
|
@ -4,16 +4,18 @@ on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: node:22-bookworm
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Update package list
|
- name: Update package list
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
apt-get update
|
||||||
|
|
||||||
- name: Install git
|
- name: Install git
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y git
|
apt-get install -y git
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -31,7 +33,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y libhdf5-dev limesuite liblimesuite-dev automake gcc pkg-config build-essential python-is-python3
|
apt-get install -y libhdf5-dev limesuite liblimesuite-dev automake gcc pkg-config build-essential python-is-python3
|
||||||
|
|
||||||
- name: Install the package
|
- name: Install the package
|
||||||
run: |
|
run: |
|
|
@ -4,11 +4,10 @@ on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: archlinux:latest
|
image: archlinux:latest
|
||||||
options: --privileged
|
options: '--privileged'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install git
|
- name: Install git
|
||||||
|
@ -22,7 +21,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
yes | pacman -S python python-pip hdf5 limesuite python-build automake gcc pkgconf base-devel
|
yes | pacman -S python python-pip hdf5 limesuite python-build automake gcc pkgconf base-devel expat
|
||||||
|
|
||||||
- name: Install the package
|
- name: Install the package
|
||||||
run: |
|
run: |
|
|
@ -1,4 +1,4 @@
|
||||||
name: Build, Test, and Upload Python Package
|
name: Build, Test, and Upload Python Package (musllinux)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -16,18 +16,20 @@ jobs:
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: node:22-bookworm
|
||||||
|
|
||||||
# needs: [test]
|
# needs: [test]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Update package list
|
- name: Update package list
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
apt-get update
|
||||||
|
|
||||||
- name: Install git
|
- name: Install git
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y git
|
apt-get install -y git
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
|
@ -1,4 +1,4 @@
|
||||||
name: Build, Test, and Upload Python Package
|
name: Build, Test, and Upload Python Package (sdist and manylinux)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -16,18 +16,20 @@ jobs:
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: node:22-bookworm
|
||||||
|
|
||||||
# needs: [test]
|
# needs: [test]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Update package list
|
- name: Update package list
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
apt-get update
|
||||||
|
|
||||||
- name: Install git
|
- name: Install git
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y git
|
apt-get install -y git
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
19
README.md
19
README.md
|
@ -1,6 +1,6 @@
|
||||||
# Python Bindings for LimeDriver
|
# Python Bindings for LimeDriver
|
||||||
|
|
||||||
This is a Python package for the [LimeDriver](https://github.com/nqrduck/LimeDriver/) library.
|
This is a Python package for the [LimeDriver](https://git.private.coffee/nqrduck/LimeDriver/) library.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
|
@ -27,6 +27,21 @@ python3 -m venv venv
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can install the Python bindings using pip:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install limedriver
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Alternatively you can clone the repository and install the Python bindings from source:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone <this-repo-url>
|
||||||
|
cd LimeDriverBindings
|
||||||
|
```
|
||||||
|
|
||||||
Ensure that the LimeDriver submodule is initialized:
|
Ensure that the LimeDriver submodule is initialized:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -51,7 +66,7 @@ import limedriver
|
||||||
Npulses = 1000
|
Npulses = 1000
|
||||||
|
|
||||||
# Create a new PyLimeConfig object
|
# Create a new PyLimeConfig object
|
||||||
config = limedriver.PyLimeConfig(Npulses)
|
config = limedriver.binding.PyLimeConfig(Npulses)
|
||||||
|
|
||||||
# Modify the config as needed
|
# Modify the config as needed
|
||||||
config.srate = 1e6
|
config.srate = 1e6
|
||||||
|
|
|
@ -11,6 +11,7 @@ classifiers = [
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
"Topic :: Software Development :: Build Tools",
|
"Topic :: Software Development :: Build Tools",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
|
"Operating System :: POSIX :: Linux",
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"h5py",
|
"h5py",
|
||||||
|
@ -38,16 +39,13 @@ extend-select = [
|
||||||
"D", # pydocstyle
|
"D", # pydocstyle
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff.lint.per-file-ignores]
|
|
||||||
"__init__.py" = ["F401"]
|
|
||||||
|
|
||||||
[tool.ruff.lint.pydocstyle]
|
[tool.ruff.lint.pydocstyle]
|
||||||
convention = "google"
|
convention = "google"
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
"Homepage" = "https://nqrduck.cool"
|
"Homepage" = "https://nqrduck.cool"
|
||||||
"Bug Tracker" = "https://github.com/nqrduck/limedriverbindings/issues"
|
"Bug Tracker" = "https://git.private.coffee/nqrduck/limedriverbindings/issues"
|
||||||
"Source Code" = "https://github.com/nqrduck/limedriverbindings"
|
"Source Code" = "https://git.private.coffee/nqrduck/limedriverbindings"
|
||||||
|
|
||||||
[tool.hatch.build.targets.wheel]
|
[tool.hatch.build.targets.wheel]
|
||||||
packages = ["src/limedriver"]
|
packages = ["src/limedriver"]
|
||||||
|
|
|
@ -40,7 +40,7 @@ class HDF():
|
||||||
# initialize data array
|
# initialize data array
|
||||||
dsize = f[HDFkey].shape
|
dsize = f[HDFkey].shape
|
||||||
inddim = dsize[0]
|
inddim = dsize[0]
|
||||||
self.tdy = np.zeros((int(dsize[1]/2), int(dsize[0] * len(HDFkeys))),dtype=np.complex_)
|
self.tdy = np.zeros((int(dsize[1]/2), int(dsize[0] * len(HDFkeys))),dtype=np.complex128)
|
||||||
|
|
||||||
# initialize the output objects
|
# initialize the output objects
|
||||||
self.attrs = [dynclass() for jj in range(len(HDFkeys))]
|
self.attrs = [dynclass() for jj in range(len(HDFkeys))]
|
||||||
|
@ -66,9 +66,15 @@ class HDF():
|
||||||
# Get the data
|
# Get the data
|
||||||
data_raw = np.array(f[HDFkey])
|
data_raw = np.array(f[HDFkey])
|
||||||
try:
|
try:
|
||||||
self.tdy[:,ii*inddim:(ii+1)*inddim] = np.transpose(np.float_(data_raw[:,::2])) + 1j*np.transpose(np.float_(data_raw[:,1::2]))
|
self.tdy[:,ii*inddim:(ii+1)*inddim] = np.transpose(np.float64(data_raw[:,::2])) + 1j*np.transpose(np.float64(data_raw[:,1::2]))
|
||||||
except:
|
except Exception as e:
|
||||||
pass
|
print('Problem reading the data of the HDF file! Error: ' + str(e))
|
||||||
|
self.tdy = []
|
||||||
|
self.tdx = []
|
||||||
|
self.attrs = []
|
||||||
|
self.parsoutp = {}
|
||||||
|
self.parvar = {}
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
# Get the arguments
|
# Get the arguments
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue