Skip to content

Simplify time slicing in Comparer.sel() #575

@ecomodeller

Description

@ecomodeller

The time slicing in Comparer.sel() uses an overly complex chain:

d = d.sel(time=d.time.to_index().to_frame().loc[start:end].index)

This could likely be simplified to:

d = d.sel(time=slice(start, end))

which is already how raw_mod_data is filtered two lines below.

See src/modelskill/comparison/_comparison.py around line 855.

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