linerate 2.1.1__py3-none-any.whl → 2.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- linerate/solver.py +7 -4
- {linerate-2.1.1.dist-info → linerate-2.1.2.dist-info}/METADATA +2 -2
- {linerate-2.1.1.dist-info → linerate-2.1.2.dist-info}/RECORD +6 -6
- {linerate-2.1.1.dist-info → linerate-2.1.2.dist-info}/WHEEL +0 -0
- {linerate-2.1.1.dist-info → linerate-2.1.2.dist-info}/licenses/LICENSE +0 -0
- {linerate-2.1.1.dist-info → linerate-2.1.2.dist-info}/top_level.txt +0 -0
linerate/solver.py
CHANGED
|
@@ -33,8 +33,9 @@ def bisect(
|
|
|
33
33
|
run for :math:`\left\lceil\frac{x_\max - x_\min}{\Delta x}\right\rceil`
|
|
34
34
|
iterations.
|
|
35
35
|
invalid_value:
|
|
36
|
-
|
|
37
|
-
:math:`\text{sign}(f(\mathbf{x}_\min)) = \text{sign}(f(\mathbf{x}_\max))`.
|
|
36
|
+
This value is used whenever
|
|
37
|
+
:math:`\text{sign}(f(\mathbf{x}_\min)) = \text{sign}(f(\mathbf{x}_\max))`. If not provided
|
|
38
|
+
np.nan is used.
|
|
38
39
|
|
|
39
40
|
Returns
|
|
40
41
|
-------
|
|
@@ -43,6 +44,8 @@ def bisect(
|
|
|
43
44
|
there is a root :math:`x_i \in [\tilde{x}_i - 0.5 \Delta x, \tilde{x}_i + 0.5 \Delta x]`
|
|
44
45
|
so :math:`f_i(x_i) = 0`.
|
|
45
46
|
"""
|
|
47
|
+
_invalid_value = np.nan if invalid_value is None else invalid_value
|
|
48
|
+
|
|
46
49
|
if not np.all(np.isfinite(xmin)) or not np.all(np.isfinite(xmax)):
|
|
47
50
|
raise ValueError("xmin and xmax must be finite.")
|
|
48
51
|
interval = np.max(np.abs(xmax - xmin))
|
|
@@ -56,7 +59,7 @@ def bisect(
|
|
|
56
59
|
"f(xmin) and f(xmax) have the same sign. Consider increasing the search interval."
|
|
57
60
|
)
|
|
58
61
|
elif isinstance(invalid_mask, bool) and invalid_mask:
|
|
59
|
-
return
|
|
62
|
+
return _invalid_value
|
|
60
63
|
|
|
61
64
|
while interval > tolerance:
|
|
62
65
|
xmid = 0.5 * (xmax + xmin)
|
|
@@ -69,7 +72,7 @@ def bisect(
|
|
|
69
72
|
f_left = np.where(mask, f_mid, f_left)
|
|
70
73
|
f_right = np.where(mask, f_right, f_mid)
|
|
71
74
|
|
|
72
|
-
out = np.where(invalid_mask,
|
|
75
|
+
out = np.where(invalid_mask, _invalid_value, 0.5 * (xmax + xmin))
|
|
73
76
|
return out
|
|
74
77
|
|
|
75
78
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: linerate
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.2
|
|
4
4
|
Summary: Library for computing line ampacity ratings for overhead lines
|
|
5
5
|
Author-email: Statnett Datascience <Datascience.Drift@Statnett.no>, Yngve Mardal Moe <yngve.m.moe@gmail.com>
|
|
6
6
|
Requires-Python: >=3.9
|
|
@@ -15,7 +15,7 @@ Dynamic: license-file
|
|
|
15
15
|
# Overview
|
|
16
16
|
|
|
17
17
|
A package containing functionality to compute ampacity line ratings for overhead lines.
|
|
18
|
-
|
|
18
|
+
The package contains equations from CIGRE TB 601, CIGRE TB 207 and IEEE738.
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
linerate/__init__.py,sha256=456XlD7NFaT6nTM5k8qYpaf2Bg2ITYhh5wzL0CQRiDc,221
|
|
2
2
|
linerate/model.py,sha256=SUj4NunXdCctezpGeS62OQNmFGf5IKO2plYQlsGJLow,651
|
|
3
3
|
linerate/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
linerate/solver.py,sha256=
|
|
4
|
+
linerate/solver.py,sha256=Y_Cv8GjzIfOA-RUTExebUknz66jBghcvYH5S9-9iNjk,6489
|
|
5
5
|
linerate/types.py,sha256=HEon3gQU0dX0ZtTxhs4kOhL3jTamXoC3oBtX5b2-Piw,7595
|
|
6
6
|
linerate/units.py,sha256=nNU9SQ-eeUCtmbttKZ9IlNzomF8wwUPPwmixXjfvKhI,1476
|
|
7
7
|
linerate/equations/__init__.py,sha256=cNvISWCp5TbXv4gZ8SWPf0pICRpwDzLSaOxYy5lftsU,464
|
|
@@ -30,8 +30,8 @@ linerate/models/cigre207.py,sha256=FqeSkVzcsf8YIPuyxN0o3svrEp73vIAb42ylnQU_pBQ,5
|
|
|
30
30
|
linerate/models/cigre601.py,sha256=HuwAEsRtWdN5oG0AZqCISnww8ILFGdvk8IfrzLQ_nf0,7508
|
|
31
31
|
linerate/models/ieee738.py,sha256=0o1rEjHhHUgCaK0PyBHBXvFCDs-c9HIF91uUP-VaLAg,4291
|
|
32
32
|
linerate/models/thermal_model.py,sha256=SUeUrjxJaV4muoAiYNR-Ne-1vQspWCPsoJys6bP6pP8,10997
|
|
33
|
-
linerate-2.1.
|
|
34
|
-
linerate-2.1.
|
|
35
|
-
linerate-2.1.
|
|
36
|
-
linerate-2.1.
|
|
37
|
-
linerate-2.1.
|
|
33
|
+
linerate-2.1.2.dist-info/licenses/LICENSE,sha256=HDUtv1ujna13BmYSP7JtGGsG5kGPAaZY2C2qJrANAOo,1059
|
|
34
|
+
linerate-2.1.2.dist-info/METADATA,sha256=PMG7vO5TdrYtrn-MVh1mZmthc5vlKbQKfl6GAw6CcIg,4285
|
|
35
|
+
linerate-2.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
36
|
+
linerate-2.1.2.dist-info/top_level.txt,sha256=xHXGAzhQ04AqJCM-MG30tP_me8vBQ9PMlRWsbMLJdgE,9
|
|
37
|
+
linerate-2.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|