Skip to content

Commit

Permalink
use n_hashes sig fn for accurate manifest n_hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegenes committed Jan 6, 2025
1 parent 1687b30 commit 0b4ab0a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
7 changes: 3 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ crate-type = ["cdylib"]
pyo3 = { version = "0.23.3", features = ["extension-module", "anyhow"] }
rayon = "1.10.0"
serde = { version = "1.0.217", features = ["derive"] }
sourmash = { version = "0.18.0", features = ["branchwater"] }
#sourmash = { version = "0.18.0", features = ["branchwater"] }
sourmash = { git = "https://github.com/sourmash-bio/sourmash.git", branch = "add-nhashes", features = ["branchwater"] }
serde_json = "1.0.134"
niffler = "2.4.0"
log = "0.4.22"
Expand Down
8 changes: 4 additions & 4 deletions src/python/tests/test_sketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,10 @@ def test_zip_manifest(runtmp, capfd):
assert len(manifest) == len(rows)
assert len(manifest) == 3

md5_list = [row["md5"] for row in manifest.rows]
assert "9191284a3a23a913d8d410f3d53ce8f0" in md5_list
assert "d663bb55b2a0f8782c53c8af89f20fff" in md5_list
assert "bf752903d635b1eb83c53fe4aae951db" in md5_list
md5_nhashes = [(row["md5"], row["n_hashes"]) for row in manifest.rows]
assert ("9191284a3a23a913d8d410f3d53ce8f0", 970) in md5_nhashes
assert ("d663bb55b2a0f8782c53c8af89f20fff", 925) in md5_nhashes
assert ("bf752903d635b1eb83c53fe4aae951db", 955) in md5_nhashes

for sig in siglist:
assert sig in manifest
Expand Down
2 changes: 1 addition & 1 deletion src/utils/buildutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ impl BuildCollection {
record.set_filename(Some(filename.clone()));
record.set_md5(Some(sig.md5sum()));
record.set_md5short(Some(sig.md5sum()[0..8].into()));
record.set_n_hashes(Some(sig.size()));
record.set_n_hashes(Some(sig.n_hashes()));

// note, this needs to be set when writing sigs (not here)
// record.set_internal_location("")
Expand Down

0 comments on commit 0b4ab0a

Please sign in to comment.