Skip to content

Commit 182be6c

Browse files
author
Uli Köhler
committed
Fix documentation linting errors (D415, D212, D200, D205, D203/D204/D211, D406/D407, D413, D105/D107, D300, D417)
1 parent 90d2b3a commit 182be6c

43 files changed

Lines changed: 256 additions & 215 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/Absorption.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ class HaleQuerryAbsorptionModel:
339339
]
340340

341341
def __init__(self):
342+
"""Initialize the HaleQuerryAbsorptionModel."""
342343
# Extract wavelength and extinction coefficient arrays
343344
self._wavelengths = np.array([d.wavelength for d in self.datapoints])
344345
self._ext_coeffs = np.array([d.absorption_coefficient for d in self.datapoints])

UliEngineering/Electronics/Filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33
"""
4-
Electronic filter and time constant utilities
4+
Electronic filter and time constant utilities.
55
"""
66
from typing import Annotated
77

UliEngineering/Electronics/Resistors.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
"""
4-
A python script to calculate E96 resistor values and do other useful things with resistors,
3+
"""A python script to calculate E96 resistor values and do other useful things with resistors,
54
e.g. connect them in parallel and serial fashions.
65
7-
Originally published at techoverflow.net.
8-
"""
6+
Originally published at techoverflow.net."""
97
import itertools
108
import numpy as np
119
from UliEngineering.EngineerIO import normalize_numeric

