Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

Latest commit

 

History

History
83 lines (52 loc) · 2.31 KB

README.md

File metadata and controls

83 lines (52 loc) · 2.31 KB

Project generated with PyScaffold

mattress

This project provides tatami matrix representations in Python.

Install

Package is published to PyPI

pip install mattress

Usage

Currently only supports 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 are available to access the matrix by row, column

tatamat.row(0)
tatamat.column(1)

Additionally you can also specify if the input matrix is a column or row major.

x = np.ones((2, 3), order='F')
tatamat = tatamize(y, order="F")

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

Note

This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.