Skip to content

Commit

Permalink
chore: add pyflakes rules to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjholland committed Feb 23, 2025
1 parent dc7e73d commit 9f206bd
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 28 deletions.
8 changes: 3 additions & 5 deletions docs/source/examples/comparing-pyprobe-performance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -490,17 +490,15 @@
" overwrite_existing=True,\n",
" compression_priority=priority,\n",
" )\n",
" file_sizes[i] = os.path.getsize(\n",
" data_directory + f\"/sample_data_neware_test.parquet\"\n",
" )\n",
" file_sizes[i] = os.path.getsize(data_directory + \"/sample_data_neware_test.parquet\")\n",
" pyprobe_time, _, _ = measure_pyprobe(repeats, \"sample_data_neware_test.parquet\")\n",
" times[i, :] = pyprobe_time[-1, :]\n",
"\n",
"file_sizes = np.append(\n",
" file_sizes,\n",
" [\n",
" os.path.getsize(data_directory + f\"/sample_data_neware.xlsx\"),\n",
" os.path.getsize(data_directory + f\"/sample_data_neware.csv\"),\n",
" os.path.getsize(data_directory + \"/sample_data_neware.xlsx\"),\n",
" os.path.getsize(data_directory + \"/sample_data_neware.csv\"),\n",
" ],\n",
")\n",
"\n",
Expand Down
5 changes: 2 additions & 3 deletions pyprobe/analysis/cycling.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
"""A module for the Cycling class."""

import polars as pl
from deprecated import deprecated
from pydantic import BaseModel, validate_call
from pydantic import validate_call

from pyprobe.analysis.utils import AnalysisValidator
from pyprobe.filters import Experiment, get_cycle_column
from pyprobe.filters import get_cycle_column
from pyprobe.pyprobe_types import FilterToCycleType
from pyprobe.result import Result

Expand Down
3 changes: 1 addition & 2 deletions pyprobe/analysis/differentiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

import numpy as np
import polars as pl
from deprecated import deprecated
from pydantic import BaseModel, validate_call
from pydantic import validate_call

import pyprobe.analysis.base.differentiation_functions as diff_functions
from pyprobe.analysis.utils import AnalysisValidator
Expand Down
1 change: 0 additions & 1 deletion pyprobe/analysis/pulsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import List

import polars as pl
from deprecated import deprecated
from pydantic import BaseModel, validate_call

from pyprobe.analysis.utils import AnalysisValidator
Expand Down
3 changes: 1 addition & 2 deletions pyprobe/analysis/smoothing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

import numpy as np
import polars as pl
from deprecated import deprecated
from numpy.typing import NDArray
from pydantic import BaseModel, validate_call
from pydantic import validate_call
from scipy import interpolate
from scipy.interpolate import make_smoothing_spline
from scipy.signal import savgol_filter
Expand Down
9 changes: 1 addition & 8 deletions pyprobe/plot.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
"""A module to contain plotting functions for PyProBE."""

from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple
from typing import TYPE_CHECKING, Any, Callable, Dict, Tuple

import numpy as np
import plotly.graph_objects as go
import polars as pl
from deprecated import deprecated
from numpy.typing import NDArray
from plotly.express.colors import sample_colorscale
from plotly.subplots import make_subplots
from sklearn.preprocessing import minmax_scale

if TYPE_CHECKING:
from pyprobe.result import Result
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ select = [
"I", # isort: Check and enforce import ordering
"TID", # flake8-tidy-imports
"SLF001", # private-member-access: Checks for accesses on "private" class members.
"F", # pyflakes: Check for errors in Python code
]

[tool.ruff.lint.pydocstyle]
Expand Down
5 changes: 2 additions & 3 deletions tests/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import polars as pl
import polars.testing as pl_testing
import pytest
import streamlit as st
from streamlit.testing.v1 import AppTest

from pyprobe.dashboard import (
Expand Down Expand Up @@ -199,7 +198,7 @@ def test_dashboard_select_experiment():
def select_exp_mini_app():
from unittest.mock import MagicMock

import streamlit as st
import streamlit as st # noqa: F811

from pyprobe.dashboard import _Dashboard

Expand Down Expand Up @@ -262,7 +261,7 @@ def test_dashboard_run(cell_fixture):
def run_mini_app():
from unittest.mock import patch

import streamlit as st
import streamlit as st # noqa: F811

from pyprobe import Cell
from pyprobe.dashboard import _Dashboard
Expand Down
4 changes: 0 additions & 4 deletions tests/test_plot.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
"""Tests for the Plot class."""

import numpy as np
import plotly.graph_objects as go
import polars as pl
import polars.testing as pl_testing
import pytest
from plotly.express.colors import sample_colorscale
from sklearn.preprocessing import minmax_scale

from pyprobe import plot
from pyprobe.result import Result
Expand Down

0 comments on commit 9f206bd

Please sign in to comment.