Skip to content

ENH: remove method argument from OO methods #301

@r4lv

Description

@r4lv

While working with HCIDataset.recenter, I was thinking about whether we are giving the user too many parameters at once.

HCIDataset.recenter aggregates the preproc/recentering.py::cube_recenter_* functions, and merges all keyword arguments from these functions into one single signature, which results in a large list. Which of these arguments are actually needed depend on the method parameter.

problem

So when a user wants to improve his recentering, he has to read through the docstrings to check which parameters belong to his method, and which parameters he has to ignore. This makes it difficult for the user to see what is available, as he is flooded with options.

proposition

We could make the actual recentering methods a "sub-method", so that the cube_recenter_* functions stay encapsulated, but are still accessible directly from an HCIDataset. Example:

ds = HCIDataset(...)

ds.recenter.radon(...)
# or
ds.recenter.satspots(...)

This keeps the tab completion of HCIDataset. "clean", but helps the user with precise documentation for that specific method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions