moexapi 1.6.44__tar.gz → 1.6.46__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.6.44 → moexapi-1.6.46}/PKG-INFO +1 -1
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/bonds.py +3 -3
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi.egg-info/PKG-INFO +1 -1
- {moexapi-1.6.44 → moexapi-1.6.46}/pyproject.toml +1 -1
- {moexapi-1.6.44 → moexapi-1.6.46}/LICENSE +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/README.md +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/__init__.py +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/candles.py +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/changeover.py +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/dividends.py +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/exchange.py +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/history.py +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/markets.py +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/splits.py +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/tickers.py +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi/utils.py +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi.egg-info/SOURCES.txt +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi.egg-info/dependency_links.txt +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi.egg-info/requires.txt +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/moexapi.egg-info/top_level.txt +0 -0
- {moexapi-1.6.44 → moexapi-1.6.46}/setup.cfg +0 -0
|
@@ -103,7 +103,7 @@ class Bond:
|
|
|
103
103
|
Amortization(date=date, value=line["value"], initialfacevalue=line["initialfacevalue"])
|
|
104
104
|
)
|
|
105
105
|
for line in coupons:
|
|
106
|
-
date = datetime.date.fromisoformat(line["
|
|
106
|
+
date = datetime.date.fromisoformat(line["recorddate"])
|
|
107
107
|
end_date = _max(end_date, date)
|
|
108
108
|
self.coupons.append(
|
|
109
109
|
Coupon(
|
|
@@ -125,7 +125,7 @@ class Bond:
|
|
|
125
125
|
self.offers = [item for item in self.offers if item.date != start_date]
|
|
126
126
|
original_values = [item.value for item in self.amortization]
|
|
127
127
|
amortization_sum = sum(original_values)
|
|
128
|
-
if abs(amortization_sum - self.initial_face_value) > 1e-9:
|
|
128
|
+
if abs(amortization_sum - self.initial_face_value) > 1e-9 and len(original_values) > 1:
|
|
129
129
|
values = [value / amortization_sum * self.initial_face_value for value in original_values]
|
|
130
130
|
rounded_values = [round(value + 1e-9, 2) for value in values]
|
|
131
131
|
for original_value, rounded_value in zip(original_values, rounded_values):
|
|
@@ -178,7 +178,7 @@ class Bond:
|
|
|
178
178
|
date_from = date_from or datetime.date.today()
|
|
179
179
|
result = [offer for offer in self.offers if offer.date >= date_from]
|
|
180
180
|
return result[0] if len(result) > 0 else None
|
|
181
|
-
|
|
181
|
+
|
|
182
182
|
def has_next_offer(self, date_from: T.Optional[datetime.date] = None) -> bool:
|
|
183
183
|
return self.next_offer(date_from=date_from) is not None
|
|
184
184
|
|
|
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
|