`CombinedSlicer` retains range selection when switching to single-handle

Open Beginner friendly
#620 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
79/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
frontend, testing

Research direction

The reproducer points to CombinedSlicer in plopp.widgets.slicing. Read its mode toggle and value handling, then run the reproducer and check the relevant slicer tests. The issue is fixed when switching to single-handle mode makes slicer.value report (0, 0) while slicer.int_slicer.value remains 0.

Written by the indexing model from the issue text.

Description

Switching from the slice handle to single entry handle does sometimes not update the selected range.

Here is a minimal reproducer:

import scipp as sc
from plopp.widgets.slicing import CombinedSlicer

slicer = CombinedSlicer(
    dim="x", size=2, coord=sc.arange("x", 2, unit=None)
)
print(slicer.value)  # (0, 1)

# Equivalent to clicking the single-handle mode button.
slicer.slider_toggler.value = "-o-"

print(slicer.int_slicer.value)  # 0: displayed single index
print(slicer.value)             # (0, 1): expected (0, 0)
Dominant language
Python
Stars
12
Forks
6
Avg merge
1d 17h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from scipp/plopp

All issues in scipp/plopp

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.