Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #33

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.1
hooks:
- id: codespell
args:
["--ignore-words-list=assertIn,exitance,seperately,socio-economic"]
exclude: "BIBLIOGRAPHY.bib|CONTRIBUTORS.rst"
- repo: https://github.com/PyCQA/isort
rev: "5.13.2"
rev: "6.0.0"
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.2"
rev: "v0.9.6"
hooks:
- id: ruff-format
- id: ruff
Expand Down
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