Skip to content

Conversation

@eltoder
Copy link
Contributor

@eltoder eltoder commented Jul 9, 2025

Instead of duplicating its code. This is effectively a public API because users are encouraged to override zeroYieldImpl with an efficient implementation.

Also, delete dead forwardImpl in ZeroSpreadedTermStructure. This method is never called because the class is not a ForwardRateStructure.

Instead of duplicating its code. This is effectively a public API
because users are encouraged to override `zeroYieldImpl` with an
efficient implementation.

Also, delete dead `forwardImpl` in ZeroSpreadedTermStructure. This
method is never called because the class is not a ForwardRateStructure.
@coveralls
Copy link

Coverage Status

coverage: 73.815% (-0.001%) from 73.816%
when pulling 9579bed on eltoder:feature/fwd-zero-termstructure
into f5b93e4 on lballabio:master.

@eltoder
Copy link
Contributor Author

eltoder commented Jul 10, 2025

@lballabio Thinking more about it, I think we should just deprecate ForwardRateStructure. It contains a very bad implementation of numerical integration, which it warns people not to use. All implementations of ForwardRateStructure in QuantLib already implement zeroYieldImpl. But if you implement zeroYieldImpl, your forwardImpl is no longer used. In this case it's better to inherit from ZeroYieldStructure and skip forwardImpl altogether. What do you think?

@lballabio
Copy link
Owner

Let me sit with this for a bit. I see your point though.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2025

This PR was automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment, or this will be closed in two weeks.

@github-actions github-actions bot added the stale label Oct 4, 2025
@eltoder
Copy link
Contributor Author

eltoder commented Oct 4, 2025

@lballabio Did you have a chance to think about this?

@github-actions github-actions bot removed the stale label Oct 5, 2025
@lballabio
Copy link
Owner

Ok, let's go ahead (in 1.41 — I've already cut 1.40). I'm not sure about deprecating ForwardRateStructure, but yes, we can skip the middleman and inherit classes such as InterpolatedForwardCurve directly from ZeroYieldStructure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants