diff --git a/pyproject.toml b/pyproject.toml index 94aac192..82e73b50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,6 +88,9 @@ lint.select = [ "E", # pycodestyle "W", # pycodestyle "PL", # pylint + "F841", # unused variable + "F401", # unused imports + "ARG", # unused arguments ] lint.ignore = [ "E701", # Multiple statements on one line (colon) diff --git a/sed/calibrator/energy.py b/sed/calibrator/energy.py index bee26a6f..d05e22e4 100644 --- a/sed/calibrator/energy.py +++ b/sed/calibrator/energy.py @@ -408,7 +408,7 @@ def update(refid, ranges): ranges=ranges_slider, ) - def apply_func(apply: bool): # pylint: disable=unused-argument + def apply_func(apply: bool): # noqa: ARG001 self.add_ranges( ranges_slider.value, refid_slider.value, @@ -1141,7 +1141,7 @@ def update(amplitude, x_center, y_center, **kwds): fig.canvas.draw_idle() - def common_apply_func(apply: bool): # pylint: disable=unused-argument + def common_apply_func(apply: bool): # noqa: ARG001 self.correction = {} self.correction["amplitude"] = correction["amplitude"] self.correction["center"] = correction["center"] diff --git a/sed/calibrator/momentum.py b/sed/calibrator/momentum.py index 73cc86a3..f0414ba2 100644 --- a/sed/calibrator/momentum.py +++ b/sed/calibrator/momentum.py @@ -8,7 +8,6 @@ from typing import Any from typing import Dict from typing import List -from typing import Sequence from typing import Tuple from typing import Union @@ -259,7 +258,7 @@ def update(plane: int, width: int): width=width_slider, ) - def apply_fun(apply: bool): # pylint: disable=unused-argument + def apply_fun(apply: bool): # noqa: ARG001 start = plane_slider.value stop = plane_slider.value + width_slider.value @@ -399,7 +398,6 @@ def feature_extract( direction: str = "ccw", feature_type: str = "points", rotsym: int = 6, - ascale: Union[float, np.ndarray] = None, symscores: bool = True, **kwds, ): @@ -542,7 +540,7 @@ def onclick(event): cid = fig.canvas.mpl_connect("button_press_event", onclick) - def apply_func(apply: bool): # pylint: disable=unused-argument + def apply_func(apply: bool): # noqa: ARG001 fig.canvas.mpl_disconnect(cid) point_no_input.close() @@ -1179,7 +1177,7 @@ def update(scale: float, xtrans: float, ytrans: float, angle: float): angle=angle_slider, ) - def apply_func(apply: bool): # pylint: disable=unused-argument + def apply_func(apply: bool): # noqa: ARG001 if transformations.get("scale", 1) != 1: self.coordinate_transform( transform_type="scaling", @@ -1492,7 +1490,7 @@ def update( point_a_y: int, point_b_x: int, point_b_y: int, - k_distance: float, # pylint: disable=unused-argument + k_distance: float, # noqa: ARG001 ): fig.canvas.draw_idle() marker_a.set_xdata(point_a_x) @@ -1528,7 +1526,7 @@ def onclick(event): cid = fig.canvas.mpl_connect("button_press_event", onclick) - def apply_func(apply: bool): # pylint: disable=unused-argument + def apply_func(apply: bool): # noqa: ARG001 point_a = [point_a_input_x.value, point_a_input_y.value] point_b = [point_b_input_x.value, point_b_input_y.value] calibration = self.calibrate( diff --git a/sed/loader/flash/loader.py b/sed/loader/flash/loader.py index 6e1afd97..0ae1b4a4 100644 --- a/sed/loader/flash/loader.py +++ b/sed/loader/flash/loader.py @@ -750,7 +750,6 @@ def parquet_handler( load_parquet: bool = False, save_parquet: bool = False, force_recreate: bool = False, - **kwds, ) -> Tuple[dd.DataFrame, dd.DataFrame]: """ Handles loading and saving of parquet files based on the provided parameters. @@ -836,7 +835,7 @@ def parquet_handler( return dataframe_electron, dataframe_pulse - def parse_metadata(self, scicat_token: str = None, **kwds) -> dict: + def parse_metadata(self, scicat_token: str = None) -> dict: """Uses the MetadataRetriever class to fetch metadata from scicat for each run. Returns: @@ -854,12 +853,12 @@ def parse_metadata(self, scicat_token: str = None, **kwds) -> dict: def get_count_rate( self, - fids: Sequence[int] = None, - **kwds, + fids: Sequence[int] = None, # noqa: ARG002 + **kwds, # noqa: ARG002 ): return None, None - def get_elapsed_time(self, fids=None, **kwds): + def get_elapsed_time(self, fids=None, **kwds): # noqa: ARG002 return None def read_dataframe( diff --git a/sed/loader/generic/loader.py b/sed/loader/generic/loader.py index 7eb92e72..f3cd5f25 100644 --- a/sed/loader/generic/loader.py +++ b/sed/loader/generic/loader.py @@ -101,10 +101,10 @@ def read_dataframe( def get_files_from_run_id( self, - run_id: str, - folders: Union[str, Sequence[str]] = None, - extension: str = None, - **kwds, + run_id: str, # noqa: ARG002 + folders: Union[str, Sequence[str]] = None, # noqa: ARG002 + extension: str = None, # noqa: ARG002 + **kwds, # noqa: ARG002 ) -> List[str]: """Locate the files for a given run identifier. @@ -120,10 +120,10 @@ def get_files_from_run_id( """ raise NotImplementedError - def get_count_rate( # Pylint: disable=unused_parameter + def get_count_rate( self, - fids: Sequence[int] = None, - **kwds, + fids: Sequence[int] = None, # noqa: ARG002 + **kwds, # noqa: ARG002 ) -> Tuple[np.ndarray, np.ndarray]: """Create count rate data for the files specified in ``fids``. @@ -139,10 +139,10 @@ def get_count_rate( # Pylint: disable=unused_parameter # TODO return None, None - def get_elapsed_time( # Pylint: disable=unused_parameter + def get_elapsed_time( self, - fids: Sequence[int] = None, - **kwds, + fids: Sequence[int] = None, # noqa: ARG002 + **kwds, # noqa: ARG002 ) -> float: """Return the elapsed time in the files specified in ``fids``. diff --git a/sed/loader/mpes/loader.py b/sed/loader/mpes/loader.py index 11c7b9b4..1793a300 100644 --- a/sed/loader/mpes/loader.py +++ b/sed/loader/mpes/loader.py @@ -634,7 +634,7 @@ def get_files_from_run_id( run_id: str, folders: Union[str, Sequence[str]] = None, extension: str = "h5", - **kwds, + **kwds, # noqa: ARG002 ) -> List[str]: """Locate the files for a given run identifier. diff --git a/sed/loader/sxp/loader.py b/sed/loader/sxp/loader.py index ce89e546..67faca4c 100644 --- a/sed/loader/sxp/loader.py +++ b/sed/loader/sxp/loader.py @@ -898,12 +898,12 @@ def gather_metadata(self, metadata: dict = None) -> dict: def get_count_rate( self, - fids: Sequence[int] = None, - **kwds, + fids: Sequence[int] = None, # noqa: ARG002 + **kwds, # noqa: ARG002 ): return None, None - def get_elapsed_time(self, fids=None, **kwds): + def get_elapsed_time(self, fids=None, **kwds): # noqa: ARG002 return None def read_dataframe( diff --git a/tests/loader/flash/test_flash_metadata.py b/tests/loader/flash/test_flash_metadata.py index eee1e9d8..ef5305ad 100644 --- a/tests/loader/flash/test_flash_metadata.py +++ b/tests/loader/flash/test_flash_metadata.py @@ -11,7 +11,7 @@ def mock_requests(requests_mock): # Test cases for MetadataRetriever -def test_get_metadata(mock_requests): +def test_get_metadata(mock_requests): # noqa: ARG001 metadata_config = { "scicat_url": "https://example.com", "scicat_token": "fake_token", @@ -22,7 +22,7 @@ def test_get_metadata(mock_requests): assert metadata == {"fake": "data"} -def test_get_metadata_with_existing_metadata(mock_requests): +def test_get_metadata_with_existing_metadata(mock_requests): # noqa: ARG001 metadata_config = { "scicat_url": "https://example.com", "scicat_token": "fake_token", @@ -34,7 +34,7 @@ def test_get_metadata_with_existing_metadata(mock_requests): assert metadata == {"existing": "metadata", "fake": "data"} -def test_get_metadata_per_run(mock_requests): +def test_get_metadata_per_run(mock_requests): # noqa: ARG001 metadata_config = { "scicat_url": "https://example.com", "scicat_token": "fake_token",