Repository navigation
Replies: 2 comments
|
I'm probably going to add rule N806 soon since it's a PEP-8 convention. The big Python packages do have exceptions though (scikit-learn being the most obvious one with capital Another case where it makes sense to depart from PEP-8 is when doing matrix operations (which scipy does) as this would match mathematical notation found in textbooks. So I would propose that we follow PEP-8 when naming variables, with the following exceptions:
Tagging @casact/chainladder-maintainers to see if anyone has anything to say about the subject. One question I have is what about fitted estimator attributes that might not have a consistent naming convention between papers? Particularly something like credibility, |
Uh oh!
There was an error while loading. Please reload this page.
I ran into this issue when trying to do a Ruff fix on
core/correlation.py:The variable name needed to be changed because it was capitalized. Yet it can't just be "i" because it clashes with the indexing variable in the paper's various summations:
I've changed "I" to
n_dev_periods, and changed the comment to say that this is the same as the capital I from the paper. This made me wonder whether we should have some guidelines in our docs on how to port over variables and formulae.I'm thinking we should retain variable names when we can, but when we can't we should make sure to document in a comment which variable in the paper the new name refers to (A previous comment also refers to formula G4):
All reactions