Skip to content

Commit 9c24420

Browse files
committed
Fix docstrings
1 parent 1d832b5 commit 9c24420

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/imcflibs/pathtools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def parse_path(path, prefix=""):
142142

143143

144144
def join2(path1, path2):
145-
"""Join two paths into one, much like os.path.join().
145+
r"""Join two paths into one, much like os.path.join().
146146
147147
The main difference is that `join2()` takes exactly two arguments, but they
148148
can be non-str (as long as they're having a `__str__()` method), so this is
@@ -358,12 +358,12 @@ def folder_size(source):
358358

359359

360360
def create_directory(new_path):
361-
"""create a new directory if it does not already exist
361+
"""create a new directory if it does not already exist.
362362
363363
Parameters
364364
----------
365365
new_path : str
366-
Path to the new directory
366+
Path to the new directory.
367367
"""
368368
if not os.path.exists(new_path):
369369
os.makedirs(new_path)

src/imcflibs/strtools.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ def _is_string_like(obj):
1414
instance of it (or a subclass thereof). So it's more generic than using
1515
isinstance(obj, str).
1616
17+
Parameters
18+
----------
19+
obj : any
20+
The object to be checked for being string-like.
21+
1722
Example
1823
-------
1924
>>> _is_string_like('foo')
@@ -41,6 +46,7 @@ def filename(name):
4146
Parameters
4247
----------
4348
name : str or filehandle or java.io.File
49+
The object to retrieve the filename from.
4450
4551
Returns
4652
-------
@@ -78,6 +84,7 @@ def flatten(lst):
7884
Parameters
7985
----------
8086
lst : list(str)
87+
The list of strings to be flattened.
8188
8289
Returns
8390
-------

0 commit comments

Comments
 (0)