Skip to content

Commit

Permalink
use csv_version rather than csv_header_format
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Sep 8, 2022
1 parent 589969a commit 5bbe178
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/sourmash/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class BaseResult:
cmp_scaled: int = None
write_cols: list = None
potential_false_negative: bool = False
csv_header_format: str = "v4"
csv_version: str = "v4"

def init_result(self):
self.mh1 = self.query.minhash
Expand Down Expand Up @@ -230,7 +230,7 @@ def get_cmpinfo(self):
if self.filename is None and self.match_filename is not None:
self.filename = self.match_filename
self.match_md5 = self.match.md5sum()
# set these from self.match_*
# set these from self.match_* - used in csv-version=v4.
self.md5= self.match_md5
self.name = self.match_name
# could define in PrefetchResult instead, same reasoning as above
Expand Down Expand Up @@ -346,7 +346,7 @@ class PrefetchResult(BaseResult):
"""
PrefetchResult class supports 'sourmash prefetch' operations.
"""
csv_header_format: str = "v4"
csv_version: str = "v4"

# current prefetch columns
prefetch_write_cols = ['intersect_bp', 'jaccard', 'max_containment', 'f_query_match',
Expand Down Expand Up @@ -434,7 +434,7 @@ class GatherResult(PrefetchResult):
orig_query_abunds: list = None
sum_weighted_found: int = None
total_weighted_hashes: int = None
csv_header_format: str = "v4"
csv_version: str = "v4"

gather_write_cols_v4 = ['intersect_bp', 'f_orig_query', 'f_match', 'f_unique_to_query',
'f_unique_weighted','average_abund', 'median_abund', 'std_abund', 'filename', # here we use 'filename'
Expand Down Expand Up @@ -524,7 +524,7 @@ def __post_init__(self):
self.build_gather_result() # build gather-specific attributes

# set write columns for gather result - allowing for different versions
if self.csv_header_format == "v4":
if self.csv_version == "v4":
self.write_cols = self.gather_write_cols_v4
else:
self.write_cols = self.gather_write_cols
Expand Down Expand Up @@ -819,7 +819,7 @@ def __next__(self):
estimate_ani_ci=self.estimate_ani_ci,
sum_weighted_found=sum_weighted_found,
total_weighted_hashes=sum_abunds,
csv_header_format=self.csv_version
csv_version=self.csv_version
)

self.result_n += 1
Expand Down

0 comments on commit 5bbe178

Please sign in to comment.