A Python interface for the TERSE library using pybind11.
Project description
PyTERSE
Python package of TERSE/PROLIX diffraction and cryo-EM data compression algorithm
The pyTERSE python package uses the c++ TERSE/PROLIX(TRPX) compression algorithm scheme (https://github.com/senikm/trpx) and adds python binders to it's main class. After the compilation the build directory contains the python compression library, which can be imported to a python environment.
How to Install the Package
Create a virtual environment with pybind and cmake
For example:
mamba create -n pyterse python cmake pip pybind11 numpy pillow
OR
conda create -n pyterse python cmake pip pybind11 numpy pillow
And then install the package
pip install pyterse_master.zip
How to compile the code
First, navigate to the project directory. Then, execute the following commands:
mkdir build
cd build
cmake ..
make
Alternatively, if you want to distribute the package, run the following command:
python3 setup.py sdist --inplace
Or run the following command to install the pip package:
pip3 install --use-feature=in-tree-build .
- Please note that in case of specific builds special care should be taken for these lines in root CmakeLists.txt: the paths of python and pybinder may be hardcoded based on specific needs before the compilation
# Find Python and PyBind11
find_package(Python REQUIRED COMPONENTS Interpreter Development)
find_package(pybind11 REQUIRED)
Testing the functionality of the library
Basic commands
- Create terse object:
terse = Terse()
- Add data to Terse object:
terse.push_back(data)
- Save compressed data to a file:
terse.save('filename.trpx')
- Load compressed data from a file:
loaded_terse = Terse.load('filename.trpx')
- Decompress a specific frame:
decompressed_frame = loaded_terse.prolix(frame_index)
Running the test file.
python3 test.py
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyterse-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyterse-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 130.2 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85aed943cd34df74e4e1fe67fd43978887c700fb2460ed5d980dd96ca4dfc5af
|
|
| MD5 |
84d470c0a56284eeae2f8ae597197c94
|
|
| BLAKE2b-256 |
9d53fbf2b664aee6429da2c7f720bf8a4cda3f9af23926eca5b86490babf70c7
|
File details
Details for the file pyterse-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyterse-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 113.5 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e3d46925a38fca2c86aaf24aa4c1549d42049ad3b0af92a67710ad159d39e44
|
|
| MD5 |
1159ab92b5aaa66dfb19b69bb2bc8b48
|
|
| BLAKE2b-256 |
95fe1374585be6652d566a5beadfdd8deaccf101d15763fd559e427a4d2507bc
|
File details
Details for the file pyterse-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyterse-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 128.4 kB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c99c8cd52cb98b37e79d3003d5e9facd6e09dfb7998604d8f4555239fed45e27
|
|
| MD5 |
d0360ed45ee96ca8d04294c57f76160b
|
|
| BLAKE2b-256 |
7a8d4af94bf0be4c9a65c54977d680c4f2d9c2124e5d000a36fc05589b4c3007
|
File details
Details for the file pyterse-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyterse-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 112.1 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c37c5c1b89ccd33bb8fcf83a58aab7f382b8b426986640eb2811085918646e32
|
|
| MD5 |
6ab78462ee0520edb87846d662af15b1
|
|
| BLAKE2b-256 |
c45cfb186d975ea8192e2df4bea4e7ada386c3d754c50234ed63665024abd5d6
|
File details
Details for the file pyterse-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyterse-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 128.6 kB
- Tags: CPython 3.9, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9898353f231297a63d9555b03e09223be927f0feedecac0894a306164a0d359
|
|
| MD5 |
e01f075d24470bf175169cb4a528f84b
|
|
| BLAKE2b-256 |
42c07cff235cf5ed7d82332cabc4b90108170d2e89efa7869aca737b48ef12d4
|
File details
Details for the file pyterse-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyterse-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 112.2 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cca4b17836cf8b80083593635286cd7da881ecabebf5964bc4f2436454a00634
|
|
| MD5 |
1b77ed7e9bd680f6f18a262c9d8264c0
|
|
| BLAKE2b-256 |
8bb00c6b4b24216c5d44c0a2f510ce9162f853c9a60bae35014b32dd1f97269e
|