Skip to content

[REFACTOR] Make API exports explicit #876

@genedan

Description

@genedan

The API imports are currently implicit, wildcard imports:

from chainladder.utils import * # noqa (API Import)
from chainladder.core import * # noqa (API Import)
from chainladder.development import * # noqa (API Import)
from chainladder.adjustments import * # noqa (API Import)
from chainladder.tails import * # noqa (API Import)
from chainladder.methods import * # noqa (API Import)
from chainladder.workflow import * # noqa (API Import)

Citing PEP 20:

Explicit is better than implicit.

We should convert these to being explicit. In the process, we may find that some things might not need to be imported, or shouldn't. I would recommend using Pandas's __init__.py as a model:

https://github.com/pandas-dev/pandas/blob/main/pandas/__init__.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    Effort > Serious 🐘Large, complex tasks requiring a few weeks to months of work.Great First Contribution! 🌱Beginner friendly tickets with narrow scope and huge impact. Perfect to join our community!Impact > Moderate 🔶User-visible but non-breaking change. Treated like a minor version bump (e.g., 0.6.5 → 0.7.0).Refactor 🔧Code level improvements that restructure existing logic without changing behavior.
    No fields configured for Feature.

    Projects

    Status

    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions