Skip to content

Commit

Permalink
It's ruff.
Browse files Browse the repository at this point in the history
  • Loading branch information
matz-e committed Aug 21, 2024
1 parent 26fc49a commit 15c9528
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/functionalizer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
from pathlib import Path

import pyarrow.parquet as pq
import sparkmanager as sm
from fz_td_recipe import Recipe
from pyspark.sql import functions as F

import sparkmanager as sm

from . import utils
from .circuit import Circuit
from .definitions import CheckpointPhases, SortBy
Expand Down
1 change: 0 additions & 1 deletion src/functionalizer/filters/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from pathlib import Path

import sparkmanager as sm

from functionalizer.circuit import Circuit
from functionalizer.utils import get_logger
from functionalizer.utils.checkpointing import checkpoint_resume
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Filter that matches distributions of synapses."""

import sparkmanager as sm
from pyspark.sql import functions as F

import sparkmanager as sm
from functionalizer.circuit import touches_per_pathway
from functionalizer.definitions import CheckpointPhases
from functionalizer.filters import DatasetOperation, helpers
Expand Down
2 changes: 1 addition & 1 deletion src/functionalizer/filters/implementations/spine_length.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from operator import attrgetter

import pandas as pd
import sparkmanager as sm
from pyspark.sql import functions as F

import sparkmanager as sm
from functionalizer.filters import DatasetOperation, FilterInitializationError
from functionalizer.utils import get_logger

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Filters to add properties to synapses."""

import sparkmanager as sm
from pyspark.sql import functions as F
from pyspark.sql import types as T

import sparkmanager as sm
from functionalizer.filters import DatasetOperation
from functionalizer.utils import get_logger

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import numpy as np
import pandas as pd
import sparkmanager as sm

import sparkmanager as sm
from functionalizer.filters import DatasetOperation, FilterInitializationError


Expand Down
2 changes: 1 addition & 1 deletion src/functionalizer/filters/implementations/touch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import numpy as np
import pandas as pd
import sparkmanager as sm
from pyspark.sql import functions as F

import sparkmanager as sm
from functionalizer.filters import DatasetOperation
from functionalizer.utils import get_logger

Expand Down
2 changes: 1 addition & 1 deletion src/functionalizer/io/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

import pandas as pd
import pyarrow.parquet as pq
import sparkmanager as sm
from packaging.version import VERSION_PATTERN, Version
from pyspark.sql import DataFrame
from pyspark.sql import functions as F

import sparkmanager as sm
from functionalizer import schema
from functionalizer.schema import OUTPUT_MAPPING
from functionalizer.utils import get_logger
Expand Down
3 changes: 2 additions & 1 deletion src/functionalizer/utils/checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
from functools import wraps
from inspect import signature

import sparkmanager as sm
from pyspark.sql.column import _to_seq

import sparkmanager as sm

from . import get_logger
from .filesystem import exists, isdir, size

Expand Down
3 changes: 2 additions & 1 deletion src/functionalizer/utils/spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

from contextlib import contextmanager

import sparkmanager as sm
from pyspark.sql import functions as F

import sparkmanager as sm

from . import get_logger

logger = get_logger(__name__)
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from pathlib import Path

import pytest

from functionalizer import filters
from functionalizer.core import Functionalizer
from functionalizer.definitions import RunningMode as RM
Expand Down
1 change: 1 addition & 0 deletions tests/test_data_input_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytest
from conftest import DATADIR, create_functionalizer

from functionalizer.io import NodeData


Expand Down
1 change: 1 addition & 0 deletions tests/test_data_input_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy
import pandas as pd
import pytest

import sparkmanager as sm
from functionalizer.io.circuit import BRANCH_COLUMNS, EdgeData
from functionalizer.utils.conf import Configuration
Expand Down
3 changes: 2 additions & 1 deletion tests/test_data_input_sonata.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import h5py
import numpy
import pytest
import sparkmanager as sm
from conftest import DATADIR, DEFAULT_ARGS, create_functionalizer

import sparkmanager as sm
from functionalizer.io.circuit import BRANCH_COLUMNS, EdgeData
from functionalizer.utils.conf import Configuration

Expand Down
3 changes: 2 additions & 1 deletion tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import pandas as pd
import pyspark.sql.functions as F
import pytest
import sparkmanager as sm
from conftest import DATADIR, DEFAULT_ARGS, create_functionalizer

import sparkmanager as sm
from functionalizer.utils.spark import cache_broadcast_single_part

NUM_AFTER_DISTANCE = 226301
Expand Down
3 changes: 2 additions & 1 deletion tests/test_gap_junctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

import numpy as np
import pytest
from functionalizer.filters import DatasetOperation
from pyspark.sql import functions as F

from functionalizer.filters import DatasetOperation

# (src, dst), num_connections
DENDRO_DATA = [
((987, 990), 10), # 6 with exact or abs() == 1 match
Expand Down
3 changes: 2 additions & 1 deletion tests/test_morpho_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
from unittest.mock import MagicMock

import pytest
from fz_td_recipe import Recipe

import sparkmanager as sm
from functionalizer.circuit import Circuit
from functionalizer.schema import LEGACY_MAPPING
from functionalizer.utils.conf import Configuration
from fz_td_recipe import Recipe


class MockLoader:
Expand Down
1 change: 1 addition & 0 deletions tests/test_morphologies.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import numpy
import pytest

from functionalizer.io.morphologies import MorphologyDB

BRANCHES = [
Expand Down
5 changes: 3 additions & 2 deletions tests/test_property_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
from pathlib import Path

import pytest
import sparkmanager as sm
from conftest import CIRCUIT_CONFIG, DATADIR
from functionalizer.filters import DatasetOperation
from fz_td_recipe import Recipe

import sparkmanager as sm
from functionalizer.filters import DatasetOperation


@pytest.mark.slow
def test_property_assignment(fz):
Expand Down
1 change: 1 addition & 0 deletions tests/test_spine_morphology.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import numpy.testing as npt
import pandas as pd
import pytest

from functionalizer.filters.implementations.spine_morphologies import (
_create_spine_morphology_udf,
_read_spine_morphology_attributes,
Expand Down

0 comments on commit 15c9528

Please sign in to comment.