damicore-distance
damicore-distance computes an exact, unclamped, float64 Normalized Compression
Distance (NCD) matrix from a normalization manifest. It is the second stage of
the DAMICORE pipeline; most users install the aggregate damicore distribution,
which runs all four stages end to end. Install this package alone to compute NCD
matrices without the rest of the pipeline.
pip install damicore-distance
Python
from damicore_distance import DistanceConfig, compute_distance_matrix
# `workers="auto"` opens a process pool whose workers re-import the calling module, so in a
# `.py` script this call must sit under the guard below. A notebook or REPL satisfies it too.
if __name__ == "__main__":
result = compute_distance_matrix(
"normalization/manifest.json",
"run",
config=DistanceConfig(workers="auto"),
)
compressor is one settings model per codec, holding only what that codec reads. The
default, PpmdCompressor(), is PPMd variant I at model order 6 with 64 MiB of model
memory (ppmd_order, ppmd_memory_bytes), which keeps a shared distribution across
large objects. LzmaCompressor (raw LZMA2, lzma_dictionary_bytes, default 8 MiB)
finds shared content at any size its dictionary holds; Bzip2Compressor
(bzip2_block_size_100k) sees both within its 900 kB block; DeflateCompressor, with
name="zlib" or "gzip" and compression_level, is DEFLATE, whose 32 KiB window makes
objects larger than that look unrelated. Every NCD value is a function of these settings:
from damicore_distance import DistanceConfig, LzmaCompressor
config = DistanceConfig(compressor=LzmaCompressor(lzma_dictionary_bytes=67_108_864))
How a pair becomes one stream is a setting too: ConcatPairing(), the default, compresses
one object after the other, and InterleavePairing(interleave_block_bytes=1024) takes
blocks of each in turn, the original DAMICORE's pairing for objects larger than a window.
The manifest is produced by the sibling damicore-normalizer distribution; the
call writes distance.npy and labels.json, the inputs the sibling
damicore-tree-builder distribution consumes. Compression is incremental, pairs
are lexicographically sharded, only the coordinator writes the memory map, and
compatible completed shards can resume.
DistanceMatrixView reads the matrix through NumPy slicing and shape with no
extra dependency. Its two pandas conveniences, head() and to_pandas(), raise
a DistanceError (missing_dependency_error) unless pandas is present; install
it with pip install "damicore-distance[pandas]".
Links
- Repository: https://github.com/delbem-research/damicore
- Issues: https://github.com/delbem-research/damicore/issues
- Documentation: https://github.com/delbem-research/damicore/blob/main/docs/quickstart.md
Licensed under Apache-2.0.
Metadata
Release files for damicore-distance 0.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| damicore_distance-0.6.2.tar.gz | 34.7 kB | With provenance | Details for damicore_distance-0.6.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| damicore_distance-0.6.2-py3-none-any.whl | Python 3 | none | any | Details for damicore_distance-0.6.2-py3-none-any.whl |
Total release size: 71.8 kB
Release files / damicore_distance-0.6.2.tar.gz
| Download URL | damicore_distance-0.6.2.tar.gz |
|---|---|
| Size | 34.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e77fbe0a5189957ab11d6f472e3a2c69ca66aeeb81456e061fe8717df4a87e5a
|
|
BLAKE2b-256 checksum How to use checksums |
e11dfbacae4f55a75eb7cfb3646deca5914df1e2acb394080b226b04dbf33590
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / damicore_distance-0.6.2-py3-none-any.whl
| Download URL | damicore_distance-0.6.2-py3-none-any.whl |
|---|---|
| Size | 37.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99c004d27e7d83a0ce74b50a5d6420d509e58675109003661445362124530c5a
|
|
BLAKE2b-256 checksum How to use checksums |
7211cdbf54db3b4867b4421a090a933355044eb7a6c6218b07e67f832b0b0a0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for damicore-distance 0.6.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for damicore_distance-0.6.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA 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.