Skip to content

fix(docs): correct pv_to_annuity formula in docstring - #385

Open
Jah-yee wants to merge 1 commit into
TemoaProject:mainfrom
Jah-yee:main
Open

Jah-yee wants to merge 1 commit into
TemoaProject:mainfrom
Jah-yee:main

Conversation

@Jah-yee

@Jah-yee Jah-yee commented Oct 16, 2026 •

Copy link
Copy Markdown

Description

The annuity conversion formula in the pv_to_annuity docstring had an incorrect numerator:

Before (wrong):
\frac{A}{P}(i, N) = \frac{i + (1 + i)^N}{(1 + i)^N - 1}

After (correct):
\frac{A}{P}(i, N) = \frac{i(1 + i)^N}{(1 + i)^N - 1}

The actual implementation was already correct; only the documentation math formula was wrong.

Fixes #384

Summary by CodeRabbit

  • Documentation
    • Corrected the documented annuity formula to match the existing implementation.

The annuity conversion formula in the pv_to_annuity docstring had
an incorrect numerator: i + (1+i)^N instead of i(1+i)^N.

The actual implementation was already correct; only the documentation
math formula was wrong.

Fixes TemoaProject#384
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: TemoaProject/temoa/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0d586ff4-924f-44ac-a7bd-8b2507929a38
📥 Commits

Reviewing files that changed from the base of the PR and between a2b0bf2 and fa20860.

📒 Files selected for processing: 1
  • temoa/components/costs.py

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The pv_to_annuity documentation now shows the numerator as (i(1+i)^N), matching the existing implementation. No executable behavior changed.

Changes

Annuity formula documentation

Layer / File(s) Summary
Correct documented formula
temoa/components/costs.py
The documented numerator changes from (i + (1+i)^N) to (i(1+i)^N). The implementation is unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other · Severity of issue fixed: Low

Suggested reviewers: idelder

Merge Risk: ⚪ Minimal · up to fa208

The documented annuity formula is corrected without changing calculations, so no concrete merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the documentation-only correction to the pv_to_annuity formula in the docstring.
Linked Issues check Passed Issue #384 requires a documentation-only correction in pv_to_annuity. The pull request changes the numerator from i + (1+i)^N to i(1+i)^N in temoa/components/costs.py. The summary also confirm…
Out of Scope Changes check Passed The change is limited to the documented formula in temoa/components/costs.py. The summary reports one documentation line changed and no executable behavior changes. This change supports issue #384 a…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Full details: Linked Issues check

Explanation

Issue #384 requires a documentation-only correction in pv_to_annuity. The pull request changes the numerator from i + (1+i)^N to i(1+i)^N in temoa/components/costs.py. The summary also confirms that the existing implementation already uses the correct expression.

Full details: Out of Scope Changes check

Explanation

The change is limited to the documented formula in temoa/components/costs.py. The summary reports one documentation line changed and no executable behavior changes. This change supports issue #384 and introduces no demonstrated unrelated work.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@idelder idelder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

This branch has not been deployed

No deployments
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.

Fix typo in pv_to_annuity documentation formula

2 participants