UliEngineering/Electronics/Thermistor.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,21 @@ def thermistor_temperature(resistance: ResistanceOhm, beta: NormalizableArgument
4646
"""
4747
Calculate the temperature of a NTC thermistor using the Beta parameter model.
4848
49-
Parameters:
50-
- resistance: The measured resistance of the thermistor in Ohms, for which to calculate the temperature.
51-
- beta: The Beta constant of the thermistor.
52-
- R0: The resistance of the thermistor at reference temperature T0 (default is 10kOhms).
53-
- T0: The reference temperature in Celsius (default is 25°C).
49+
Parameters
50+
----------
51+
resistance : ResistanceOhm
52+
The measured resistance of the thermistor in Ohms, for which to calculate the temperature.
53+
beta : NormalizableArgument
54+
The Beta constant of the thermistor.
55+
R0 : ResistanceOhm
56+
The resistance of the thermistor at reference temperature T0 (default is 10kOhms).
57+
T0 : NormalizableArgument
58+
The reference temperature in Celsius (default is 25°C).
5459
55-
Returns:
56-
- Temperature in degrees.
60+
Returns
61+
-------
62+
float
63+
Temperature in degrees.
5764
"""
5865
R0 = normalize_resistance(R0) if isinstance(R0, str) else R0
5966
T0 = normalize_temperature_kelvin(T0)

UliEngineering/EngineerIO/Area.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
"""
4-
Utilities for area
5-
"""
3+
"""Utilities for area"""
64
from typing import Annotated
75

86
from numpy import ndarray
@@ -83,6 +81,7 @@ class EngineerAreaIO(EngineerIO):
8381
_instance = None
8482

8583
def __init__(self):
84+
"""Initialize the EngineerAreaIO."""
8685
# Use area-specific configuration
8786
super().__init__(config=_create_area_config())
8887

UliEngineering/EngineerIO/Concentration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class EngineerAmountConcentrationIO(EngineerIO):
102102
_instance = None
103103

104104
def __init__(self):
105+
"""Initialize the EngineerAmountConcentrationIO."""
105106
super().__init__(config=_create_amount_concentration_config())
106107

107108
@classmethod
@@ -130,7 +131,8 @@ class EngineerMassConcentrationIO(EngineerIO):
130131
"""
131132
_instance = None
132133

133-
def __init__(self):
134+
def """Initialize the EngineerMassConcentrationIO."""
135+
__init__(self):
134136
super().__init__(config=_create_mass_concentration_config())
135137

136138
@classmethod

UliEngineering/EngineerIO/Decorators.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def _normalize_volume_arg(value):
4141

4242

4343
def returns_unit(unit):
44-
"""
45-
Decorator to annotate a function with a custom return unit string.
44+
"""Decorator to annotate a function with a custom return unit string.
4645
4746
Usage: @returns_unit("A").
4847
"""
@@ -123,8 +122,7 @@ def normalize_args(func: None = None, *, exclude=None, instance:Optional[Enginee
123122

124123

125124
def normalize_args(func=None, *, exclude=None, instance:Optional[EngineerIO] = None):
126-
"""
127-
Decorator that normalizes arguments before calling the wrapped function.
125+
"""Decorator that normalizes arguments before calling the wrapped function.
128126
129127
Parameters can declare how they should be normalized using type annotations.
130128
The most pythonic form is ``typing.Annotated`` metadata:
@@ -139,8 +137,8 @@ def normalize_args(func=None, *, exclude=None, instance:Optional[EngineerIO] = N
139137
Parameters without metadata still use ``normalize_numeric()`` for backwards
140138
compatibility with existing functions.
141139
142-
Parameters:
143-
-----------
140+
Parameters
141+
----------
144142
exclude : list of str, optional
145143
List of parameter names that should not be normalized
146144
@@ -233,8 +231,7 @@ def normalize_numeric_args(func: None = None, *, exclude=None, instance:Optional
233231

234232

235233
def normalize_numeric_args(func=None, *, exclude=None, instance:Optional[EngineerIO] = None):
236-
"""
237-
Decorator that applies normalize_numeric to all arguments (args & kwargs)
234+
"""Decorator that applies normalize_numeric to all arguments (args & kwargs)
238235
of the decorated function before calling it.
239236
"""
240237
if exclude is None:

UliEngineering/EngineerIO/Defaults.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
"""
4-
Default values and configurations for the EngineerIO library.
5-
"""
3+
"""Default values and configurations for the EngineerIO library."""
64
from toolz import functoolz
75
from typing import Callable, Dict, List, Tuple, Union
86
from UliEngineering.EngineerIO.UnitInfo import UnitAlias, UnitInfo

UliEngineering/EngineerIO/Length.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
"""
4-
Utilities for length
5-
"""
3+
"""Utilities for length."""
64
from typing import Annotated
75

86
import scipy.constants
@@ -18,7 +16,7 @@
1816

1917
def _length_unit_infos():
2018
"""
21-
Returns a list of UnitInfo objects for length units
19+
Returns a list of UnitInfo objects for length units.
2220
"""
2321
return [
2422
# Base meter unit
@@ -44,7 +42,7 @@ def _length_unit_infos():
4442

4543
def _default_unit_prefix_map_length():
4644
"""
47-
Returns the default unit prefix map for length calculations (includes c and d prefixes)
45+
Returns the default unit prefix map for length calculations (includes c and d prefixes).
4846
"""
4947
return {
5048
'y': -24, 'z': -21, 'a': -18, 'f': -15, 'p': -12,
@@ -56,7 +54,7 @@ def _default_unit_prefix_map_length():
5654

5755
def _create_length_config():
5856
"""
59-
Create a custom EngineerIOConfiguration for length units with extended SI prefixes
57+
Create a custom EngineerIOConfiguration for length units with extended SI prefixes.
6058
"""
6159
config = EngineerIOConfiguration.default()
6260
return EngineerIOConfiguration(
@@ -73,13 +71,14 @@ class EngineerLengthIO(EngineerIO):
7371
_instance = None
7472

7573
def __init__(self):
74+
"""Initialize the EngineerLengthIO."""
7675
# Use length-specific configuration
7776
super().__init__(config=_create_length_config())
7877

7978
@classmethod
8079
def instance(cls):
8180
"""
82-
Get the singleton instance of EngineerLengthIO
81+
Get the singleton instance of EngineerLengthIO.
8382
"""
8483
if cls._instance is None:
8584
cls._instance = cls()

UliEngineering/EngineerIO/Timespan.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
"""
4-
Timespan normalization and conversion utilities for UliEngineering
5-
"""
3+
"""Timespan normalization and conversion utilities for UliEngineering"""
64
from typing import Annotated, cast
75

86
from UliEngineering.EngineerIO.Decorators import returns_unit
@@ -64,6 +62,7 @@ class EngineerTimespanIO(EngineerIO):
6462
_instance = None
6563

6664
def __init__(self):
65+
"""Initialize the EngineerTimespanIO."""
6766
# Use timespan-specific configuration
6867
super().__init__(config=_create_timespan_config())
6968

0 commit comments

Comments
 (0)