Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 18, 2023
1 parent eb60438 commit 3b970e8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
4 changes: 1 addition & 3 deletions asdf/_tests/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
7 changes: 1 addition & 6 deletions asdf/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<Block {} off: {} alc: {} size: {}>".format(
self._array_storage[:3],
self._offset,
self._allocated,
self._size,
)
return f"<Block {self._array_storage[:3]} off: {self._offset} alc: {self._allocated} size: {self._size}>"

def __len__(self):
return self._size
Expand Down
5 changes: 1 addition & 4 deletions compatibility_tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions compatibility_tests/test_file_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3b970e8

Please sign in to comment.