Skip to main content

kameris-formats

Travis Codacy Codebeat Codeclimate

These are implementations of readers and writers for the file formats used by kameris-backend, for the following languages:

Language Location Notes
C++ cpp/ Header-only, requires libkameris
Python python/ On PyPI: PyPI version

File formats

There are two different file formats used to store program output. repr mode generates files with the extension .mm-repr and dist mode generates files with the extension .mm-dist.

Data is always stored in little-endian format. All header values except the signature are unsigned integers.

element_type is a common enum used to specify the type of the stored data. Its values are as follows:

Value Name Element size (bytes) Description
0 uint8 1 8-bit unsigned integer
1 uint16 2 16-bit unsigned integer
2 uint32 4 32-bit unsigned integer
3 uint64 8 64-bit unsigned integer
4 float32 4 IEEE 754 single-precision floating point
5 float64 8 IEEE 754 double-precision floating point

repr format (.mm-repr files)

Header

Start End Size (bytes) Name Description
0x00 0x05 6 signature File signature, always "MMREPR"
0x06 0x06 1 version Always 0
0x07 0x07 1 is_sparse Whether the matrices are sparse (0 or 1)
0x08 0x08 1 key_type The type of matrix keys as an element_type, unused if is_sparse is 0
0x09 0x09 1 value_type The type of matrix values as an element_type
0x0A 0x11 8 count Number of matrices
0x12 0x19 8 rows Number of rows for each matrix
0x1A 0x21 8 columns Number of columns for each matrix
0x22 8 * count sizes (Only if is_sparse is 1) Number of non-zero entries for each matrix

If the sparse flag is not set, the following count * rows * columns * (size for value_type) bytes are the entries, in row-major order, for each of the count matrices, one after the other.

If the sparse flag is set, each of the count matrices, one after the other, is stored as (the matrix size from sizes) * (size for key_type) * (size for value_type) bytes which are (the matrix size from sizes) pairs of key followed by value. The order of keys is unspecified.

dist format (.mm-dist files)

Header

Start End Size (bytes) Name Description
0x00 0x05 6 signature File signature, always "MMDIST"
0x06 0x06 1 version Always 0
0x07 0x07 1 value_type The type of matrix values as an element_type
0x08 0x0F 8 size Number of rows = columns of the matrix

The following (size * (size - 1)) / 2 * (size for value_type) bytes are the entries above the main diagonal, in row-major order, of the matrix. The matrix is assumed to be symmetric and have zeros on the main diagonal.


License License

The MIT License (MIT)

Copyright (c) 2017 Stephen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Metadata

Release files for kameris-formats 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kameris-formats 1.0.6
File Size Uploaded Provenance Actions
kameris-formats-1.0.6.tar.gz 5.6 kB Without provenance Details for kameris-formats-1.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kameris-formats 1.0.6
File Interpreter ABI Platform Actions
kameris_formats-1.0.6-py2.py3-none-any.whl Python 2, Python 3 none any Details for kameris_formats-1.0.6-py2.py3-none-any.whl

Total release size: 13.3 kB

Release files / kameris-formats-1.0.6.tar.gz

Download URL kameris-formats-1.0.6.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
88bb78afe79777224be6250b72ce0d57ac387a4640b33ea7b7ad98a0cbf2ef66
BLAKE2b-256 checksum
How to use checksums
90f23dd8c9dd68f12e59b75a4d685fc87607bf60d2260d08ea76dc60491815b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14

Release files / kameris_formats-1.0.6-py2.py3-none-any.whl

Download URL kameris_formats-1.0.6-py2.py3-none-any.whl
Size 7.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
601f4d9dc7b841c49512940839fedf611b50f9d79f38f3a0b99987311c9cc05e
BLAKE2b-256 checksum
How to use checksums
2724f3bff0c31112ce7529c8b62fb04dc3c86ee6d37bc1c11dc2aa203c7096de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14

Security for kameris-formats 1.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page