Skip to content

Rename PTF_formula to ptf_formula with a deprecation alias - #1316

Open
Abhayindia wants to merge 2 commits into
casact:mainfrom
Abhayindia:feature/deprecate-ptf-formula-1291
Open

Abhayindia wants to merge 2 commits into
casact:mainfrom
Abhayindia:feature/deprecate-ptf-formula-1291

Conversation

@Abhayindia

@Abhayindia Abhayindia commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

Renames PTF_formula to ptf_formula. The old name stays as a thin wrapper that emits a DeprecationWarning and forwards to the new one, so nothing breaks for 0.11.0. The internal caller in barnzehn.py is switched to the new name.

Related GitHub Issue(s)

Closes #1291

Additional Context for Reviewers

Added test_ptf_formula_deprecated_alias — checks the alias warns and returns the same formula string. ruff check --config lint.per-file-ignores={} and ruff format --check pass on the three changed files; pytest chainladder/development/tests/test_barnzehn.py passes. Couldn't run the doctest builder locally (no jb), but no docs reference PTF_formula.

Checklist

  • I passed tests locally for code changes (documentation unaffected)

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Pyright Type Completeness

View the full pyright --verifytypes output for this commit

Project (full chainladder package, at this PR's head): 15.0% of exported symbols fully typed (208 / 1384)

Known Ambiguous Unknown Total
Project (head) 208 111 1065 1384

Other symbols referenced but not exported by chainladder: 13

Known Ambiguous Unknown Total
Other (head) 3 1 9 13

Symbols without documentation:

  • Functions without docstring: 327
  • Functions without default param: 0
  • Classes without docstring: 10

Patch (exported symbols added or changed by this PR): 50.0% fully typed (1 / 2)

Known Ambiguous Unknown Total
Patch 1 0 1 2
Patch symbol details
Symbol Status Change
chainladder.utils.tests.test_utilities.test_ptf_formula_deprecated_alias ✅ known new
chainladder.utils.utility_functions.ptf_formula ❌ unknown new

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.73%. Comparing base (d82c521) to head (c19902a).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1316      +/-   ##
==========================================
+ Coverage   91.79%   92.73%   +0.94%     
==========================================
  Files          96       98       +2     
  Lines        5494     6206     +712     
  Branches      707      839     +132     
==========================================
+ Hits         5043     5755     +712     
- Misses        327      329       +2     
+ Partials      124      122       -2     
Flag Coverage Δ
unittests 92.70% <100.00%> (+0.90%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@genedan

genedan commented Sep 9, 2026

Copy link
Copy Markdown
Member

Note to reviewers: I'd like for #1318 to be resolved before we review/close this.

@genedan genedan mentioned this pull request Sep 9, 2026
1 task
@genedan genedan self-assigned this Sep 13, 2026
@Abhayindia
Abhayindia force-pushed the feature/deprecate-ptf-formula-1291 branch 2 times, most recently from 7ca7723 to 534c378 Compare September 14, 2026 21:55
@genedan

genedan commented Sep 15, 2026

Copy link
Copy Markdown
Member

FYI the PR with the new deprecation tools is this one #1323. It's still under review but it should give you a general idea on the new tools that will be available to you to complete this PR.

@Abhayindia

Copy link
Copy Markdown
Contributor Author

thanks, that's helpful - _deprecated_rename in #1323 is exactly what this PR is hand-rolling right now (a PTF_formula wrapper that calls warnings.warn then delegates to ptf_formula), so it should collapse to a decorator once that lands.
happy to swap it over, but i'll hold until #1323 is merged rather than build against an API that's still in review - ping me when it's in and i'll rebase this onto it.

@Abhayindia
Abhayindia force-pushed the feature/deprecate-ptf-formula-1291 branch from 534c378 to c19902a Compare September 17, 2026 16:00
@henrydingliu

henrydingliu commented Sep 18, 2026

Copy link
Copy Markdown
Member

@Abhayindia github overreacting...

@genedan i don't think you meant to close it. please confirm

@henrydingliu henrydingliu reopened this Sep 18, 2026
@genedan

genedan commented Sep 18, 2026

Copy link
Copy Markdown
Member

Must have been an accident.

@Abhayindia, the new deprecation tools are ready. FYI, we changed which function will be the wrapper. The old_func should be the wrapper around new_func.

@genedan

genedan commented Sep 18, 2026

Copy link
Copy Markdown
Member

It's because I said "needed to close #XXXX" in another PR. Guess I gotta change my language..."blocker for #XXXX"?

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.

[BRK] rename function PTF_formula() to ptf_formula()

3 participants