Skip to content

Commit 2b45ae2

Browse files
committed
str enum
1 parent 9cd43d9 commit 2b45ae2

File tree

7 files changed

+19
-17
lines changed

7 files changed

+19
-17
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "seqr-loading-pipeline"
33
dynamic = ['version']
4-
requires-python = ">=3.10"
4+
requires-python = ">=3.11"
55

66
[tool.setuptools]
77
include-package-data = true
@@ -19,7 +19,7 @@ namespaces = false
1919

2020
[tool.mypy]
2121
packages = 'v03_pipeline'
22-
python_version = "3.10"
22+
python_version = "3.11"
2323
ignore_missing_imports = true
2424
strict = true
2525

@@ -55,7 +55,7 @@ line-length = 88
5555
select = [
5656
"ALL"
5757
]
58-
target-version = "py310"
58+
target-version = "py311"
5959

6060
[tool.ruff.flake8-quotes]
6161
inline-quotes = "single"

v03_pipeline/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
MAJOR_VERSION = 3
44

5-
__version__ = f'{MAJOR_VERSION}.{datetime.datetime.now(datetime.timezone.utc).strftime("%Y%m%d.%H%M%S")}'
5+
__version__ = (
6+
f'{MAJOR_VERSION}.{datetime.datetime.now(datetime.UTC).strftime("%Y%m%d.%H%M%S")}'
7+
)

v03_pipeline/bin/pipeline_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def main():
4444
)
4545
for project_guid in lpr.projects_to_run
4646
]
47-
run_id = datetime.datetime.now(datetime.timezone.utc).strftime(
47+
run_id = datetime.datetime.now(datetime.UTC).strftime(
4848
'%Y%m%d-%H%M%S',
4949
)
5050
loading_run_task_params = {

v03_pipeline/lib/model/dataset_type.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Callable
2-
from enum import Enum
2+
from enum import StrEnum
33

44
import hail as hl
55

@@ -10,7 +10,7 @@
1010
ZERO = 0.0
1111

1212

13-
class DatasetType(str, Enum):
13+
class DatasetType(StrEnum):
1414
GCNV = 'GCNV'
1515
MITO = 'MITO'
1616
SNV_INDEL = 'SNV_INDEL'

v03_pipeline/lib/model/definitions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
from enum import Enum
1+
from enum import StrEnum
22

33
import hail as hl
44

55

6-
class AccessControl(str, Enum):
6+
class AccessControl(StrEnum):
77
PUBLIC = 'public'
88
PRIVATE = 'private'
99

1010

11-
class Sex(str, Enum):
11+
class Sex(StrEnum):
1212
FEMALE = 'F'
1313
MALE = 'M'
1414
UNKNOWN = 'U'
@@ -26,13 +26,13 @@ def imputed_sex_values(self) -> list[str]:
2626
}.get(self, [self.name])
2727

2828

29-
class PipelineVersion(str, Enum):
29+
class PipelineVersion(StrEnum):
3030
V02 = 'v02'
3131
V03 = 'v03'
3232
V3_1 = 'v3.1'
3333

3434

35-
class ReferenceGenome(str, Enum):
35+
class ReferenceGenome(StrEnum):
3636
GRCh37 = 'GRCh37'
3737
GRCh38 = 'GRCh38'
3838

@@ -158,6 +158,6 @@ def allele_registry_gnomad_id(self) -> str:
158158
}[self]
159159

160160

161-
class SampleType(str, Enum):
161+
class SampleType(StrEnum):
162162
WES = 'WES'
163163
WGS = 'WGS'

v03_pipeline/lib/reference_datasets/reference_dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import importlib
22
import types
33
from collections.abc import Callable
4-
from enum import Enum
4+
from enum import StrEnum
55
from typing import Union
66

77
import hail as hl
@@ -140,7 +140,7 @@ def get_ht(
140140
)
141141

142142

143-
class ReferenceDataset(BaseReferenceDataset, str, Enum):
143+
class ReferenceDataset(BaseReferenceDataset, StrEnum):
144144
clinvar = 'clinvar'
145145
dbnsfp = 'dbnsfp'
146146
exac = 'exac'
@@ -162,7 +162,7 @@ class ReferenceDataset(BaseReferenceDataset, str, Enum):
162162
mitomap = 'mitomap'
163163

164164

165-
class ReferenceDatasetQuery(BaseReferenceDataset, str, Enum):
165+
class ReferenceDatasetQuery(BaseReferenceDataset, StrEnum):
166166
clinvar_path_variants = 'clinvar_path_variants'
167167
high_af_variants = 'high_af_variants'
168168

v03_pipeline/lib/tasks/validate_callset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def update_table(self, mt: hl.MatrixTable) -> hl.MatrixTable:
135135
**self.param_kwargs,
136136
**validation_dependencies,
137137
)
138-
except SeqrValidationError as e: # noqa: PERF203
138+
except SeqrValidationError as e:
139139
validation_exceptions.append(e)
140140
if validation_exceptions:
141141
write_validation_errors_for_run_task = self.clone(

0 commit comments

Comments
 (0)