Skip to content

Using ruff for linting #03 #81

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

Merged
Merged
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
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ select = [
# "BLE", # flake8-blind-except (checks the except blocks that do not specify exception)
# "FBT", # flake8-boolean-trap (ensure that boolean args can be used with kw only)
# "E", # pycodestyle errors (PEP 8 style guide violations)
# "W", # pycodestyle warnings (e.g., extra spaces, indentation issues)
"W", # pycodestyle warnings (e.g., extra spaces, indentation issues)
# "DOC", # pydoclint issues (e.g., extra or missing return, yield, warnings)
# "A", # flake8-buitins (check variable and function names to not shadow builtins)
# "N", # Naming convention checks (e.g., PEP 8 variable and function names)
# "F", # Pyflakes errors (e.g., unused imports, undefined variables)
"F", # Pyflakes errors (e.g., unused imports, undefined variables)
# "I", # isort (Ensures imports are sorted properly)
# "B", # flake8-bugbear (Detects likely bugs and bad practices)
# "TID", # flake8-tidy-imports (Checks for banned or misplaced imports)
"TID", # flake8-tidy-imports (Checks for banned or misplaced imports)
"UP", # pyupgrade (Automatically updates old Python syntax)
# "YTT", # flake8-2020 (Detects outdated Python 2/3 compatibility issues)
# "FLY", # flynt (Converts old-style string formatting to f-strings)
Expand Down
3 changes: 2 additions & 1 deletion src/lasso/diffcrash/diffcrash_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
from pathlib import Path
import psutil

from ..logging import str_error, str_info, str_running, str_success, str_warn
# from ..logging import str_error, str_info, str_running, str_success, str_warn
from lasso.logging import str_error, str_info, str_running, str_success, str_warn

# pylint: disable = too-many-lines

Expand Down
2 changes: 1 addition & 1 deletion src/lasso/diffcrash/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
parse_diffcrash_args,
)

from ..logging import str_error
from lasso.logging import str_error


def _parse_stages(start_stage: str, end_stage: str):
Expand Down
14 changes: 9 additions & 5 deletions src/lasso/dimred/dimred_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@
from rich.table import Table
from rich.text import Text

from ..utils.rich_progress_bars import PlaceHolderBar, WorkingDots
from .svd.clustering_betas import create_cluster_arg_dict, create_detector_arg_dict, group_betas
from .svd.plot_beta_clusters import plot_clusters_js
from .svd.pod_functions import calculate_v_and_betas
from .svd.subsampling_methods import create_reference_subsample, remap_random_subsample
from lasso.utils.rich_progress_bars import PlaceHolderBar, WorkingDots
from lasso.dimred.svd.clustering_betas import (
create_cluster_arg_dict,
create_detector_arg_dict,
group_betas,
)
from lasso.dimred.svd.plot_beta_clusters import plot_clusters_js
from lasso.dimred.svd.pod_functions import calculate_v_and_betas
from lasso.dimred.svd.subsampling_methods import create_reference_subsample, remap_random_subsample

# pylint: disable = too-many-lines

Expand Down
3 changes: 1 addition & 2 deletions src/lasso/dimred/hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from scipy import integrate
from sklearn.neighbors import KDTree


from ..math.stochastic import jensen_shannon_entropy
from lasso.math.stochastic import jensen_shannon_entropy


def _match_modes(
Expand Down
2 changes: 1 addition & 1 deletion src/lasso/dimred/svd/subsampling_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
from sklearn.neighbors import NearestNeighbors

from ...dyna import ArrayType, D3plot
from lasso.dyna import ArrayType, D3plot


def _mark_dead_eles(node_indexes: np.ndarray, alive_shells: np.ndarray) -> np.ndarray:
Expand Down
18 changes: 9 additions & 9 deletions src/lasso/dyna/d3plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@

import numpy as np

from ..femzip.femzip_api import FemzipAPI, FemzipBufferInfo, FemzipVariableCategory
from ..io.binary_buffer import BinaryBuffer
from ..io.files import open_file_or_filepath
from ..logging import get_logger
from ..plotting import plot_shell_mesh
from .array_type import ArrayType
from .d3plot_header import D3plotFiletype, D3plotHeader
from .femzip_mapper import FemzipMapper, filter_femzip_variables
from .filter_type import FilterType
from lasso.femzip.femzip_api import FemzipAPI, FemzipBufferInfo, FemzipVariableCategory
from lasso.io.binary_buffer import BinaryBuffer
from lasso.io.files import open_file_or_filepath
from lasso.logging import get_logger
from lasso.plotting import plot_shell_mesh
from lasso.dyna.array_type import ArrayType
from lasso.dyna.d3plot_header import D3plotFiletype, D3plotHeader
from lasso.dyna.femzip_mapper import FemzipMapper, filter_femzip_variables
from lasso.dyna.filter_type import FilterType

# pylint: disable = too-many-lines

Expand Down
4 changes: 2 additions & 2 deletions src/lasso/dyna/d3plot_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import numpy as np
import rich

from ..io.binary_buffer import BinaryBuffer
from ..logging import get_logger
from lasso.io.binary_buffer import BinaryBuffer
from lasso.logging import get_logger

# We have a lot of docstrings here but even if not so, we want to contain the
# code here.
Expand Down