Params language: one language at every depth
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
With #133, a spec marks each field that a reference fills as Referenced[T]. Most rules that set a parameter apart from a field of a group existed because a reference inside a group was costly. They include: references only at a parameter or a row, flat groups, a "data value" that made a group reference-only, and "every parameter is a group". This issue makes the params language the same at every depth.
The language
A field of the params model, or of a group nested to any depth, is typed from a closed list:
int, float, str, bool, datetime, an enum, a Literal # scalars
RunFile # a file model
Specimen # a group: its fields typed the same way
Annotated[A | B, Field(discriminator='kind')] # a union of groups, tagged
Referenced[T] # T a group; the framework does not look inside
X | None, list[X] # X not a list, not X | None
Annotated[A | B, ...] | Referenced[C] # inline members and referenced members
Any other type is refused, such as a tuple, a dict, int | str, or sc.DataArray outside Referenced[T]. A group that contains itself is refused.
class Sample(BaseModel):
run: SampleRun
thickness: float = 1.0
window: Window | None = None
transmission: Referenced[Transmission] # a reference at a field of a table row
class Params(BaseModel):
samples: list[Sample]
How a group with a reference is validated
| When | A file | A reference to an output |
|---|---|---|
| submit | resolved to its identity through the validation context | checked against history, at its position |
| run | given its local path through the validation context | replaced by its data through the validation context |
When the request runs, the params model itself validates what the record stores, and the marker of Referenced[T] reads the data. A group that holds a reference runs its validators then; every other group is validated whole at submit.
Decisions
- No "data value": a type outside the list is refused.
- A parameter need not be a group. By convention it still is: a group is a tab of the form and a key of the binding.
PipelineBindingrequireskeys=for any other parameter. X | Noneat any depth: a choice with a "None" way in the form, files included.- Lists at any depth. Only a table is validated a row at a time, and only a table is limited to length constraints.
- Table rows are distinct by their stored form only: a file by its identity, a reference by its record and output.
- The discriminator sits on the union written inline, since a reference has no tag.
- The term "place" goes, and
ess.spec.placesis folded intofield_typesandrequest_types.
- 主要言語
- Python
- スター
- 0
- フォーク
- 1
- 平均マージ
- 8時間 48分
- マージ済み PR(30日)
- 70
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
scipp/essapps のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 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 が 6 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
scipp/essapps#140 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 32/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
FAIRmat-NFDI/pynxtools#861 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NVIDIA/nsight-python#88 ·
メンテナーはふだん 1 日以内に返信
-
Criteria can pass when the deliverable is missing対応中かも @clementtisseau が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
harveyai/harvey-labs#217 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
priority/medium roadmap/v1.1.1 stakeholder/rapr type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
databrickslabs/ontos#1420 ·
メンテナーはふだん 3 日以内に返信