Skip to content

Commit a84be3f

Browse files
author
Uli Köhler
committed
Fix docstring issues across the codebase
- Fix D200: Remove periods from one-line docstrings - Fix D205: Add blank lines between summary and rest of docstring - Fix D212: Combine multi-line summaries into single lines - Fix D413: Add blank lines after last paragraph of docstring - Fix D415: Add periods to end of docstring summaries - Fix D104: Add module docstrings All changes are to comply with Pydocstyle conventions.
1 parent 7d49755 commit a84be3f

45 files changed

Lines changed: 122 additions & 120 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

UliEngineering/Chemistry/DaviesEquation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
"""
4-
Davies equation for activity coefficient estimation.
3+
"""Davies equation for activity coefficient estimation.
54
65
The Davies equation is an empirical extension of Debye-Hückel theory
76
for estimating activity coefficients at higher ionic strengths (up to ~0.5 M):

UliEngineering/Chemistry/DebyeHuckel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
"""
4-
Debye-Hückel theory for activity coefficients.
3+
"""Debye-Hückel theory for activity coefficients.
54
65
The Debye-Hückel limiting law:
76
log10(γ±) = -A * |z+ * z-| * √I
@@ -67,6 +66,7 @@ def debye_huckel_limiting_law(z_plus, z_minus, I: IonicStrengthMolar, A=0.509):
6766
-------
6867
float
6968
log10 of the mean activity coefficient.
69+
7070
"""
7171
I = normalize_ionic_strength(I) if isinstance(I, str) else I
7272
return -A * np.abs(z_plus * z_minus) * np.sqrt(I)

UliEngineering/Chemistry/Kohlrausch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
"""
4-
Kohlrausch's law of independent migration of ions.
3+
"""Kohlrausch's law of independent migration of ions.
54
65
Kohlrausch's law states that the limiting molar conductivity of an electrolyte
76
is the sum of the individual contributions of the cation and anion:

UliEngineering/Chemistry/Pitzer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
"""
4-
Pitzer equations for activity coefficients.
3+
"""Pitzer equations for activity coefficients.
54
65
The Pitzer model is a semi-empirical extension of Debye-Hückel theory
76
for concentrated electrolyte solutions (up to ~6 mol/kg).

UliEngineering/Economics/Interest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
]
1111

1212
def yearly_interest_to_equivalent_monthly_interest(interest):
13-
"""
14-
Given a yearly interest such as 0.022 (= 2.2%), or a numpy ndarray of interests,
13+
"""Given a yearly interest such as 0.022 (= 2.2%), or a numpy ndarray of interests,
1514
computes the equivalent monthly interest so that the following holds True:
1615
1716
(1+monthly_interest)**12-1 == yearly_interest.
@@ -26,6 +25,7 @@ def yearly_interest_to_equivalent_monthly_interest(interest):
2625
float or numpy.ndarray
2726
Equivalent monthly interest rate.
2827
"""
28+
2929
# 12 months per year
3030
# monthly interest is 12th root of yearly interest
3131
# https://techoverflow.net/2022/02/02/numpy-nth-root-how-to/

UliEngineering/Electronics/Hysteresis.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
"""
4-
Utilities regarding comparator / opamp hysteresis
3+
"""Utilities regarding comparator / opamp hysteresis.
54
65
For a detailed description please see http://www.ti.com/lit/ug/tidu020a/tidu020a.pdf
76
"""

UliEngineering/Electronics/Reactance.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ def inductive_reactance(l: InductanceH, f: FrequencyHz = 1000.0):
6565
@returns_unit("H")
6666
def inductance_from_reactance(x: ResistanceOhm, f: FrequencyHz = 1000.0):
6767
"""
68-
Compute the inductance (H) from an inductive reactance (Ω) at a given
69-
frequency f (Hz).
68+
Compute the inductance (H) from an inductive reactance (Ω) at a given frequency f (Hz).
7069
7170
Formula: X_L = 2 * pi * f * L => L = X_L / (2 * pi * f).
7271

UliEngineering/Electronics/ZenerDiode.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
@returns_unit("W")
1313
def zener_diode_power_dissipation(zener_voltage: VoltageV, current: CurrentA):
14-
"""
15-
Compute the power dissipated in a zener diode
16-
given the zener voltage and the current through it.
14+
"""Compute the power dissipated in a zener diode given the zener voltage and the current through it.
1715
1816
This is based on an ideal zener diode model and does not take into account
1917
the zener resistance or the zener knee voltage.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python3
2+
"""Filesystem utilities."""

UliEngineering/Math/Geometry/Circle.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ def circle_area(radius: NormalizableArgument):
2121

2222
@returns_unit("m")
2323
def circle_circumference(radius: NormalizableArgument):
24-
"""
25-
Compute the circumference of a circle from its radius
26-
"""
24+
"""Compute the circumference of a circle from its radius."""
2725
radius = normalize_numeric(radius) if isinstance(radius, str) else radius
2826
return 2. * math.pi * radius

0 commit comments

Comments
 (0)