Skip to content

Commit 693585a

Browse files
committed
Update various docstrings.
1 parent 8a73467 commit 693585a

File tree

6 files changed

+55
-19
lines changed

6 files changed

+55
-19
lines changed

colour_datasets/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88
`Zenodo <https://zenodo.org>`__ under the `Colour Science - Datasets \
99
<https://zenodo.org/communities/colour-science-datasets>`__ community.
1010
11+
This package provides access to standardised colour science datasets including
12+
spectral power distributions, colour matching functions, and experimental data
13+
from research publications.
14+
1115
Subpackages
1216
-----------
13-
- loaders: Dataset loaders.
14-
- records: *Zenodo* records management.
15-
- utilities: Various utilities.
17+
- loaders: Dataset loading and parsing utilities.
18+
- records: *Zenodo* records management and configuration.
19+
- utilities: Common utilities for dataset processing.
1620
"""
1721

1822
# isort: skip_file

colour_datasets/loaders/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
"""
2+
Loaders
3+
=======
4+
5+
Dataset loading and parsing utilities.
6+
7+
This subpackage provides dataset loaders for various colour science datasets
8+
hosted on Zenodo, including spectral power distributions, colour matching
9+
functions, and experimental data from research publications.
10+
"""
11+
112
# isort: skip_file
213

314
from __future__ import annotations
@@ -143,7 +154,7 @@
143154

144155
def load(dataset: int | str) -> Any:
145156
"""
146-
Load given dataset: The dataset is pulled locally, i.e., synced if required
157+
Load specified dataset: The dataset is pulled locally, i.e., synced if required
147158
and then its data is loaded.
148159
149160
Parameters

colour_datasets/records/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
"""
2+
Records
3+
=======
4+
5+
Zenodo records management and configuration.
6+
7+
This subpackage provides interfaces for managing Zenodo community records,
8+
configuration handling, and dataset metadata retrieval from the Colour Science
9+
Datasets community on Zenodo.
10+
"""
11+
112
# isort: skip_file
213

314
from __future__ import annotations

colour_datasets/utilities/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""
2+
Utilities
3+
=========
4+
5+
Common utilities for dataset processing and manipulation.
6+
7+
This subpackage provides file handling utilities, data compression tools,
8+
and spreadsheet processing functions to support dataset operations.
9+
"""
10+
111
# isort: skip_file
212

313
from .common import (

colour_datasets/utilities/common.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Common Utilities
33
================
44
5-
Define the common utilities objects that don't fall in any specific category.
5+
Define common utility objects for file operations and data processing.
66
"""
77

88
from __future__ import annotations
@@ -103,7 +103,7 @@ def update_to(
103103

104104
def hash_md5(filename: str, chunk_size: int = 2**16) -> str:
105105
"""
106-
Compute the *Message Digest 5 (MD5)* hash of given file.
106+
Compute the *Message Digest 5 (MD5)* hash of specified file.
107107
108108
Parameters
109109
----------
@@ -115,7 +115,7 @@ def hash_md5(filename: str, chunk_size: int = 2**16) -> str:
115115
Returns
116116
-------
117117
:class:`str`
118-
*MD5* hash of given file.
118+
*MD5* hash of specified file.
119119
"""
120120

121121
md5 = hashlib.md5() # noqa: S324
@@ -135,7 +135,7 @@ def url_download(
135135
url: str, filename: str, md5: str | None = None, retries: int = 3
136136
) -> None:
137137
"""
138-
Download given url and saves its content at given file.
138+
Download specified url and saves its content at specified file.
139139
140140
Parameters
141141
----------
@@ -144,8 +144,8 @@ def url_download(
144144
filename
145145
File to save the url content at.
146146
md5
147-
*Message Digest 5 (MD5)* hash of the content at given url. If provided
148-
the saved content at given file will be hashed and compared to ``md5``.
147+
*Message Digest 5 (MD5)* hash of the content at specified url. If provided
148+
the saved content at specified file will be hashed and compared to ``md5``.
149149
retries
150150
Number of retries in case where a networking error occurs or the *MD5*
151151
hash is not matching.
@@ -200,7 +200,7 @@ def url_download(
200200
@cached(cache=TTLCache(maxsize=256, ttl=300))
201201
def json_open(url: str, retries: int = 3) -> Dict:
202202
"""
203-
Open given url and return its content as *JSON*.
203+
Open specified url and return its content as *JSON*.
204204
205205
Parameters
206206
----------
@@ -256,7 +256,7 @@ def unpack_gzipfile(
256256
*args: Any, # noqa: ARG001
257257
) -> bool:
258258
"""
259-
Unpack given *GZIP* file to given extraction directory.
259+
Unpack specified *GZIP* file to specified extraction directory.
260260
261261
Parameters
262262
----------

colour_datasets/utilities/spreadsheet.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
def _column_number_to_letters(number: int) -> str:
5050
"""
51-
Convert given column number into a column letters.
51+
Convert specified column number into a column letters.
5252
5353
Right shifts the column index by 26 to find column letters in reverse
5454
order. These numbers are 1-based, and can be converted to ASCII
@@ -104,7 +104,7 @@ def _column_number_to_letters(number: int) -> str:
104104

105105
def row_to_index(row: int | str) -> int:
106106
"""
107-
Return the 0-based index of given row name.
107+
Return the 0-based index of specified row name.
108108
109109
Parameters
110110
----------
@@ -131,7 +131,7 @@ def row_to_index(row: int | str) -> int:
131131

132132
def index_to_row(index: int) -> str:
133133
"""
134-
Return the row name of given 0-based index.
134+
Return the row name of specified 0-based index.
135135
136136
Parameters
137137
----------
@@ -154,7 +154,7 @@ def index_to_row(index: int) -> str:
154154

155155
def column_to_index(column: str) -> int:
156156
"""
157-
Return the 0-based index of given column letters.
157+
Return the 0-based index of specified column letters.
158158
159159
Parameters
160160
----------
@@ -177,7 +177,7 @@ def column_to_index(column: str) -> int:
177177

178178
def index_to_column(index: int) -> str:
179179
"""
180-
Return the column letters of given 0-based index.
180+
Return the column letters of specified 0-based index.
181181
182182
Parameters
183183
----------
@@ -207,8 +207,8 @@ def index_to_column(index: int) -> str:
207207

208208
def cell_range_values(sheet: xlrd.sheet.Sheet, cell_range: str) -> List[str]:
209209
"""
210-
Return given workbook sheet cell range values, i.e., the values of the
211-
rows and columns for given cell range.
210+
Return specified workbook sheet cell range values, i.e., the values of the
211+
rows and columns for specified cell range.
212212
213213
Parameters
214214
----------

0 commit comments

Comments
 (0)