Skip to content

Refactor interpolate_from_file API #18

@alperaltuntas

Description

@alperaltuntas

Currently, creating a topo object by interpolating from a file looks like:

topo = Topo(
    grid = grid,
    min_depth = 9.5,
)

topo.interpolate_from_file(
    file_path = "...",
    longitude_coordinate_name="lonh",
    latitude_coordinate_name="lath",
    vertical_coordinate_name="depth"
)

I think we should instead have something like:

topo = Topo.interpolate_from_file(
    grid = grid,
    min_depth = 9.5,
    file_path = "...",
    longitude_coordinate_name="lonh",
    latitude_coordinate_name="lath",
    vertical_coordinate_name="depth"
)

i.e., interpolate_from_file should be a class method instead, similar to the from_topo_file method.

@manishvenu what do you think?

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