moexapi 1.7.20__tar.gz → 1.7.21__tar.gz
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.
- {moexapi-1.7.20 → moexapi-1.7.21}/PKG-INFO +1 -1
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/bonds.py +16 -6
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi.egg-info/PKG-INFO +1 -1
- {moexapi-1.7.20 → moexapi-1.7.21}/pyproject.toml +1 -1
- {moexapi-1.7.20 → moexapi-1.7.21}/LICENSE +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/README.md +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/__init__.py +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/candles.py +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/changeover.py +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/dividends.py +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/exchange.py +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/history.py +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/markets.py +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/splits.py +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/tickers.py +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi/utils.py +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi.egg-info/SOURCES.txt +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi.egg-info/dependency_links.txt +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi.egg-info/requires.txt +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/moexapi.egg-info/top_level.txt +0 -0
- {moexapi-1.7.20 → moexapi-1.7.21}/setup.cfg +0 -0
|
@@ -139,12 +139,22 @@ class Bond:
|
|
|
139
139
|
if abs(amortization_sum - self.initial_face_value) > 1e-9 and len(original_values) > 1:
|
|
140
140
|
values = [value / amortization_sum * self.initial_face_value for value in original_values]
|
|
141
141
|
rounded_values = [round(value + 1e-9, 2) for value in values]
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
if all(abs(original - rounded) <= 1e-9
|
|
143
|
+
for original, rounded in zip(original_values, rounded_values)):
|
|
144
|
+
# Correct only differences attributable to payment rounding.
|
|
145
|
+
for amortization_item, value in zip(self.amortization, values):
|
|
146
|
+
amortization_item.value = value
|
|
147
|
+
elif amortization_sum > self.initial_face_value:
|
|
148
|
+
raise ValueError(
|
|
149
|
+
f"Amortization sum {amortization_sum} is greater than initial face value {self.initial_face_value}"
|
|
150
|
+
)
|
|
151
|
+
else:
|
|
152
|
+
# Incomplete or discounted repayment schedules must retain
|
|
153
|
+
# their published cash flows rather than inventing principal.
|
|
154
|
+
logger.warning(
|
|
155
|
+
"%s: Amortization sum %s is less than initial face value %s; keeping published payments",
|
|
156
|
+
self.secid, amortization_sum, self.initial_face_value,
|
|
157
|
+
)
|
|
148
158
|
except Exception as e:
|
|
149
159
|
logger.error(f"{ticker.secid} ({ticker.shortname}): {e}")
|
|
150
160
|
raise e
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|