Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 621a840

Browse files
committed
Clean up docstrings (convert several single-quote string comments to triple-quote docstrings for consistency.)
Signed-off-by: Paul G <[email protected]>
1 parent ed95382 commit 621a840

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

lib/matplotlib/dates.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,18 @@ def date2num(d):
311311

312312

313313
def julian2num(j):
314-
'Convert a Julian date (or sequence) to a matplotlib date (or sequence).'
314+
"""
315+
Convert a Julian date (or sequence) to a matplotlib date (or sequence).
316+
"""
315317
if cbook.iterable(j):
316318
j = np.asarray(j)
317319
return j - 1721424.5
318320

319321

320322
def num2julian(n):
321-
'Convert a matplotlib date (or sequence) to a Julian date (or sequence).'
323+
"""
324+
Convert a matplotlib date (or sequence) to a Julian date (or sequence).
325+
"""
322326
if cbook.iterable(n):
323327
n = np.asarray(n)
324328
return n + 1721424.5
@@ -1207,7 +1211,9 @@ def _get_interval(self):
12071211

12081212

12091213
def _close_to_dt(d1, d2, epsilon=5):
1210-
'Assert that datetimes *d1* and *d2* are within *epsilon* microseconds.'
1214+
"""
1215+
Assert that datetimes *d1* and *d2* are within *epsilon* microseconds.
1216+
"""
12111217
delta = d2 - d1
12121218
mus = abs(delta.days * MUSECONDS_PER_DAY + delta.seconds * 1e6 +
12131219
delta.microseconds)
@@ -1300,22 +1306,30 @@ def date_ticker_factory(span, tz=None, numticks=5):
13001306

13011307

13021308
def seconds(s):
1303-
'Return seconds as days.'
1309+
"""
1310+
Return seconds as days.
1311+
"""
13041312
return float(s) / SEC_PER_DAY
13051313

13061314

13071315
def minutes(m):
1308-
'Return minutes as days.'
1316+
"""
1317+
Return minutes as days.
1318+
"""
13091319
return float(m) / MINUTES_PER_DAY
13101320

13111321

13121322
def hours(h):
1313-
'Return hours as days.'
1323+
"""
1324+
Return hours as days.
1325+
"""
13141326
return h / 24.
13151327

13161328

13171329
def weeks(w):
1318-
'Return weeks as days.'
1330+
"""
1331+
Return weeks as days.
1332+
"""
13191333
return w * 7.
13201334

13211335

@@ -1360,7 +1374,9 @@ def convert(value, unit, axis):
13601374

13611375
@staticmethod
13621376
def default_units(x, axis):
1363-
'Return the tzinfo instance of *x* or of its first element, or None'
1377+
"""
1378+
Return the tzinfo instance of *x* or of its first element, or None
1379+
"""
13641380
if isinstance(x, np.ndarray):
13651381
x = x.ravel()
13661382

0 commit comments

Comments
 (0)