Skip to content

Commit

Permalink
Fix enums
Browse files Browse the repository at this point in the history
  • Loading branch information
seallard committed Oct 27, 2023
1 parent e84d8db commit 7b40b01
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 26 deletions.
2 changes: 1 addition & 1 deletion cg/constants/archiving.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from cg.utils.enums import StrEnum
from enum import StrEnum


class ArchiveLocations(StrEnum):
Expand Down
2 changes: 1 addition & 1 deletion cg/constants/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import click

from cg.utils.date import get_date
from cg.utils.enums import StrEnum
from enum import StrEnum

VALID_DATA_IN_PRODUCTION = get_date("2017-09-27")

Expand Down
2 changes: 1 addition & 1 deletion cg/constants/demultiplexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import click

from cg.constants.sequencing import Sequencers
from cg.utils.enums import Enum, StrEnum
from enum import Enum, StrEnum


class BclConverter(StrEnum):
Expand Down
2 changes: 1 addition & 1 deletion cg/constants/gene_panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Gene panel specific constants."""


from cg.utils.enums import StrEnum
from enum import StrEnum

GENOME_BUILD_37 = "37"
GENOME_BUILD_38 = "GRCh38"
Expand Down
2 changes: 1 addition & 1 deletion cg/constants/housekeeper_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


from cg.constants.constants import Pipeline
from cg.utils.enums import StrEnum
from enum import StrEnum


class AlignmentFileTag(StrEnum):
Expand Down
2 changes: 1 addition & 1 deletion cg/constants/invoice.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from cg.utils.enums import StrEnum
from enum import StrEnum


class CustomerNames(StrEnum):
Expand Down
2 changes: 1 addition & 1 deletion cg/constants/lims.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LIMS constants

from cg.utils.enums import StrEnum
from enum import StrEnum

YES_NO_LIMS_BOOLEANS = ["require_qc_ok", "tumour", "verified_organism"]

Expand Down
2 changes: 1 addition & 1 deletion cg/constants/nf_analysis.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Nf-tower related constants."""
from cg.utils.enums import StrEnum
from enum import StrEnum


class NfTowerStatus(StrEnum):
Expand Down
2 changes: 1 addition & 1 deletion cg/constants/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from cg.constants.constants import Pipeline
from cg.constants.sequencing import SequencingMethod
from cg.utils.enums import StrEnum
from enum import StrEnum

LOQUSDB_ID = "_id"
LOQUSDB_SUPPORTED_PIPELINES = [Pipeline.MIP_DNA, Pipeline.BALSAMIC]
Expand Down
2 changes: 1 addition & 1 deletion cg/constants/orderforms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from cg.constants import ANALYSIS_SOURCES, METAGENOME_SOURCES
from cg.models.orders.order import OrderType
from cg.utils.enums import StrEnum
from enum import StrEnum

SEX_MAP = {"male": "M", "female": "F", "unknown": "unknown"}
REV_SEX_MAP = {value: key for key, value in SEX_MAP.items()}
Expand Down
3 changes: 2 additions & 1 deletion cg/constants/pdc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""PDC related constants"""
from cg.utils.enums import IntEnum, ListEnum
from enum import IntEnum
from cg.utils.enums import ListEnum


class DSMCParameters(ListEnum):
Expand Down
2 changes: 1 addition & 1 deletion cg/constants/priority.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Priority specific constants"""
from enum import IntEnum

from cg.utils.enums import StrEnum
from enum import StrEnum


class SlurmQos(StrEnum):
Expand Down
2 changes: 1 addition & 1 deletion cg/constants/scout_upload.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from cg.utils.enums import StrEnum
from enum import StrEnum


class GenomeBuild(StrEnum):
Expand Down
2 changes: 1 addition & 1 deletion cg/constants/sequencing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Constants related to sequencing."""
from cg.utils.enums import StrEnum
from enum import StrEnum


class Sequencers(StrEnum):
Expand Down
2 changes: 1 addition & 1 deletion cg/models/orders/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from cg.constants.constants import Pipeline
from cg.utils.enums import StrEnum
from enum import StrEnum


class OrderType(StrEnum):
Expand Down
11 changes: 0 additions & 11 deletions cg/utils/enums.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
"""Enum classes has string or list values that behaves like defined """
from enum import Enum


class StrEnum(str, Enum):
def __str__(self) -> str:
return str.__str__(self)


class ListEnum(list, Enum):
pass


class IntEnum(int, Enum):
def __int__(self) -> int:
return int.__int__(self)

0 comments on commit 7b40b01

Please sign in to comment.