feat(itofin-py): expose Currency and weekends-only calendar - #869
Merged
Conversation
This change adds Python bindings for currency and calendar functionality needed by the ISDA CDS conventions. **Currency bindings:** * Added a new `currency.rs` module exposing `PyCurrency`, an ISO 4217 currency specification. Only the EUR, USD and GBP currencies the core provides are exposed via static constructors, with `code()` and `__repr__()` accessors. * Registered `PyCurrency` in the `indexes` module and documented the new `Currency` class in `indexes.pyi`. **Weekends-only calendar:** * Added a `weekends_only()` static constructor to `PyCalendar`, exposing the calendar the ISDA CDS conventions roll on, where only Saturdays and Sundays are holidays. * Documented the new calendar in `time.pyi`.
This change introduces a general `IborIndex` facade that spells out every convention the core constructor takes, so an index outside the named families (such as the USD-3M `IsdaIbor` the ISDA CDS curve bootstraps off) is expressible without a dedicated facade. **New general index facade:** * Added `PyIborIndex` with a full constructor (family name, tenor, settlement days, currency, calendar, convention, end-of-month, day counter, optional forwarding curve, settings) and a `fixing` method. * Made `PyEuribor` a subclass of `PyIborIndex`, with a shared `init_euribor` initializer feeding one core index into both halves so the base and subclass read the same object. * Registered `IborIndex` in the `indexes` module. **Rate helper widening:** * `DepositRateHelper` and `SwapRateHelper` now take `IborIndex`, so they accept either the general index or a `Euribor`. * Removed the now-unneeded `dead_code` allowance on `PyCurrency::inner`.
Add a new test module `test_ibor_index.py` covering the IBOR index functionality in the Python bindings. close #815
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #815