Skip to content

Commit

Permalink
Add flake8-comprehension rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiggi committed Apr 2, 2024
1 parent 9b54f47 commit 9aa7c6d
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 33 deletions.
2 changes: 1 addition & 1 deletion disdrodb/l0/l0_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def _check_reader_arguments(reader):
import inspect

signature = inspect.signature(reader)
reader_arguments = sorted(list(signature.parameters.keys()))
reader_arguments = sorted(signature.parameters.keys())
expected_arguments = sorted(_get_expected_reader_arguments())
if reader_arguments != expected_arguments:
raise ValueError(f"The reader must be defined with the following arguments: {expected_arguments}")
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/tests/test_l0/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def test__read_l0a(tmp_path):


def test_read_l0a_dataframe(tmp_path):
filepaths = list()
filepaths = []

for i in [0, 1]:
# create dummy dataframe
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/tests/test_l0/test_l0b_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def test_create_l0b_from_l0a(create_test_config_files):
"diameter_bin_center",
]
assert set(ds.variables) == set(expected_variables)
assert set(ds.dims) == set(["diameter_bin_center", "time", "velocity_bin_center", "crs"])
assert set(ds.dims) == {"diameter_bin_center", "time", "velocity_bin_center", "crs"}

# Check that the geolocation coordinates have been properly set
assert np.allclose(ds.latitude.values, df.latitude.values)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ select = [
# flake8-slots
"SLOT",
# flake8-comprehensions
# "C4",
"C4",
# Ruff custom rules
# "RUF"

Expand Down
Loading

0 comments on commit 9aa7c6d

Please sign in to comment.