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 Jan 14, 2025
1 parent efe2447 commit 26b3c84
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
4 changes: 1 addition & 3 deletions colour_datasets/loaders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ def load(dataset: int | str) -> Any:
--------
>>> len(load("3245883").keys()) # doctest: +SKIP
28
>>> len(
... load("Camera Spectral Sensitivity Database - " "Jiang et al. (2013)").keys()
... )
>>> len(load("Camera Spectral Sensitivity Database - Jiang et al. (2013)").keys())
... # doctest: +SKIP
28
"""
Expand Down
6 changes: 2 additions & 4 deletions colour_datasets/loaders/hung1995.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,8 @@ def load(
"Table II.csv": "Intra- and interobserver variances for each "
"reference hue expressed in circumferential "
"hue-angle difference.",
"Table III.csv": "Weight-averaged constant hue loci for the CL "
"experiment.",
"Table IV.csv": "Weight-averaged constant hue loci for the VL "
"experiment.",
"Table III.csv": "Weight-averaged constant hue loci for the CL experiment.",
"Table IV.csv": "Weight-averaged constant hue loci for the VL experiment.",
}

for filename in filenames:
Expand Down
3 changes: 1 addition & 2 deletions colour_datasets/loaders/solomotav2023.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ def load(self) -> Dict[str, Dict[str, RGB_CameraSensitivities]]:
("Ground Truth", "ground-truths"),
]:
csv_files = glob.glob(
f'{os.path.join(self.record.repository, "dataset", path, path)}/'
f"*.csv"
f"{os.path.join(self.record.repository, 'dataset', path, path)}/*.csv"
)
for csv_file in csv_files:
camera_name = os.path.splitext(os.path.basename(csv_file))[0].replace(
Expand Down
23 changes: 10 additions & 13 deletions colour_datasets/records/zenodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,22 +200,22 @@ def strip_html(text: str) -> str:

files = "\n".join(
[
f'- {file_data["key"]} : {file_data["links"]["self"]}'
f"- {file_data['key']} : {file_data['links']['self']}"
for file_data in sorted(files, key=lambda x: x["key"])
]
)

return "\n".join(
[
f'{metadata["title"]} - {metadata["version"]}',
f'{"=" * (len(self.title) + 3 + len(metadata["version"]))}',
f"{metadata['title']} - {metadata['version']}",
f"{'=' * (len(self.title) + 3 + len(metadata['version']))}",
"",
f"Record ID : {self.id}",
f"Authors : {authors}",
f'License : {metadata["license"]["id"]}',
f'DOI : {metadata["doi"]}',
f'Publication Date : {metadata["publication_date"]}',
f'URL : {self._data["links"]["self_html"]}\n',
f"License : {metadata['license']['id']}",
f"DOI : {metadata['doi']}",
f"Publication Date : {metadata['publication_date']}",
f"URL : {self._data['links']['self_html']}\n",
"Description",
"-----------",
"",
Expand Down Expand Up @@ -628,10 +628,7 @@ def __str__(self) -> str:

datasets = "\n".join(
[
(
f"[{'x' if dataset.synced() else ' '}] "
f"{dataset.id} : {dataset.title}"
)
(f"[{'x' if dataset.synced() else ' '}] {dataset.id} : {dataset.title}")
for dataset in sorted(self.values(), key=lambda x: x.title)
]
)
Expand All @@ -641,11 +638,11 @@ def __str__(self) -> str:
return "\n".join(
[
f"{self._configuration.community}",
f'{"=" * len(self._configuration.community)}',
f"{'=' * len(self._configuration.community)}",
"",
f"Datasets : {len(self)}",
f"Synced : {synced}",
f'URL : {self._data["community"]["links"]["self_html"]}',
f"URL : {self._data['community']['links']['self_html']}",
"",
"Datasets",
"--------",
Expand Down
3 changes: 1 addition & 2 deletions colour_datasets/utilities/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ def url_download(

if md5 is not None and md5.lower() != hash_md5(filename):
msg = (
f'"MD5" hash of "{filename}" file does not match the '
f"expected hash!"
f'"MD5" hash of "{filename}" file does not match the expected hash!'
)
raise ValueError( # noqa: TRY301
msg
Expand Down

0 comments on commit 26b3c84

Please sign in to comment.