Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More descriptive docstring for Triangle constructor #490

Open
MatthewCaseres opened this issue Jan 21, 2024 · 0 comments
Open

More descriptive docstring for Triangle constructor #490

MatthewCaseres opened this issue Jan 21, 2024 · 0 comments

Comments

@MatthewCaseres
Copy link
Contributor

Problem

I have a hard time understanding the exact supported usage patterns for the Triangle constructor based on the source code + docstring.

Proposed solution

Make it clear in the source code what valid ways to construct a Triangle are. Pandas includes examples in their docstring: https://github.com/pandas-dev/pandas/blob/v2.1.4/pandas/core/frame.py#L541

Things that confuse me

what is optional or not? The default value is None for all fields, but the type indicated in the docstring is not optional for the data field.

    data: DataFrame
        A single dataframe that contains columns represeting all other
        arguments to the Triangle constructor

How do origin and development behave when passed in as lists?

    origin: str or list
         A representation of the accident, reporting or more generally the
         origin period of the triangle that will map to the Origin dimension
    development: str or list
        A representation of the development/valuation periods of the triangle
        that will map to the Development dimension

development is optional or not?: The docstring says str or list but there are tests that do not pass it in, is it optional?

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

No branches or pull requests

1 participant