Skip to content

Commit c06cb70

Browse files
committed
remove force
1 parent 4d7c07e commit c06cb70

14 files changed

+56
-92
lines changed

v03_pipeline/bin/pipeline_worker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@ def main():
6161
run_id=datetime.datetime.now(datetime.timezone.utc).strftime(
6262
'%Y%m%d-%H%M%S',
6363
),
64-
force=False,
6564
**task_kwargs,
6665
),
6766
*[
6867
WriteProjectFamilyTablesTask(
6968
project_guid=lpr.projects_to_run[i],
7069
project_remap_path=project_remap_paths[i],
7170
project_pedigree_path=project_pedigree_paths[i],
72-
force=False,
7371
**task_kwargs,
7472
)
7573
for i in range(len(lpr.projects_to_run))

v03_pipeline/lib/tasks/base/base_loading_run_params.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ class BaseLoadingRunParams(luigi.Task):
2222
default=False,
2323
parsing=luigi.BoolParameter.EXPLICIT_PARSING,
2424
)
25-
force = luigi.BoolParameter(
26-
default=False,
27-
parsing=luigi.BoolParameter.EXPLICIT_PARSING,
28-
)
2925
skip_check_sex_and_relatedness = luigi.BoolParameter(
3026
default=False,
3127
parsing=luigi.BoolParameter.EXPLICIT_PARSING,

v03_pipeline/lib/tasks/base/base_update.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ def run(self) -> None:
1818
ht = read_fn(self.output().path)
1919
ht = self.update_table(ht)
2020
write(ht, self.output().path)
21-
# Set force to false after run, allowing "complete()" to succeeded
22-
# when dependencies are re-evaluated.
23-
self.force = False
2421

2522
def initialize_table(self) -> hl.Table:
2623
raise NotImplementedError

v03_pipeline/lib/tasks/base/base_write.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ def run(self) -> None:
99
self.init_hail()
1010
ht = self.create_table()
1111
write(ht, self.output().path)
12-
# Set force to false after run, allowing "complete()" to succeeded
13-
# when dependencies are re-evaluated.
14-
self.force = False
1512

1613
def create_table(self) -> hl.Table:
1714
raise NotImplementedError

v03_pipeline/lib/tasks/update_lookup_table.py

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,31 @@ class UpdateLookupTableTask(BaseUpdateLookupTableTask):
2727
run_id = luigi.Parameter()
2828

2929
def complete(self) -> bool:
30-
return (
31-
not self.force
32-
and super().complete()
33-
and hl.eval(
34-
hl.bind(
35-
lambda updates: hl.all(
36-
[
37-
updates.contains(
38-
hl.Struct(
39-
callset=self.callset_path,
40-
project_guid=project_guid,
41-
remap_pedigree_hash=remap_pedigree_hash(
42-
self.project_remap_paths[i],
43-
self.project_pedigree_paths[i],
44-
),
30+
return super().complete() and hl.eval(
31+
hl.bind(
32+
lambda updates: hl.all(
33+
[
34+
updates.contains(
35+
hl.Struct(
36+
callset=self.callset_path,
37+
project_guid=project_guid,
38+
remap_pedigree_hash=remap_pedigree_hash(
39+
self.project_remap_paths[i],
40+
self.project_pedigree_paths[i],
4541
),
46-
)
47-
for i, project_guid in enumerate(self.project_guids)
48-
],
49-
),
50-
hl.read_table(self.output().path).updates,
42+
),
43+
)
44+
for i, project_guid in enumerate(self.project_guids)
45+
],
5146
),
52-
)
47+
hl.read_table(self.output().path).updates,
48+
),
5349
)
5450

5551
def requires(self) -> list[luigi.Task]:
5652
return [
5753
self.clone(
5854
WriteMetadataForRunTask,
59-
force=False,
6055
),
6156
]
6257

v03_pipeline/lib/tasks/update_project_table.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,20 @@ class UpdateProjectTableTask(BaseUpdateProjectTableTask):
2424
project_pedigree_path = luigi.Parameter()
2525

2626
def complete(self) -> bool:
27-
return (
28-
not self.force
29-
and super().complete()
30-
and hl.eval(
31-
hl.read_table(self.output().path).updates.contains(
32-
hl.Struct(
33-
callset=self.callset_path,
34-
remap_pedigree_hash=remap_pedigree_hash(
35-
self.project_remap_path,
36-
self.project_pedigree_path,
37-
),
27+
return super().complete() and hl.eval(
28+
hl.read_table(self.output().path).updates.contains(
29+
hl.Struct(
30+
callset=self.callset_path,
31+
remap_pedigree_hash=remap_pedigree_hash(
32+
self.project_remap_path,
33+
self.project_pedigree_path,
3834
),
3935
),
40-
)
36+
),
4137
)
4238

4339
def requires(self) -> luigi.Task:
44-
return self.clone(WriteRemappedAndSubsettedCallsetTask, force=False)
40+
return self.clone(WriteRemappedAndSubsettedCallsetTask)
4541

4642
def update_table(self, ht: hl.Table) -> hl.Table:
4743
callset_mt = hl.read_matrix_table(self.input().path)

v03_pipeline/lib/tasks/update_variant_annotations_table_with_new_samples.py

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,25 @@ def requires(self) -> list[luigi.Task]:
3232
]
3333

3434
def complete(self) -> bool:
35-
return (
36-
not self.force
37-
and super().complete()
38-
and hl.eval(
39-
hl.bind(
40-
lambda updates: hl.all(
41-
[
42-
updates.contains(
43-
hl.Struct(
44-
callset=self.callset_path,
45-
project_guid=project_guid,
46-
remap_pedigree_hash=remap_pedigree_hash(
47-
self.project_remap_paths[i],
48-
self.project_pedigree_paths[i],
49-
),
35+
return super().complete() and hl.eval(
36+
hl.bind(
37+
lambda updates: hl.all(
38+
[
39+
updates.contains(
40+
hl.Struct(
41+
callset=self.callset_path,
42+
project_guid=project_guid,
43+
remap_pedigree_hash=remap_pedigree_hash(
44+
self.project_remap_paths[i],
45+
self.project_pedigree_paths[i],
5046
),
51-
)
52-
for i, project_guid in enumerate(self.project_guids)
53-
],
54-
),
55-
hl.read_table(self.output().path).updates,
47+
),
48+
)
49+
for i, project_guid in enumerate(self.project_guids)
50+
],
5651
),
57-
)
52+
hl.read_table(self.output().path).updates,
53+
),
5854
)
5955

6056
def update_table(self, ht: hl.Table) -> hl.Table:

v03_pipeline/lib/tasks/validate_callset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
@luigi.util.inherits(BaseLoadingRunParams)
3232
class ValidateCallsetTask(BaseUpdateTask):
3333
def complete(self) -> luigi.Target:
34-
if not self.force and super().complete():
34+
if super().complete():
3535
mt = hl.read_matrix_table(self.output().path)
3636
return hasattr(mt, 'validated_sample_type') and hl.eval(
3737
self.sample_type.value == mt.validated_sample_type,
@@ -49,7 +49,7 @@ def output(self) -> luigi.Target:
4949

5050
def requires(self) -> list[luigi.Task]:
5151
requirements = [
52-
self.clone(WriteImportedCallsetTask, force=False),
52+
self.clone(WriteImportedCallsetTask),
5353
]
5454
if not self.skip_validation and self.dataset_type.can_run_validation:
5555
requirements = [

v03_pipeline/lib/tasks/write_family_table.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,12 @@ def output(self) -> luigi.Target:
2929
)
3030

3131
def complete(self) -> bool:
32-
return (
33-
not self.force
34-
and super().complete()
35-
and hl.eval(
36-
hl.read_table(self.output().path).updates.contains(self.callset_path),
37-
)
32+
return super().complete() and hl.eval(
33+
hl.read_table(self.output().path).updates.contains(self.callset_path),
3834
)
3935

4036
def requires(self) -> luigi.Task:
41-
return self.clone(UpdateProjectTableTask, force=False)
37+
return self.clone(UpdateProjectTableTask)
4238

4339
def create_table(self) -> hl.Table:
4440
project_ht = hl.read_table(self.input().path)

v03_pipeline/lib/tasks/write_imported_callset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@luigi.util.inherits(BaseLoadingRunParams)
2424
class WriteImportedCallsetTask(BaseWriteTask):
2525
def complete(self) -> luigi.Target:
26-
return not self.force and super().complete()
26+
return super().complete()
2727

2828
def output(self) -> luigi.Target:
2929
return GCSorLocalTarget(

0 commit comments

Comments
 (0)