From eec8028b5e78c6d58d86a541d7d94f7b3561dcad Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Thu, 15 Aug 2024 17:08:47 +0200 Subject: [PATCH 1/2] Added derives for mem-dbg --- Cargo.lock | 22 ++++++++++++++++++++++ src/core/Cargo.toml | 1 + src/core/src/encodings.rs | 1 + src/core/src/sketch/hyperloglog/mod.rs | 1 + src/core/src/sketch/minhash.rs | 1 + 5 files changed, 26 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index c0847a42ad..7bc757c2d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -933,6 +933,27 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" +[[package]] +name = "mem_dbg" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd7536481f50e36a48185e622c9643919a0fca99422069424c214e67d8ed264" +dependencies = [ + "bitflags 2.4.1", + "mem_dbg-derive", +] + +[[package]] +name = "mem_dbg-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31df6bf503386c041c631223d4eb77ee55912d7e75645c960a24512aded0d89" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.46", +] + [[package]] name = "memchr" version = "2.4.1" @@ -1669,6 +1690,7 @@ dependencies = [ "js-sys", "log", "md5", + "mem_dbg", "memmap2", "murmurhash3", "needletail", diff --git a/src/core/Cargo.toml b/src/core/Cargo.toml index c7f940bb9c..f3d939e9db 100644 --- a/src/core/Cargo.toml +++ b/src/core/Cargo.toml @@ -41,6 +41,7 @@ histogram = "0.11.0" itertools = "0.13.0" log = "0.4.22" md5 = "0.7.0" +mem_dbg = {version="0.2.4", optional = true} memmap2 = "0.9.4" murmurhash3 = "0.0.5" needletail = { version = "0.5.1", default-features = false } diff --git a/src/core/src/encodings.rs b/src/core/src/encodings.rs index 733831e49c..bf8323f4c8 100644 --- a/src/core/src/encodings.rs +++ b/src/core/src/encodings.rs @@ -26,6 +26,7 @@ type ColorToIdx = HashMap>; derive(rkyv::Serialize, rkyv::Deserialize, rkyv::Archive) )] #[non_exhaustive] +#[cfg_attr(feature = "mem_dbg", derive(mem_dbg::MemDbg, mem_dbg::MemSize))] pub enum HashFunctions { Murmur64Dna, Murmur64Protein, diff --git a/src/core/src/sketch/hyperloglog/mod.rs b/src/core/src/sketch/hyperloglog/mod.rs index ee09caa6e5..1f7dc703c1 100644 --- a/src/core/src/sketch/hyperloglog/mod.rs +++ b/src/core/src/sketch/hyperloglog/mod.rs @@ -30,6 +30,7 @@ use estimators::CounterType; feature = "rkyv", derive(rkyv::Serialize, rkyv::Deserialize, rkyv::Archive) )] +#[cfg_attr(feature = "mem_dbg", derive(mem_dbg::MemDbg, mem_dbg::MemSize))] pub struct HyperLogLog { registers: Vec, p: usize, diff --git a/src/core/src/sketch/minhash.rs b/src/core/src/sketch/minhash.rs index e949162cc2..f42ad06938 100644 --- a/src/core/src/sketch/minhash.rs +++ b/src/core/src/sketch/minhash.rs @@ -38,6 +38,7 @@ pub fn scaled_for_max_hash(max_hash: u64) -> u64 { feature = "rkyv", derive(rkyv::Serialize, rkyv::Deserialize, rkyv::Archive) )] +#[cfg_attr(feature = "mem_dbg", derive(mem_dbg::MemDbg, mem_dbg::MemSize))] pub struct KmerMinHash { num: u32, ksize: u32, From 42a2b8d9b535897f926adf49c207842a3f3f78b8 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Thu, 15 Aug 2024 17:17:07 +0200 Subject: [PATCH 2/2] Added orcid to pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index c523e919c9..2583debf52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ authors = [ { name="Colton Baumler", orcid="0000-0002-5926-7792" }, { name="Olga Botvinnik", orcid="0000-0003-4412-7970" }, { name="Phillip Brooks", orcid="0000-0003-3987-244X" }, + { name="Luca Cappelletti", orcid="0000-0002-1269-2038" }, { name="Peter Cock", orcid="0000-0001-9513-9993" }, { name="Daniel Dsouza", orcid="0000-0001-7843-8596" }, { name="Jade Gardner", orcid="0009-0005-0787-5752" },