Skip to content

Commit

Permalink
Fix bug in samples processed output
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromekelleher committed Dec 17, 2024
1 parent 7b08ea7 commit f9e1d38
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions sc2ts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,14 @@ def _run_extend(out_path, verbose, log_file, **params):
resource_usage = summarise_usage(ts)
logger.info(resource_usage)
print("resources:", resource_usage, file=sys.stderr)
df = pd.DataFrame(
ts.metadata["sc2ts"]["daily_stats"][date]["samples_processed"]
).set_index("scorpio")
del df["total_hmm_cost"]
df = df[list(df.columns)[::-1]].sort_values("total")
print(df, file=sys.stderr)
data = ts.metadata["sc2ts"]["daily_stats"][date]["samples_processed"]
if len(data) > 0:
df = pd.DataFrame(
ts.metadata["sc2ts"]["daily_stats"][date]["samples_processed"]
).set_index("scorpio")
del df["total_hmm_cost"]
df = df[list(df.columns)[::-1]].sort_values("total")
print(df, file=sys.stderr)


@click.command()
Expand Down Expand Up @@ -401,12 +403,16 @@ def infer(config_file, start, stop, force):
params.update(override_set["parameters"])

base_ts = ts_file_pattern.format(date=date)
with cf.ProcessPoolExecutor(1) as executor:
future = executor.submit(
_run_extend, base_ts, log_level, log_file, **params
)
# Block and wait, raising exception if it occured
future.result()
if True:
_run_extend(base_ts, log_level, log_file, **params)

else:
with cf.ProcessPoolExecutor(1) as executor:
future = executor.submit(
_run_extend, base_ts, log_level, log_file, **params
)
# Block and wait, raising exception if it occured
future.result()


@click.command()
Expand Down

0 comments on commit f9e1d38

Please sign in to comment.