A run can fill more than one file role
维护者通常 1 天内回复
评估
调研方向
Read files.py for Selector.matches, checks.py for submit validation, and docs/requirements/sans.md plus docs/requirements/data.md for the requirements and open design question. Compare the two role options against filtering in client.files.list, form listings, and rule selectors; confirm the approach with the NICOS and SciCat constraints before implementation. Done means a run with two roles is accepted for each role at submit and in all the listed selectors.
由索引模型根据 Issue 内容生成。
描述
A file has one role in its metadata, and Selector.matches compares it with the marker's value by equality (files.py). The backend refuses a file that does not match at submit (checks.py), and rules and form pickers filter the same way. So a run can fill only fields of one role.
Real data do not fit this. In the esssans LoKI tutorial, run 60392 is both the can transmission run and the empty-beam run (ess.loki.data.loki_tutorial_run_60392):
class IofQParams(BaseModel):
can_transmission: TransmissionRunFile # File(role='transmission')
empty_beam: EmptyBeamRunFile # File(role='empty_beam')
client.submit(IOFQ, params={'can_transmission': file(run=60392), # fits if the table says role='transmission'
'empty_beam': file(run=60392), ...}) # then this is refused
docs/requirements/sans.md records that one run can fill several roles. #143 deferred list-valued roles.
Workaround
The LoKI specs of #24 type empty_beam as RunFile, which accepts a raw file of any role. The request then goes through, but a form offers every run for that field, and a file source's role plays no part in choosing the empty beam.
Options
- Roles as a set on the file's side. The metadata hold
role=['transmission', 'empty_beam'], and a selector matches if the marker's role is in the set. TheFilemarker keeps one role. Small change, butSelector.matches, the form listing, and rules need to agree on it, and every consumer ofmetadata['role']sees a list. - Metadata describe the measurement, and a role is a use. A file says what was measured: is there a sample, a can, is the transmission monitor in the beam. A field's marker selects on those facts. A 60392-like run then fits both fields without saying so. This fits the Open question in
docs/requirements/data.md(how files or the catalogue say what role a run plays), but the vocabulary depends on what ESS files will hold.
Option 1 is enough for a table a person fills (#24, #131). Automatic reduction (#151) needs the answer from the NICOS and SciCat teams, which may favour option 2.
Tests
A run with two roles fits fields of each role, at submit, in client.files.list, in a form's listing, and in a rule's selector.
- 主要语言
- Python
- 星标
- 0
- 派生
- 1
- 平均合并
- 9 小时 40 分钟
- 30 天内合并 PR
- 60
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
scipp/essapps 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
A number that is not finite is stored as None at a field that accepts None可能已有人在做 @jeevanabhi-r 于 4 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
igormcsouza/tether#278 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
aws-samples/sample-per-model-bedrock#803 ·
维护者通常 1 天内回复
-
documentation p1
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
huggingface/accelerate#4511 ·
维护者通常 1 天内回复
-
follow-up
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复