PYield 0.25.3__tar.gz → 0.25.4__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.
- {pyield-0.25.3 → pyield-0.25.4}/PKG-INFO +1 -1
- pyield-0.25.4/pyield/__about__.py +1 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/ntnb.py +6 -6
- pyield-0.25.3/pyield/__about__.py +0 -1
- {pyield-0.25.3 → pyield-0.25.4}/.gitignore +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/LICENSE +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/README.md +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/__init__.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/anbima.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/b3_futures/__init__.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/b3_futures/common.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/b3_futures/historical.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/b3_futures/intraday.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/b3_futures/xml.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/bday.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/__init__.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/bond_tools.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/lft.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/ltn.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/ntnf.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/conftest.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/data_cache.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/date_converter.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/di.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/holidays/__init__.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/holidays/br_holidays_new.txt +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/holidays/br_holidays_old.txt +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/holidays/brholidays.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/indicators.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/interpolator.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/projections.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/py.typed +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyield/tools.py +0 -0
- {pyield-0.25.3 → pyield-0.25.4}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.25.4"
|
|
@@ -127,7 +127,7 @@ def maturities(reference_date: DateScalar) -> pd.Series:
|
|
|
127
127
|
return s_maturities
|
|
128
128
|
|
|
129
129
|
|
|
130
|
-
def
|
|
130
|
+
def _generate_all_coupon_dates(
|
|
131
131
|
start: DateScalar,
|
|
132
132
|
end: DateScalar,
|
|
133
133
|
) -> pd.Series:
|
|
@@ -398,7 +398,7 @@ def spot_rates(
|
|
|
398
398
|
maturities = pd.to_datetime(maturities, errors="raise", dayfirst=True)
|
|
399
399
|
_check_maturities(maturities)
|
|
400
400
|
|
|
401
|
-
# Create the interpolator
|
|
401
|
+
# Create the interpolator to calculate the YTM rates for intermediate dates
|
|
402
402
|
ff_interpolator = ip.Interpolator(
|
|
403
403
|
method="flat_forward",
|
|
404
404
|
known_bdays=bday.count(settlement, maturities),
|
|
@@ -406,7 +406,7 @@ def spot_rates(
|
|
|
406
406
|
)
|
|
407
407
|
|
|
408
408
|
# Generate coupon dates up to the longest maturity date
|
|
409
|
-
all_coupon_dates =
|
|
409
|
+
all_coupon_dates = _generate_all_coupon_dates(
|
|
410
410
|
start=settlement, end=maturities.max()
|
|
411
411
|
)
|
|
412
412
|
|
|
@@ -423,9 +423,9 @@ def spot_rates(
|
|
|
423
423
|
# Get the cash flow dates for the bond
|
|
424
424
|
cf_dates = payment_dates(settlement, row["MaturityDate"])
|
|
425
425
|
|
|
426
|
-
# If there is only one
|
|
427
|
-
#
|
|
428
|
-
if len(cf_dates) == 1
|
|
426
|
+
# If there is only one cash flow date, it means the bond is a single payment
|
|
427
|
+
# bond, so the spot rate is equal to the YTM rate
|
|
428
|
+
if len(cf_dates) == 1:
|
|
429
429
|
df.at[index, "SpotRate"] = row["YTM"]
|
|
430
430
|
continue
|
|
431
431
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.25.3"
|
|
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
|
|
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
|