Skip to content

Commit

Permalink
ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jul 10, 2024
1 parent 51b2b86 commit 40d372d
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/fusor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide computable object representation and validation for gene fusions"""

from fusor.fusor import FUSOR

from .version import __version__
Expand Down
1 change: 1 addition & 0 deletions src/fusor/examples/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide programmatic access to example objects."""

import json
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/fusor/fusor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for modifying fusion objects."""

import logging
import re
from urllib.parse import quote
Expand Down
17 changes: 9 additions & 8 deletions src/fusor/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Model for fusion class"""

from abc import ABC
from enum import Enum
from typing import Any, Literal
Expand Down Expand Up @@ -120,9 +121,9 @@ class BaseStructuralElement(ABC, BaseModel):
class TranscriptSegmentElement(BaseStructuralElement):
"""Define TranscriptSegment class"""

type: Literal[
type: Literal[FUSORTypes.TRANSCRIPT_SEGMENT_ELEMENT] = (
FUSORTypes.TRANSCRIPT_SEGMENT_ELEMENT
] = FUSORTypes.TRANSCRIPT_SEGMENT_ELEMENT
)
transcript: CURIE
exon_start: StrictInt | None = None
exon_start_offset: StrictInt | None = 0
Expand Down Expand Up @@ -212,9 +213,9 @@ def check_exons(cls, values):
class LinkerElement(BaseStructuralElement, extra="forbid"):
"""Define Linker class (linker sequence)"""

type: Literal[
type: Literal[FUSORTypes.LINKER_SEQUENCE_ELEMENT] = (
FUSORTypes.LINKER_SEQUENCE_ELEMENT
] = FUSORTypes.LINKER_SEQUENCE_ELEMENT
)
linker_sequence: SequenceDescriptor

@field_validator("linker_sequence", mode="before")
Expand Down Expand Up @@ -260,9 +261,9 @@ class TemplatedSequenceElement(BaseStructuralElement):
product.
"""

type: Literal[
type: Literal[FUSORTypes.TEMPLATED_SEQUENCE_ELEMENT] = (
FUSORTypes.TEMPLATED_SEQUENCE_ELEMENT
] = FUSORTypes.TEMPLATED_SEQUENCE_ELEMENT
)
region: LocationDescriptor
strand: Strand

Expand Down Expand Up @@ -340,9 +341,9 @@ class MultiplePossibleGenesElement(BaseStructuralElement):
MultiplePossibleGenesElement.
"""

type: Literal[
type: Literal[FUSORTypes.MULTIPLE_POSSIBLE_GENES_ELEMENT] = (
FUSORTypes.MULTIPLE_POSSIBLE_GENES_ELEMENT
] = FUSORTypes.MULTIPLE_POSSIBLE_GENES_ELEMENT
)

model_config = ConfigDict(
json_schema_extra={"example": {"type": "MultiplePossibleGenesElement"}},
Expand Down
1 change: 1 addition & 0 deletions src/fusor/nomenclature.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide helper methods for fusion nomenclature generation."""

from biocommons.seqrepo.seqrepo import SeqRepo
from ga4gh.vrsatile.pydantic.vrs_models import SequenceLocation

Expand Down
1 change: 1 addition & 0 deletions src/fusor/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide miscellaneous tools for fusion modeling."""

import logging

from biocommons.seqrepo.seqrepo import SeqRepo
Expand Down
1 change: 1 addition & 0 deletions src/fusor/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Define library version."""

__version__ = "0.1.0"
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module containing methods and fixtures used throughout tests."""

import logging

import pytest
Expand Down
7 changes: 4 additions & 3 deletions tests/test_fusor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for testing the FUSOR class."""

import copy

import pytest
Expand Down Expand Up @@ -817,9 +818,9 @@ def test_templated_sequence_element(
assert tsg.model_dump() == templated_sequence_element.model_dump()

expected = copy.deepcopy(templated_sequence_element.model_dump())
expected["region"]["location"][
"sequence_id"
] = "ga4gh:SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO"
expected["region"]["location"]["sequence_id"] = (
"ga4gh:SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO"
)
expected["region"]["location_id"] = "ga4gh:VSL.bL1N-PQfp4dGlEz6PEd34fGxdxo82Zkb"
tsg = fusor_instance.templated_sequence_element(
100,
Expand Down
1 change: 1 addition & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for testing the fusion model."""

import copy

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_nomenclature.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test nomenclature generation."""

import pytest

from fusor.models import AssayedFusion, CategoricalFusion, TranscriptSegmentElement
Expand Down
1 change: 1 addition & 0 deletions tests/test_tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test FUSOR tools."""

import pytest

from fusor.exceptions import IDTranslationException
Expand Down

0 comments on commit 40d372d

Please sign in to comment.