Skip to content

Commit

Permalink
fix squeeze (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
alethomas authored May 13, 2022
1 parent ab86c71 commit f53b114
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def get_strain_accessions(wildcards):
# Get genomes for benchmarking from config
accessions = config.get("testing", {}).get("benchmark-genomes", [])
if not accessions:
accessions = pd.read_csv(f, squeeze=True)
accessions = pd.read_csv(f).squeeze("columns")
try:
accessions = accessions[: config["testing"]["limit-strain-genomes"]]
except KeyError:
Expand All @@ -267,7 +267,7 @@ def get_non_cov2_accessions():


def load_strain_genomes(f):
strain_genomes = pd.read_csv(f, squeeze=True).to_list()
strain_genomes = pd.read_csv(f).squeeze("columns").to_list()
strain_genomes.append("resources/genomes/main.fasta")
return expand("{strains}", strains=strain_genomes)

Expand Down Expand Up @@ -924,7 +924,7 @@ def load_filtered_samples(wildcards, assembly_type):
date=wildcards.date, assembly_type=assembly_type
).output.passed_filter.open() as f:
try:
return pd.read_csv(f, squeeze=True, header=None).astype(str).to_list()
return pd.read_csv(f, header=None).squeeze("columns").astype(str).to_list()
except pd.errors.EmptyDataError:
return []

Expand Down

0 comments on commit f53b114

Please sign in to comment.