Skip to content

Error from pad default arguments #211

@mdtanker

Description

@mdtanker

I was trying to pad a grid with method="linear_ramp", but received the following error:

ValueError: unsupported keyword arguments for mode 'linear_ramp': {'constant_values'}

This seems to be due to constant_values defaulting to 0 instead of None. Pad works fine when I manually set constant_values=None, as below.

pad_width = {
        "northing": 10,
        "easting": 10,
}
xrft.pad(
    grid,
    pad_width,
    mode="linear_ramp",
    constant_values=None,
)

Maybe this can be fixed with switching the default value of constant_value to None for all methods except for constant, or a warning can be raised to manually set constant to None.

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