Skip to content

Commit 2d4116a

Browse files
authored
Merge pull request #92 from ArcanaFramework/touch-ups
Minor touch ups
2 parents b54e9df + 10729bd commit 2d4116a

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,19 @@ repos:
2323
args:
2424
- --ignore-words=.codespell-ignorewords
2525
- repo: https://github.com/PyCQA/flake8
26-
rev: 4.0.1
26+
rev: 7.0.0
2727
hooks:
2828
- id: flake8
2929
- repo: https://github.com/pre-commit/mirrors-mypy
3030
rev: v1.11.2
3131
hooks:
3232
- id: mypy
33-
args: [--strict, --install-types, --non-interactive, --no-warn-unused-ignores]
33+
args:
34+
[
35+
--strict,
36+
--install-types,
37+
--non-interactive,
38+
--no-warn-unused-ignores,
39+
]
3440
exclude: tests
3541
additional_dependencies: [pytest, attrs, imageio, pydicom]

fileformats/core/collection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def _validate_required_content_types(self) -> None:
4444
return
4545
assert not_found
4646
raise FormatMismatchError(
47-
f"Did not find the required content types, {not_found}, in {self}"
47+
f"Did not find the required content types, {not_found}, in {self}, paths: "
48+
f"{[str(p) for p in self.content_fspaths]}"
4849
)
4950

5051
@classproperty

fileformats/core/fileset.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def __init__(
101101
metadata: ty.Optional[ty.Dict[str, ty.Any]] = None,
102102
**load_kwargs: ty.Any,
103103
):
104+
if not fspaths:
105+
raise ValueError("No file-system paths provided to FileSet")
104106
self._explicit_metadata = metadata
105107
self._load_kwargs = load_kwargs
106108
self._validate_class()
@@ -800,7 +802,7 @@ def byte_chunks(
800802
rel_path: str
801803
relative path to either 'relative_to' arg or common base path for each file
802804
in the file set
803-
byte_iter : Generator[bytes]
805+
byte_iter : Generator[bytes, None, None]
804806
an iterator over the bytes contents of the file, chunked into 'chunk_len'
805807
chunks
806808
"""

fileformats/core/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ def __init__(self, imported: bool, pkg: ty.Optional[str], pypi: ty.Optional[str]
182182
self.pkg = pkg
183183
self.pypi = pypi
184184

185+
def __repr__(self) -> str:
186+
return (
187+
f"{type(self).__name__}(pkg={self.pkg}, pypi={self.pypi}, "
188+
f"imported={self.imported})"
189+
)
190+
185191

186192
def import_extras_module(klass: ty.Type["fileformats.core.DataType"]) -> ExtrasModule:
187193
"""Attempt to load extras module corresponding to the provided class's module

0 commit comments

Comments
 (0)