From 6293441703748a3fb3c4d07ed51cb3188b3d8c50 Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:01:22 -0400 Subject: [PATCH 1/2] add F541 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index afb56999e..4027e1c86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,7 +91,7 @@ extend-exclude = ''' exclude = ["docs/*"] [tool.ruff.lint] -select = ["F401", "I"] # TODO: eventually, expand to other 'D', and other 'F' linting +select = ["F401", "F541", "I"] # TODO: eventually, expand to other 'D', and other 'F' linting fixable = ["ALL"] [tool.ruff.lint.per-file-ignores] From 04898db2be8d6526ffae944c3e016764d713bbe4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 20:02:04 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/streaming_cli_tests.py | 8 ++++---- tests/test_inspector.py | 2 +- tests/unit_tests/test_behavior.py | 4 ++-- tests/unit_tests/test_image_series.py | 2 +- tests/unit_tests/test_images.py | 2 +- tests/unit_tests/test_tables.py | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/streaming_cli_tests.py b/tests/streaming_cli_tests.py index db29e10ff..e8e91d38d 100644 --- a/tests/streaming_cli_tests.py +++ b/tests/streaming_cli_tests.py @@ -29,7 +29,7 @@ def test_dandiset_streaming_cli(tmpdir: py.path.local): expected_console_output = io.readlines() # Different platforms maybe have different indices for start and end of test reports - report_start = test_console_output.index(f"0 CRITICAL\n") + report_start = test_console_output.index("0 CRITICAL\n") expected_report_length = 38 report_end = report_start + expected_report_length assert test_console_output[report_start:report_end] == expected_console_output[14:] @@ -52,7 +52,7 @@ def test_dandiset_streaming_cli_with_version(tmpdir: py.path.local): expected_console_output = io.readlines() # Different platforms maybe have different indices for start and end of test reports - report_start = test_console_output.index(f"0 CRITICAL\n") + report_start = test_console_output.index("0 CRITICAL\n") expected_report_length = 38 report_end = report_start + expected_report_length assert test_console_output[report_start:report_end] == expected_console_output[14:] @@ -82,7 +82,7 @@ def test_dandiset_streaming_cli_saved_report(tmpdir: py.path.local): expected_report = io.readlines() # Different platforms maybe have different indices for start and end of test reports - report_start = test_report.index(f"0 CRITICAL\n") + report_start = test_report.index("0 CRITICAL\n") expected_report_length = 38 report_end = report_start + expected_report_length assert test_report[report_start:report_end] == expected_report[14:] @@ -115,7 +115,7 @@ def test_dandiset_streaming_cli_with_version_saved_report(tmpdir: py.path.local) expected_report = io.readlines() # Different platforms maybe have different indices for start and end of test reports - report_start = test_report.index(f"0 CRITICAL\n") + report_start = test_report.index("0 CRITICAL\n") expected_report_length = 38 report_end = report_start + expected_report_length assert test_report[report_start:report_end] == expected_report[14:] diff --git a/tests/test_inspector.py b/tests/test_inspector.py index 50b7defb2..aa0896258 100644 --- a/tests/test_inspector.py +++ b/tests/test_inspector.py @@ -150,7 +150,7 @@ def setUpClass(cls): add_non_matching_timestamps_dimension(nwbfiles[3]) cls.nwbfile_paths = [str(cls.tempdir / f"testing{j}.nwb") for j in range(num_nwbfiles)] - cls.nwbfile_paths[3] = str(cls.tempdir / f"._testing3.nwb") + cls.nwbfile_paths[3] = str(cls.tempdir / "._testing3.nwb") for nwbfile_path, nwbfile in zip(cls.nwbfile_paths, nwbfiles): with NWBHDF5IO(path=nwbfile_path, mode="w") as io: io.write(nwbfile) diff --git a/tests/unit_tests/test_behavior.py b/tests/unit_tests/test_behavior.py index 505b820dc..ee40e6194 100644 --- a/tests/unit_tests/test_behavior.py +++ b/tests/unit_tests/test_behavior.py @@ -64,8 +64,8 @@ def test_trigger_check_compass_direction_unit(): ) assert ( - check_compass_direction_unit(obj)[0].message == f"SpatialSeries objects inside a CompassDirection object " - f"should be angular and should have a unit of 'degrees' or 'radians', but 'SpatialSeries' has units 'meters'." + check_compass_direction_unit(obj)[0].message == "SpatialSeries objects inside a CompassDirection object " + "should be angular and should have a unit of 'degrees' or 'radians', but 'SpatialSeries' has units 'meters'." ) diff --git a/tests/unit_tests/test_image_series.py b/tests/unit_tests/test_image_series.py index 9f6f5e91c..4a8d0217e 100644 --- a/tests/unit_tests/test_image_series.py +++ b/tests/unit_tests/test_image_series.py @@ -23,7 +23,7 @@ @unittest.skipIf( TESTING_FILES_FOLDER_PATH is None, reason=( - f"These ImageSeries unit tests were skipped because the environment variable " + "These ImageSeries unit tests were skipped because the environment variable " "'TESTING_FILES_FOLDER_PATH' was not set!" ), ) diff --git a/tests/unit_tests/test_images.py b/tests/unit_tests/test_images.py index 4551fa989..721bd826a 100644 --- a/tests/unit_tests/test_images.py +++ b/tests/unit_tests/test_images.py @@ -40,7 +40,7 @@ def test_check_order_of_images_len(): images = Images(name="my_images", images=imgs, order_of_images=img_refs) assert check_order_of_images_len(images) == InspectorMessage( - message=f"Length of order_of_images (6) does not match the number of images (5).", + message="Length of order_of_images (6) does not match the number of images (5).", importance=Importance.BEST_PRACTICE_VIOLATION, check_function_name="check_order_of_images_len", object_type="Images", diff --git a/tests/unit_tests/test_tables.py b/tests/unit_tests/test_tables.py index fd9a5798e..c15b7d4be 100644 --- a/tests/unit_tests/test_tables.py +++ b/tests/unit_tests/test_tables.py @@ -442,7 +442,7 @@ def test_table_time_columns_are_not_negative_fail(): assert check_table_time_columns_are_not_negative(test_table) == [ InspectorMessage( - message=f"Timestamps in column test_time should not be negative." + message="Timestamps in column test_time should not be negative." " It is recommended to align the `session_start_time` or `timestamps_reference_time` to be the earliest time value that occurs in the data, and shift all other signals accordingly.", importance=Importance.BEST_PRACTICE_SUGGESTION, check_function_name="check_table_time_columns_are_not_negative", @@ -451,7 +451,7 @@ def test_table_time_columns_are_not_negative_fail(): location="/", ), InspectorMessage( - message=f"Timestamps in column start_time should not be negative." + message="Timestamps in column start_time should not be negative." " It is recommended to align the `session_start_time` or `timestamps_reference_time` to be the earliest time value that occurs in the data, and shift all other signals accordingly.", importance=Importance.BEST_PRACTICE_SUGGESTION, check_function_name="check_table_time_columns_are_not_negative",