diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 432460d..159f79f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,3 +14,8 @@ repos: - id: ruff types_or: [python, pyi, jupyter] args: [--fix, --show-fixes, --exit-non-zero-on-fix] + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + args: [--profile, black] diff --git a/polars_bio/__init__.py b/polars_bio/__init__.py index 2999923..d1cbd29 100644 --- a/polars_bio/__init__.py +++ b/polars_bio/__init__.py @@ -1,4 +1,4 @@ -from .overlap import overlap, ctx +from .overlap import ctx, overlap from .polars_bio import OverlapFilter __all__ = ["overlap", "ctx", "OverlapFilter"] diff --git a/polars_bio/overlap.py b/polars_bio/overlap.py index 3979866..a5347a6 100644 --- a/polars_bio/overlap.py +++ b/polars_bio/overlap.py @@ -9,8 +9,8 @@ import pyarrow.compute as pc from polars.io.plugins import register_io_source from typing_extensions import TYPE_CHECKING, Union -from .polars_bio import overlap_scan, overlap_frame -from .polars_bio import BioSessionContext, OverlapFilter + +from .polars_bio import BioSessionContext, OverlapFilter, overlap_frame, overlap_scan def singleton(cls): diff --git a/tests/_expected.py b/tests/_expected.py index 4aeb397..cf76e5d 100644 --- a/tests/_expected.py +++ b/tests/_expected.py @@ -1,6 +1,6 @@ -import mdpd from pathlib import Path +import mdpd import pandas as pd import polars as pl diff --git a/tests/test_bioframe.py b/tests/test_bioframe.py index 1e75066..5ec53ea 100644 --- a/tests/test_bioframe.py +++ b/tests/test_bioframe.py @@ -1,10 +1,11 @@ import bioframe as bf import pandas as pd -import polars_bio as pb - from _expected import BIO_PD_DF1, BIO_PD_DF2 + +import polars_bio as pb from polars_bio import OverlapFilter + class TestOverlapBioframe: result = pb.overlap(BIO_PD_DF1, BIO_PD_DF2, output_type="pandas.DataFrame", overlap_filter=OverlapFilter.Strict) result_bio = bf.overlap(BIO_PD_DF1, BIO_PD_DF2, diff --git a/tests/test_native_overlap.py b/tests/test_native_overlap.py index 77169ef..69848d3 100644 --- a/tests/test_native_overlap.py +++ b/tests/test_native_overlap.py @@ -1,7 +1,7 @@ import pandas as pd +from _expected import DF_PATH1, DF_PATH2, PD_DF_OVERLAP import polars_bio as pb -from _expected import PD_DF_OVERLAP, DF_PATH1, DF_PATH2 class TestOverlapNative: diff --git a/tests/test_pandas_overlap.py b/tests/test_pandas_overlap.py index 2bf2a1f..132ea50 100644 --- a/tests/test_pandas_overlap.py +++ b/tests/test_pandas_overlap.py @@ -1,7 +1,7 @@ import pandas as pd +from _expected import PD_DF1, PD_DF2, PD_DF_OVERLAP import polars_bio as pb -from _expected import PD_DF_OVERLAP, PD_DF1, PD_DF2 class TestOverlapPandas: diff --git a/tests/test_polars_overlap.py b/tests/test_polars_overlap.py index 3d23430..a9d8e3f 100644 --- a/tests/test_polars_overlap.py +++ b/tests/test_polars_overlap.py @@ -1,5 +1,6 @@ +from _expected import PL_DF1, PL_DF2, PL_DF_OVERLAP + import polars_bio as pb -from _expected import PL_DF_OVERLAP, PL_DF1, PL_DF2 class TestOverlapPolars: