DHI / DHI/modelskill

Simplify time slicing in Comparer.sel()

Open
#575 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
56
Forks
9
Avg merge
57m
Merged PRs (30d)
3

Description

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

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

This could likely be simplified to:

```python
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.