Skip to content

lookup_linke_turbidity is slow #368

Closed
@adriesse

Description

@adriesse

When using time series with millions of entries, lookup_linke_turbidity becomes a bottleneck.

My first suggestion is to set interp_turbidity=False by default.

My second suggestion is to to replace the fragment:

linke_turbidity = pd.DataFrame(time.month, index=time)
# apply monthly data
linke_turbidity = linke_turbidity.apply(lambda x: g[x[0]-1], axis=1)

with something like this:

months = time.month - 1
linke_turbidity = pd.DataFrame(g[months], index=time)

The interpolation could be sped up by expanding g to 366 values and then indexing by dayofyear.

PS. I know this would make a perfect issue for my first pull request, but I'm afraid I'm not ready for that step! :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions