Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: rm force-single-line config #246

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ target-version = "py39"
fix = true

[tool.ruff.lint.isort]
force-single-line = true
known-first-party = ["somacore"]
single-line-exclusions = ["typing", "typing_extensions"]

[tool.mypy]
check_untyped_defs = true
Expand Down
41 changes: 18 additions & 23 deletions python-spec/src/somacore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,27 @@

from .base import SOMAObject
from .collection import Collection
from .coordinates import AffineTransform
from .coordinates import Axis
from .coordinates import CoordinateSpace
from .coordinates import CoordinateTransform
from .coordinates import IdentityTransform
from .coordinates import ScaleTransform
from .coordinates import UniformScaleTransform
from .data import DataFrame
from .data import DenseNDArray
from .data import NDArray
from .data import ReadIter
from .data import SparseNDArray
from .data import SparseRead
from .coordinates import (
AffineTransform,
Axis,
CoordinateSpace,
CoordinateTransform,
IdentityTransform,
ScaleTransform,
UniformScaleTransform,
)
from .data import DataFrame, DenseNDArray, NDArray, ReadIter, SparseNDArray, SparseRead
from .experiment import Experiment
from .measurement import Measurement
from .options import BatchSize
from .options import IOfN
from .options import ResultOrder
from .query import AxisColumnNames
from .query import AxisQuery
from .query import ExperimentAxisQuery
from .options import BatchSize, IOfN, ResultOrder
from .query import AxisColumnNames, AxisQuery, ExperimentAxisQuery
from .scene import Scene
from .spatial import GeometryDataFrame
from .spatial import MultiscaleImage
from .spatial import PointCloudDataFrame
from .spatial import SpatialRead
from .spatial import (
GeometryDataFrame,
MultiscaleImage,
PointCloudDataFrame,
SpatialRead,
)
from .types import ContextBase

try:
Expand Down
3 changes: 1 addition & 2 deletions python-spec/src/somacore/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

from typing_extensions import LiteralString, Self

from . import options
from . import types
from . import options, types


class SOMAObject(metaclass=abc.ABCMeta):
Expand Down
4 changes: 1 addition & 3 deletions python-spec/src/somacore/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
import pyarrow as pa
from typing_extensions import Final, Self

from . import base
from . import data
from . import options
from . import base, data, options

_Elem = TypeVar("_Elem", bound=base.SOMAObject)
"""Element Type for a SOMA collection."""
Expand Down
3 changes: 1 addition & 2 deletions python-spec/src/somacore/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import numpy.typing as npt
from typing_extensions import Self

from .types import str_or_seq_length
from .types import to_string_tuple
from .types import str_or_seq_length, to_string_tuple


@attrs.define(frozen=True)
Expand Down
3 changes: 1 addition & 2 deletions python-spec/src/somacore/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import pyarrow as pa
from typing_extensions import Final, Literal, Self

from . import base
from . import options
from . import base, options

_RO_AUTO = options.ResultOrder.AUTO

Expand Down
5 changes: 1 addition & 4 deletions python-spec/src/somacore/ephemeral/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
Collection.
"""

from .collections import Collection
from .collections import Experiment
from .collections import Measurement
from .collections import Scene
from .collections import Collection, Experiment, Measurement, Scene

__all__ = (
"Collection",
Expand Down
20 changes: 11 additions & 9 deletions python-spec/src/somacore/ephemeral/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@

from typing_extensions import Literal, Self

from .. import base
from .. import collection
from .. import coordinates
from .. import data
from .. import experiment
from .. import measurement
from .. import options
from .. import scene
from .. import spatial
from .. import (
base,
collection,
coordinates,
data,
experiment,
measurement,
options,
scene,
spatial,
)

_Elem = TypeVar("_Elem", bound=base.SOMAObject)

Expand Down
8 changes: 1 addition & 7 deletions python-spec/src/somacore/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@

from typing_extensions import Final, Self

from . import _mixin
from . import base
from . import collection
from . import data
from . import measurement
from . import query
from . import scene
from . import _mixin, base, collection, data, measurement, query, scene

_DF = TypeVar("_DF", bound=data.DataFrame)
"""An implementation of a DataFrame."""
Expand Down
5 changes: 1 addition & 4 deletions python-spec/src/somacore/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

from typing_extensions import Final

from . import _mixin
from . import base
from . import collection
from . import data
from . import _mixin, base, collection, data

_DF = TypeVar("_DF", bound=data.DataFrame)
"""A particular implementation of DataFrame."""
Expand Down
3 changes: 1 addition & 2 deletions python-spec/src/somacore/query/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from . import axis
from . import query
from . import axis, query

ExperimentAxisQuery = query.ExperimentAxisQuery
AxisColumnNames = query.AxisColumnNames
Expand Down
3 changes: 1 addition & 2 deletions python-spec/src/somacore/query/_fast_csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
from scipy import sparse

from .. import data as scd
from . import _eager_iter
from . import types
from . import _eager_iter, types


def read_csr(
Expand Down
3 changes: 1 addition & 2 deletions python-spec/src/somacore/query/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import numpy as np
import pyarrow as pa

from .. import options
from .. import types
from .. import options, types


def _canonicalize_coords(
Expand Down
8 changes: 2 additions & 6 deletions python-spec/src/somacore/query/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@
from scipy import sparse
from typing_extensions import Literal, Protocol, Self, TypedDict

from .. import data
from .. import measurement
from .. import options
from .. import data, measurement, options
from .. import types as base_types
from . import _fast_csr
from . import axis
from . import types
from . import _fast_csr, axis, types

_RO_AUTO = options.ResultOrder.AUTO

Expand Down
6 changes: 1 addition & 5 deletions python-spec/src/somacore/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@

from typing_extensions import Final

from . import _mixin
from . import base
from . import collection
from . import coordinates
from . import spatial
from . import _mixin, base, collection, coordinates, spatial

_MultiscaleImage = TypeVar("_MultiscaleImage", bound=spatial.MultiscaleImage)
"""A particular implementation of a multiscale image."""
Expand Down
5 changes: 1 addition & 4 deletions python-spec/src/somacore/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
import pyarrow as pa
from typing_extensions import Final, Self

from . import base
from . import coordinates
from . import data
from . import options
from . import base, coordinates, data, options

_DenseND = TypeVar("_DenseND", bound=data.DenseNDArray)
"""A particular implementation of a collection of DenseNDArrays."""
Expand Down
16 changes: 9 additions & 7 deletions python-spec/testing/test_coordinates.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import numpy as np
import pytest

from somacore import AffineTransform
from somacore import Axis
from somacore import CoordinateSpace
from somacore import CoordinateTransform
from somacore import IdentityTransform
from somacore import ScaleTransform
from somacore import UniformScaleTransform
from somacore import (
AffineTransform,
Axis,
CoordinateSpace,
CoordinateTransform,
IdentityTransform,
ScaleTransform,
UniformScaleTransform,
)


def check_transform_is_equal(
Expand Down
3 changes: 1 addition & 2 deletions python-spec/testing/test_mixin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import unittest

from somacore import _mixin
from somacore import ephemeral
from somacore import _mixin, ephemeral


class TestItem(unittest.TestCase):
Expand Down
Loading