From eb60438e6ebf90df6800a64c84656f361cb6208c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 07:33:03 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.277 → v0.0.278](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.277...v0.0.278) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 31179894a..3dfd72e9b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: exclude: "asdf/extern/.*" - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.0.277' + rev: 'v0.0.278' hooks: - id: ruff args: ["--fix"] From 3b970e8295c6dc297a089acb2657d5a26915a1e0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 07:33:15 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- asdf/_tests/_helpers.py | 4 +--- asdf/block.py | 7 +------ compatibility_tests/common.py | 5 +---- compatibility_tests/test_file_compatibility.py | 5 +---- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/asdf/_tests/_helpers.py b/asdf/_tests/_helpers.py index cdf25a997..437ca5e9a 100644 --- a/asdf/_tests/_helpers.py +++ b/asdf/_tests/_helpers.py @@ -453,9 +453,7 @@ def _assert_extension_type_correctness(extension, extension_type, resolver): # Currently ExtensionType sets a default version of 1.0.0, # but we want to encourage an explicit version on the subclass. - assert "version" in extension_type.__dict__, "{} must set the 'version' class attribute".format( - extension_type.__name__, - ) + assert "version" in extension_type.__dict__, f"{extension_type.__name__} must set the 'version' class attribute" # check the default version types_to_check = [extension_type] diff --git a/asdf/block.py b/asdf/block.py index 7f0873fa2..b9cce1dfa 100644 --- a/asdf/block.py +++ b/asdf/block.py @@ -882,12 +882,7 @@ def __init__(self, data=None, uri=None, array_storage="internal", memmap=True, l self._allocated = self._size def __repr__(self): - return "".format( - self._array_storage[:3], - self._offset, - self._allocated, - self._size, - ) + return f"" def __len__(self): return self._size diff --git a/compatibility_tests/common.py b/compatibility_tests/common.py index 1e276d99a..25ccc7001 100644 --- a/compatibility_tests/common.py +++ b/compatibility_tests/common.py @@ -6,10 +6,7 @@ def generate_file(path, version): if version not in supported_versions: - msg = "ASDF Standard version {} is not supported by version {} of the asdf library".format( - version, - asdf.__version__, - ) + msg = f"ASDF Standard version {version} is not supported by version {asdf.__version__} of the asdf library" raise ValueError(msg) af = asdf.AsdfFile({"array": np.ones((8, 16))}, version=version) diff --git a/compatibility_tests/test_file_compatibility.py b/compatibility_tests/test_file_compatibility.py index af00ceded..b9f8f34ff 100644 --- a/compatibility_tests/test_file_compatibility.py +++ b/compatibility_tests/test_file_compatibility.py @@ -206,10 +206,7 @@ def test_file_compatibility(asdf_version, env_path, tmpdir): old_file_path, str(standard_version), capture_output=True, - ), "asdf library version {} failed to generate an ASDF Standard {} file".format( - asdf_version, - standard_version, - ) + ), f"asdf library version {asdf_version} failed to generate an ASDF Standard {standard_version} file" assert_file_correct(old_file_path), ( f"asdf library version {asdf_version} produced an ASDF Standard {standard_version}" "that this code failed to read"