A run can fill more than one file role

オープン
#153 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
api, backend

調査の方向性

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
  1. 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. The File marker keeps one role. Small change, but Selector.matches, the form listing, and rules need to agree on it, and every consumer of metadata['role'] sees a list.
  2. 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
平均マージ
15時間 40分
マージ済み PR(30日)
59

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

scipp/essapps のほかの issue

scipp/essapps の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。