DaphneLib: Python API for DAPHNE
Project description
DaphneLib
Refer to the online documentation:
Setup
The environment variable DAPHNELIB_DIR_PATH
must be set to the directory with libdaphnelib.so
and libAllKernels.so
in it.
export DAPHNELIB_DIR_PATH='pathto/daphne/lib'
Usage
More script examples on github
from daphne.context.daphne_context import DaphneContext
import numpy as np
dc = DaphneContext()
# Create data in numpy.
a = np.arange(8.0).reshape((2, 4))
# Transfer data to DaphneLib (lazily evaluated).
X = dc.from_numpy(a)
print("How DAPHNE sees the data from numpy:")
X.print().compute()
# Add 100 to each value in X.
X = X + 100.0
# Compute in DAPHNE, transfer result back to Python.
print("\nResult of adding 100 to each value, back in Python:")
print(X.compute())
Build
Build Python wheel package:
pip install build
./clean.sh && python3 -m build --wheel
Dev Setup
With editable install
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Publish
Use twine for publishing to PyPI. Install via pip install twine
.
- Set
version
inpyproject.toml
- Build according to Build section
twine check dist/daphne-<version>-py3-none-any.whl
- checks the wheel file
twine upload -u __token__ dist/daphne-<version>-py3-none-any.whl
- to publish to PyPI
- twine prompts for your token
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for daphne_lib-0.3.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0207d31e2be9f655a71fbf098e6318919caee744eb468ba2b26b7e517cc0e436 |
|
MD5 | 70c2ea3d0008232c06865b574cd1d667 |
|
BLAKE2b-256 | 219a4bbf4f6c73b6e1a08f2cc5a287ecc5334fa4342d744b6101995976df72cc |