PYield 0.12.2__tar.gz → 0.12.3__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 (37) hide show
  1. {pyield-0.12.2 → pyield-0.12.3}/PKG-INFO +1 -1
  2. pyield-0.12.3/pyield/__about__.py +1 -0
  3. {pyield-0.12.2 → pyield-0.12.3}/pyield/bonds/ntnf.py +5 -3
  4. {pyield-0.12.2 → pyield-0.12.3}/pyproject.toml +1 -1
  5. pyield-0.12.2/pyield/__about__.py +0 -1
  6. {pyield-0.12.2 → pyield-0.12.3}/LICENSE +0 -0
  7. {pyield-0.12.2 → pyield-0.12.3}/README.md +0 -0
  8. {pyield-0.12.2 → pyield-0.12.3}/pyield/__init__.py +0 -0
  9. {pyield-0.12.2 → pyield-0.12.3}/pyield/bday.py +0 -0
  10. {pyield-0.12.2 → pyield-0.12.3}/pyield/bonds/__init__.py +0 -0
  11. {pyield-0.12.2 → pyield-0.12.3}/pyield/bonds/lft.py +0 -0
  12. {pyield-0.12.2 → pyield-0.12.3}/pyield/bonds/ltn.py +0 -0
  13. {pyield-0.12.2 → pyield-0.12.3}/pyield/bonds/ntnb.py +0 -0
  14. {pyield-0.12.2 → pyield-0.12.3}/pyield/bonds/utils.py +0 -0
  15. {pyield-0.12.2 → pyield-0.12.3}/pyield/date_converter.py +0 -0
  16. {pyield-0.12.2 → pyield-0.12.3}/pyield/di.py +0 -0
  17. {pyield-0.12.2 → pyield-0.12.3}/pyield/fetchers/__init__.py +0 -0
  18. {pyield-0.12.2 → pyield-0.12.3}/pyield/fetchers/anbima.py +0 -0
  19. {pyield-0.12.2 → pyield-0.12.3}/pyield/fetchers/futures_data/__init__.py +0 -0
  20. {pyield-0.12.2 → pyield-0.12.3}/pyield/fetchers/futures_data/common.py +0 -0
  21. {pyield-0.12.2 → pyield-0.12.3}/pyield/fetchers/futures_data/historical.py +0 -0
  22. {pyield-0.12.2 → pyield-0.12.3}/pyield/fetchers/futures_data/intraday.py +0 -0
  23. {pyield-0.12.2 → pyield-0.12.3}/pyield/fetchers/futures_data/xml.py +0 -0
  24. {pyield-0.12.2 → pyield-0.12.3}/pyield/fetchers/indicators.py +0 -0
  25. {pyield-0.12.2 → pyield-0.12.3}/pyield/fetchers/projections.py +0 -0
  26. {pyield-0.12.2 → pyield-0.12.3}/pyield/holidays/__init__.py +0 -0
  27. {pyield-0.12.2 → pyield-0.12.3}/pyield/holidays/br_holidays_new.txt +0 -0
  28. {pyield-0.12.2 → pyield-0.12.3}/pyield/holidays/br_holidays_old.txt +0 -0
  29. {pyield-0.12.2 → pyield-0.12.3}/pyield/holidays/holidays_manager.py +0 -0
  30. {pyield-0.12.2 → pyield-0.12.3}/pyield/interpolator.py +0 -0
  31. {pyield-0.12.2 → pyield-0.12.3}/pyield/py.typed +0 -0
  32. {pyield-0.12.2 → pyield-0.12.3}/tests/__init__.py +0 -0
  33. {pyield-0.12.2 → pyield-0.12.3}/tests/data/SPRD231222.zip +0 -0
  34. {pyield-0.12.2 → pyield-0.12.3}/tests/data/SPRD240426.zip +0 -0
  35. {pyield-0.12.2 → pyield-0.12.3}/tests/test_bday.py +0 -0
  36. {pyield-0.12.2 → pyield-0.12.3}/tests/test_futures.py +0 -0
  37. {pyield-0.12.2 → pyield-0.12.3}/tests/test_futures_xml.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PYield
3
- Version: 0.12.2
3
+ Version: 0.12.3
4
4
  Summary: A Python library for analysis of fixed income instruments in Brazil
5
5
  Keywords: fixed-income, brazil, finance, analysis, bonds
6
6
  Author-Email: Carlos Carvalho <cr.cj@outlook.com>
@@ -0,0 +1 @@
1
+ __version__ = "0.12.3"
@@ -297,7 +297,7 @@ def spot_rates(
297
297
  return df_spot
298
298
 
299
299
 
300
- def gross_di_spreads(reference_date: str | pd.Timestamp) -> pd.Series:
300
+ def di_gross_spreads(reference_date: str | pd.Timestamp) -> pd.Series:
301
301
  """
302
302
  Calculates the DI spread for the NTN-F based on ANBIMA's indicative rates.
303
303
 
@@ -321,7 +321,7 @@ def gross_di_spreads(reference_date: str | pd.Timestamp) -> pd.Series:
321
321
  return df["DISpread"]
322
322
 
323
323
 
324
- def net_di_spread( # noqa
324
+ def di_net_spread( # noqa
325
325
  settlement_date: str | pd.Timestamp,
326
326
  maturity_date: str | pd.Timestamp,
327
327
  ytm: float,
@@ -367,9 +367,11 @@ def net_di_spread( # noqa
367
367
  di_rates,
368
368
  )
369
369
 
370
- # Ensure the DI rates and expirations lists are of equal length
370
+ # Ensure the DI data is valid
371
371
  if len(di_rates) != len(di_expirations):
372
372
  raise ValueError("di_rates and di_expirations must have the same length.")
373
+ if len(di_rates) == 0:
374
+ return float("nan")
373
375
 
374
376
  # Calculate cash flows and business days between settlement and payment dates
375
377
  df = cash_flows(settlement_date, maturity_date).reset_index()
@@ -34,7 +34,7 @@ dependencies = [
34
34
  "pyarrow",
35
35
  ]
36
36
  dynamic = []
37
- version = "0.12.2"
37
+ version = "0.12.3"
38
38
 
39
39
  [project.license]
40
40
  file = "LICENSE"
@@ -1 +0,0 @@
1
- __version__ = "0.12.2"
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