Skip to content

Commit

Permalink
Merge branch 'latest' into plant-db
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegenes authored Dec 16, 2024
2 parents 1facf5b + d22b860 commit 60802f6
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

7 changes: 7 additions & 0 deletions doc/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ you upgrade within a major sourmash release (barring bug fixes!). Moreover,
if you rely on a feature introduced in v3.3.0, that feature will not break
in v3.4.0, but will also not be backported to version 3.2.0.

### Output file formats

In particular, the CSV output file formats are guaranteed to be stable
within major versions, with one caveat: we may add or rearrange
columns between releases. You should use column headers/column names
to parse CSV files, and not depend on column order.

### Python API

We intend to guarantee the Python API at the top level, i.e.
Expand Down
1 change: 1 addition & 0 deletions include/sourmash.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ enum SourmashErrorCode {
SOURMASH_ERROR_CODE_NIFFLER_ERROR = 100005,
SOURMASH_ERROR_CODE_CSV_ERROR = 100006,
SOURMASH_ERROR_CODE_ROCKS_DB_ERROR = 100007,
SOURMASH_ERROR_CODE_ZIP_ERROR = 100008,
};
typedef uint32_t SourmashErrorCode;

Expand Down
2 changes: 1 addition & 1 deletion src/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sourmash"
version = "0.17.2"
version = "0.18.0"
authors = ["Luiz Irber <[email protected]>", "N. Tessa Pierce-Ward <[email protected]>", "C. Titus Brown <[email protected]>"]
description = "tools for comparing biological sequences with k-mer sketches"
repository = "https://github.com/sourmash-bio/sourmash"
Expand Down
6 changes: 6 additions & 0 deletions src/core/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ pub enum SourmashError {
#[cfg(feature = "branchwater")]
#[error(transparent)]
RocksDBError(#[from] rocksdb::Error),

#[error(transparent)]
ZipError(#[from] piz::result::ZipError),
}

#[derive(Debug, Error)]
Expand Down Expand Up @@ -140,6 +143,7 @@ pub enum SourmashErrorCode {
NifflerError = 100_005,
CsvError = 100_006,
RocksDBError = 100_007,
ZipError = 100_008,
}

#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
Expand Down Expand Up @@ -179,6 +183,8 @@ impl SourmashErrorCode {
#[cfg(not(target_arch = "wasm32"))]
#[cfg(feature = "branchwater")]
SourmashError::RocksDBError { .. } => SourmashErrorCode::RocksDBError,

SourmashError::ZipError { .. } => SourmashErrorCode::ZipError,
}
}
}
10 changes: 5 additions & 5 deletions src/core/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,22 +403,22 @@ impl ZipStorage {
let zip_file = File::open(location.as_ref())?;
let mapping = unsafe { memmap2::Mmap::map(&zip_file)? };

let mut storage = ZipStorageBuilder {
let mut storage = ZipStorageTryBuilder {
mapping: Some(mapping),
archive_builder: |mapping: &Option<memmap2::Mmap>| {
piz::ZipArchive::new(mapping.as_ref().unwrap()).unwrap()
piz::ZipArchive::new(mapping.as_ref().unwrap())
},
metadata_builder: |archive: &piz::ZipArchive| {
archive
Ok(archive
.entries()
.iter()
.map(|entry| (entry.path.as_os_str(), entry))
.collect()
.collect())
},
subdir: None,
path: Some(location.as_ref().into()),
}
.build();
.try_build()?;

let subdir = find_subdirs(storage.borrow_archive())?;
storage.with_mut(|fields| *fields.subdir = subdir);
Expand Down

0 comments on commit 60802f6

Please sign in to comment.