all your matrix representations belong here!
Project description
mattress
This project provides tatami matrix representations in Python.
Install
Package is published to PyPI
pip install mattress
Usage
Dense matrices
To convert a numpy dense matrix to tatami representation -
import numpy as np
from mattress import tatamize
x = np.random.rand(1000, 100)
tatamat = tatamize(y)
Methods
Methods are available to access the matrix by row
, column
tatamat.row(0)
tatamat.column(1)
Also works if the matrix is row-major order.
x = np.ones((2, 3), order='F')
tatamat = tatamize(y)
Is your matrix sparse?
from scipy.sparse import rand
m = rand(3, 4, density=0.25, format="csr", random_state=42)
tatamat = tatamize(m)
Developer Notes
Steps to setup dependencies -
- initialize git submodules in
extern/tatami
&extern/tatami_hdf5
First one needs to build the extern library, this would generate a shared object file to src/mattress/core-[*].so
python setup.py build_ext --inplace
For typical development workflows, run this for tests
python setup.py build_ext --inplace && tox
To rebuild the ctypes bindings with the wrap.py
helper
wrap.py src/mattress/lib --py src/mattress/cpphelpers.py --cpp src/mattress/lib/bindings.cpp
Note
This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.
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 Distribution
Built Distributions
Hashes for mattress-0.0.6-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38e81e102d17712c6158c90e374d33ff738ef91c92387f330cf6fb2393fcf281 |
|
MD5 | 84663a6467f478008ce8a9838731f503 |
|
BLAKE2b-256 | db25948b9b89cee04f5fdfb30732d8b8930b35ccb13b0690847c1ef4c8f61c86 |
Hashes for mattress-0.0.6-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ce5e3ede9131880b95a290dcabb86b60b0849f27351dacf0ce287f3c0158173 |
|
MD5 | 83cc7e38676ad0cd601b27e4c9a80056 |
|
BLAKE2b-256 | b035763b6a8f17d5e0a8e470088fbc32c2a5011904c446fcc524e1dd4fdcce27 |
Hashes for mattress-0.0.6-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6189f075e0148e17d47db1b78a358fe3153ac4feee965b16f284b4a606f56fae |
|
MD5 | 0a54c22657858f0f51fdf0f6f3b86bba |
|
BLAKE2b-256 | bb4346ee63c50afd5d27de21b6a3684b6d9ec9a0ac4d379108e7f190d42de290 |
Hashes for mattress-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d271d3e8ab84c6169ac863263927cbf6b476e9c4879531f0ec5415736b975b5c |
|
MD5 | 6883e2bdffb258857609bd9427c2cd58 |
|
BLAKE2b-256 | 1de5e3edc3f0508fe7462a7e17ea60b61a6a36d20ec405f441ff208a70b1da8b |
Hashes for mattress-0.0.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a751a6037d179fdc62464a92d45afcc2db4d64becd6a05495ce1c5e473bb9699 |
|
MD5 | 36b3f266630c8b5e1867e5274201cede |
|
BLAKE2b-256 | 8cb9f7249fc2afdc0cf876679a6445509983698f0db43f8a7ffdc0df19bc98a8 |
Hashes for mattress-0.0.6-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dc4b15e3f90bfcf926be8adaa6060abad89353c3b9172a38c164e84d6a3251e |
|
MD5 | 4a9df03d232e17b69b66e09c615e1c24 |
|
BLAKE2b-256 | d853d1d34f9c3994133cdea5087207fdec18e162a5add29620f5be139284d9e1 |
Hashes for mattress-0.0.6-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 821c034a76202c21ac9414ae468fd82536901732e1bb79c67a7d2d46fe2ae273 |
|
MD5 | a520624b7afc17768e902e22148719a8 |
|
BLAKE2b-256 | 14e8783bb945cd0c9d92e8bb5ecadf16bb124ad326243833717b268289dc81e1 |
Hashes for mattress-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42596d185b726814859c35e137989f1367251177cadebf066e44bb64a1994fc6 |
|
MD5 | 3881992f1546f753962d7852f118a86f |
|
BLAKE2b-256 | 9f5a7f81cf4e67f15c1c063e57b252bf2a1141b96813c9e31b93aef3aac88d94 |
Hashes for mattress-0.0.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fbb630431378e87d77e4a404c391b60adf9e0d15b1da5e0b3ba9c8a6694264b |
|
MD5 | a66bb337ce348e242c63a92d4eaf384c |
|
BLAKE2b-256 | 64d66a9f5d7181fc4f9ea6a5bd95da7dea5054e2f8ea8ed3bda02ac93badc75b |
Hashes for mattress-0.0.6-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e856d78ffa70df8618b865c189fce6242fdf24354f36d8654a6a200641357207 |
|
MD5 | a3c4e45f1f105f7d5c1c57b683a5e6f8 |
|
BLAKE2b-256 | 46f5362d35f89e96b3365758fd6a666c738a739fce3a91f888bcf15e0474848d |
Hashes for mattress-0.0.6-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeb819df135627bba4089210045f97695c82fc31c633633e83c2aee475166be6 |
|
MD5 | 141fa251f29e888864d36f2277ddf3bf |
|
BLAKE2b-256 | 066d3bf6471598d7afefe95e080f046c4e183a315074ed9a6aa0fb90ea0f7516 |
Hashes for mattress-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ac265a07cccaff7a99dfa73594d2e326d6d90c8b62bb71d6de806a71925aed7 |
|
MD5 | 9a4d0044532326b82567d59bcd6f7b5e |
|
BLAKE2b-256 | 19ac0a724b9e271ecddc35c50052f41486eace68f268145ad384b7a787b43dd1 |
Hashes for mattress-0.0.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7b316ab44b8b41f9221c69bccc9adf9936abbe7a842dc6f522b16edc4acd5f3 |
|
MD5 | f1b5e2ae695a5b5f778642d1d1615cdb |
|
BLAKE2b-256 | 24bed18ccfc38e577694325d43af6c98548fda9d4ac354726ed307dd50c431da |
Hashes for mattress-0.0.6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0079fbe94e315180d1f50e6b482ae8bfbcd521a6de7e6e11a19e81d18d1c6ec |
|
MD5 | 70da370b14516bcbd2fd80fb93880c7e |
|
BLAKE2b-256 | d7129b0e1e8577c416c50ab251aaaa6d203145e25fce14cfce401e34954918d7 |