Skip to content

Commit 562be15

Browse files
committed
style: fix docstrings
1 parent acb41d9 commit 562be15

10 files changed

Lines changed: 20 additions & 22 deletions

File tree

docs/_scripts/gen_api_pages.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# !/usr/bin/env python
22
# encoding: utf-8
3-
43
"""
54
Generate the code reference pages and navigation.
65

splitgill/diffing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def patch(base: dict, ops: Collection[DiffOp]) -> dict:
334334
335335
:param base: the starting dict
336336
:param ops: the DiffOps to apply to the base dict (can be pure tuples, doesn't have
337-
to be DiffOp namedtuples)
337+
to be DiffOp namedtuples)
338338
:return: a new dict with the changes applied
339339
"""
340340
# nothing to do

splitgill/indexing/fields.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def path_to(self, field: str, full: bool = True) -> str:
7676
7777
:param field: the name (including dots if needed) of the field
7878
:param full: whether to prepend the parsed field name to the path or not
79-
(default: True)
79+
(default: True)
8080
:return: the path
8181
"""
8282
return parsed_path(field, self, full)
@@ -94,7 +94,7 @@ def parsed_path(
9494
:param field: the name (including dots if needed) of the field
9595
:param parsed_type: the parsed type (default: None)
9696
:param full: whether to prepend the parsed field name to the path or not (default:
97-
True)
97+
True)
9898
:return: the path
9999
"""
100100
if parsed_type is not None:
@@ -166,7 +166,7 @@ def add(self, type_names: str, count: int):
166166
Add the given type count data to this field.
167167
168168
:param type_names: the types this field is seen as a string of their names
169-
separated by commas.
169+
separated by commas.
170170
:param count: the number of records with this combination of types
171171
"""
172172
self.count += count
@@ -179,7 +179,7 @@ def is_type(self, *data_types: DataType) -> bool:
179179
180180
:param data_types: the data types to be checked
181181
:return: True if the field is an instance of one of the given data types, False
182-
if not
182+
if not
183183
"""
184184
return any(self.type_counts[data_type] > 0 for data_type in data_types)
185185

@@ -290,7 +290,7 @@ def add(self, type_names: str, count: int):
290290
Add the given type count data to this field.
291291
292292
:param type_names: the types this field is seen as a string of their names
293-
separated by commas.
293+
separated by commas.
294294
:param count: the number of records with this combination of types
295295
"""
296296
self.count += count
@@ -303,7 +303,7 @@ def is_type(self, *parsed_types: ParsedType) -> bool:
303303
304304
:param parsed_types: the parsed types to be checked
305305
:return: True if the field is an instance of one of the given parsed types,
306-
False if not
306+
False if not
307307
"""
308308
return any(self.type_counts[parsed_type] > 0 for parsed_type in parsed_types)
309309

splitgill/indexing/geo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def create_polygon_circle(
9494
:param longitude: a longitude float value
9595
:param radius_in_metres: a radius in metres value
9696
:param segments: the quad_segs parameter to pass when creating the circle around the
97-
point (the number of segments used will be 4*segments).
97+
point (the number of segments used will be 4*segments).
9898
:return: a Polygon
9999
"""
100100
if radius_in_metres <= 0:

splitgill/indexing/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def with_geo_hint(
135135
:param longitude_field: the name of the longitude field
136136
:param radius_field: the name of the radius field (optional)
137137
:param segments: the number of segments to use when creating the circle
138-
(optional, defaults to 16)
138+
(optional, defaults to 16)
139139
:return: self
140140
"""
141141
if latitude_field and longitude_field:

splitgill/ingest.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,12 @@ def generate_ops(
6767
:param data_collection: the data collection containing any existing records
6868
:param records: the records to generate insert/update ops for
6969
:param modified_field: optional field containing a modified date. If this parameter
70-
is specified, the check to see if there are any changes
71-
between the old and new versions of the data will ignore this
72-
field (if there are other fields that have changed, then a
73-
full diff is generated with these fields included). Defaults
74-
to None, indicating no modified field should be used.
70+
is specified, the check to see if there are any changes between the old and new
71+
versions of the data will ignore this field (if there are other fields that have
72+
changed, then a full diff is generated with these fields included). Defaults to
73+
None, indicating no modified field should be used.
7574
:param find_size: the number of records look up at a time. This corresponds directly
76-
to the size of the $in query ID list. Defaults to 100.
75+
to the size of the $in query ID list. Defaults to 100.
7776
:return: yields bulk Mongo ops
7877
"""
7978
# todo: refactor this, it's a bit messy
@@ -214,7 +213,7 @@ def revert_record(record: MongoRecord) -> Optional[UpdateOne]:
214213
returned as you shouldn't be reverting committed data, that breaks Splitgill!
215214
216215
:return: an UpdateOne object if there was a previous version to revert to and
217-
therefore the revert was completed, None if not
216+
therefore the revert was completed, None if not
218217
"""
219218
if not record.diffs or record.version is not None:
220219
return None

splitgill/locking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def acquire(self, lock_id: str, raise_on_fail: bool = False, **kwargs) -> bool:
4141
4242
:param lock_id: the ID of the lock to acquire
4343
:param raise_on_fail: if True, raises an AlreadyLocked exception if the lock
44-
can't be acquired. Default: False.
44+
can't be acquired. Default: False.
4545
:return: True if the lock was acquired, False if not
4646
"""
4747
try:

splitgill/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def iter(self) -> Iterable[VersionedData]:
100100
with the latest data and working back to the first version.
101101
102102
:return: VersionedData (version: int, data: dict) named tuples in descending
103-
version order
103+
version order
104104
"""
105105
yield VersionedData(self.version, self.data)
106106
base = self.data

splitgill/search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def rebuild_dict_or_list(
253253
Rebuild a dict or a list inside the parsed dict.
254254
255255
:param value: a dict which can either be for structure or a value, or a list of
256-
either value or structure dicts
256+
either value or structure dicts
257257
:return: a dict, list, or value
258258
"""
259259
if isinstance(value, dict):

splitgill/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def to_timestamp(moment: Union[datetime, date]) -> int:
2020
2121
:param moment: a datetime or date object
2222
:return: the timestamp (number of milliseconds between the UNIX epoch and the
23-
moment) as an int
23+
moment) as an int
2424
"""
2525
if isinstance(moment, datetime):
2626
return int(moment.timestamp() * 1000)
@@ -42,7 +42,7 @@ def parse_to_timestamp(
4242
:param datetime_format: the format as a string
4343
:param tz: the timezone to use (default: UTC)
4444
:return: the parsed datetime as the number of milliseconds since the UNIX epoch as
45-
an int
45+
an int
4646
"""
4747
dt = datetime.strptime(datetime_string, datetime_format)
4848
if dt.tzinfo is None:

0 commit comments

Comments
 (0)