Skip to content

Commit

Permalink
MRG: prepare to remove sourmash compute for sourmash v5.0 (#3103)
Browse files Browse the repository at this point in the history
This PR refactors code to eliminate any internal dependencies on the
`compute` command or codebase, in preparation for removing `sourmash
compute` in v5.0, per
#1286.

Specifically, this PR:
* shifts common sketching code from `src/sourmash/command_compute.py` to
`src/sourmash/command_sketch.py`;
* refactors three tests that were still using `sourmash compute` to use
`sourmash sketch` instead.

No functionality is altered or adjusted in this PR; it's all just code
refactoring.

The next step for #1286 would maybe be adjust the code and the tests to
respect the `--v4` and `--v5` flags (as used in
#3072 /
#3074). The actual compute
code and command wouldn't be removed until after a 5.0 release, I think.
  • Loading branch information
ctb committed Apr 12, 2024
1 parent e0d002a commit f4e7205
Show file tree
Hide file tree
Showing 5 changed files with 519 additions and 29 deletions.
12 changes: 9 additions & 3 deletions src/sourmash/command_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@
from .utils import RustObject
from ._lowlevel import ffi, lib

DEFAULT_COMPUTE_K = "21,31,51"
DEFAULT_MMHASH_SEED = 42
DEFAULT_LINE_COUNT = 1500

from .command_sketch import (
_compute_individual,
_compute_merged,
ComputeParameters,
add_seq,
set_sig_name,
DEFAULT_MMHASH_SEED,
)


def compute(args):
Expand Down

0 comments on commit f4e7205

Please sign in to comment.