Skip to content

Commit

Permalink
test(cpg_flow_test/): add sg.id to all jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
violetbrina committed Dec 13, 2024
1 parent 9256c68 commit 454b2a3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion cpg_flow_test/jobs/cumulative_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

def cumulative_calc(
b: Batch,
sequencing_group: SequencingGroup,
input_file_path: str,
output_file_path: str,
) -> list[Job]:
title = 'Cumulative Calc'
title = f'Cumulative Calc: {sequencing_group.id}'
job = b.new_job(name=title)
primes_path = b.read_input(input_file_path)

Expand Down
6 changes: 4 additions & 2 deletions cpg_flow_test/jobs/first_n_primes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
from hailtop.batch.job import Job


def first_n_primes(b: Batch, input_file_path: str, output_file_path: str, depends_on: Job) -> list[Job]:
title = 'First N Primes'
def first_n_primes(
b: Batch, sequencing_group: SequencingGroup, input_file_path: str, output_file_path: str, depends_on: Job,
) -> list[Job]:
title = f'First N Primes: {sequencing_group.id}'
job = b.new_job(name=title)
id_sum_path = b.read_input(input_file_path)

Expand Down
2 changes: 1 addition & 1 deletion cpg_flow_test/jobs/iterative_digit_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def iterative_digit_sum(
sequencing_group: SequencingGroup,
output_file_path: str,
) -> list[Job]:
title = 'Iterative Digit Sum'
title = f'Iterative Digit Sum: {sequencing_group.id}'
job = b.new_job(name=title)

cmd = f"""\
Expand Down
4 changes: 2 additions & 2 deletions cpg_flow_test/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def queue_jobs(self, sequencing_group: SequencingGroup, inputs: StageInput) -> S

# Generate first N primes
primes_output_path = str(self.expected_outputs(sequencing_group).get('primes', ''))
job_primes = first_n_primes(b, id_sum_output_path, primes_output_path, depends_on=job_id_sum)
job_primes = first_n_primes(b, sequencing_group, id_sum_output_path, primes_output_path, depends_on=job_id_sum)

jobs = [job_id_sum, job_primes]

Expand All @@ -92,7 +92,7 @@ def queue_jobs(self, sequencing_group: SequencingGroup, inputs: StageInput) -> S
b = get_batch()

cumulative_calc_output_path = str(self.expected_outputs(sequencing_group).get('cumulative', ''))
job_cumulative_calc = cumulative_calc(b, input_json, cumulative_calc_output_path)
job_cumulative_calc = cumulative_calc(b, sequencing_group, input_json, cumulative_calc_output_path)

jobs = [job_cumulative_calc]

Expand Down

0 comments on commit 454b2a3

Please sign in to comment.