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.
Files changed (34) hide show
  1. {pyield-0.25.3 → pyield-0.25.4}/PKG-INFO +1 -1
  2. pyield-0.25.4/pyield/__about__.py +1 -0
  3. {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/ntnb.py +6 -6
  4. pyield-0.25.3/pyield/__about__.py +0 -1
  5. {pyield-0.25.3 → pyield-0.25.4}/.gitignore +0 -0
  6. {pyield-0.25.3 → pyield-0.25.4}/LICENSE +0 -0
  7. {pyield-0.25.3 → pyield-0.25.4}/README.md +0 -0
  8. {pyield-0.25.3 → pyield-0.25.4}/pyield/__init__.py +0 -0
  9. {pyield-0.25.3 → pyield-0.25.4}/pyield/anbima.py +0 -0
  10. {pyield-0.25.3 → pyield-0.25.4}/pyield/b3_futures/__init__.py +0 -0
  11. {pyield-0.25.3 → pyield-0.25.4}/pyield/b3_futures/common.py +0 -0
  12. {pyield-0.25.3 → pyield-0.25.4}/pyield/b3_futures/historical.py +0 -0
  13. {pyield-0.25.3 → pyield-0.25.4}/pyield/b3_futures/intraday.py +0 -0
  14. {pyield-0.25.3 → pyield-0.25.4}/pyield/b3_futures/xml.py +0 -0
  15. {pyield-0.25.3 → pyield-0.25.4}/pyield/bday.py +0 -0
  16. {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/__init__.py +0 -0
  17. {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/bond_tools.py +0 -0
  18. {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/lft.py +0 -0
  19. {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/ltn.py +0 -0
  20. {pyield-0.25.3 → pyield-0.25.4}/pyield/bonds/ntnf.py +0 -0
  21. {pyield-0.25.3 → pyield-0.25.4}/pyield/conftest.py +0 -0
  22. {pyield-0.25.3 → pyield-0.25.4}/pyield/data_cache.py +0 -0
  23. {pyield-0.25.3 → pyield-0.25.4}/pyield/date_converter.py +0 -0
  24. {pyield-0.25.3 → pyield-0.25.4}/pyield/di.py +0 -0
  25. {pyield-0.25.3 → pyield-0.25.4}/pyield/holidays/__init__.py +0 -0
  26. {pyield-0.25.3 → pyield-0.25.4}/pyield/holidays/br_holidays_new.txt +0 -0
  27. {pyield-0.25.3 → pyield-0.25.4}/pyield/holidays/br_holidays_old.txt +0 -0
  28. {pyield-0.25.3 → pyield-0.25.4}/pyield/holidays/brholidays.py +0 -0
  29. {pyield-0.25.3 → pyield-0.25.4}/pyield/indicators.py +0 -0
  30. {pyield-0.25.3 → pyield-0.25.4}/pyield/interpolator.py +0 -0
  31. {pyield-0.25.3 → pyield-0.25.4}/pyield/projections.py +0 -0
  32. {pyield-0.25.3 → pyield-0.25.4}/pyield/py.typed +0 -0
  33. {pyield-0.25.3 → pyield-0.25.4}/pyield/tools.py +0 -0
  34. {pyield-0.25.3 → pyield-0.25.4}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: PYield
3
- Version: 0.25.3
3
+ Version: 0.25.4
4
4
  Summary: A Python library for analysis of fixed income instruments in Brazil
5
5
  Project-URL: Source, https://github.com/crdcj/PYield
6
6
  Author-email: Carlos Carvalho <cr.cj@outlook.com>
@@ -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 _generate_coupon_dates_map(
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 object
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 = _generate_coupon_dates_map(
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 coupon date and this date is the first maturity date
427
- # of an existing bond, the ytm rate is also a spot rate.
428
- if len(cf_dates) == 1 and cf_dates[0] == maturities[0]:
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