[ESSSPECTROSCOPY] `save_sqw` writes a file Horace refuses when an axis has one bin

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Start in ess/bifrost/io/sqw.py at _make_dnd_metadata (around line 380) and trace how single_bin_defines_iax and dax are set for axes with one bin. Compare the generated metadata for u3: 1 and u3: 2, then check for tests covering save_sqw and read_sqw. Done when Horace accepts a file with a one-bin axis and the metadata lists only the plot axes.

Written by the indexing model from the issue text.

Description

essspectroscopy

With bin_sizes={'u1': 40, 'u2': 40, 'u3': 1, 'u4': 40}, Horace 4.2.0's read_sqw refuses the file: "number of display axes elements (4) have to be equal to the number of projection axes (3)". _make_dnd_metadata (ess/bifrost/io/sqw.py:380) sets single_bin_defines_iax true on every axis and dax to all four axes, whatever the bin counts. With 'u3': 2 Horace reads the file.

Suggestion: write dax over the plot axes only.

Checked on scipp 26.11.0, scippneutron 26.10.0, essreduce 26.11.1, essspectroscopy 26.11.3.

Dominant language
Python
Stars
3
Forks
6
Avg merge
2d 7h
Merged PRs (30d)
36

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/ess

All issues in scipp/ess

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.