Params language: one language at every depth
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 1
- Merge trung bình
- 8 giờ 48 phút
- Pull request đã merge (30 ngày)
- 70
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của scipp/essapps
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
A number that is not finite is stored as None at a field that accepts NoneCó thể đã có người làm @jeevanabhi-r đã nhận 6 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
scipp/essapps#140 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của scipp/essapps
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
FAIRmat-NFDI/pynxtools#861 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
NVIDIA/nsight-python#88 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Criteria can pass when the deliverable is missingCó thể đã có người làm @clementtisseau đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
harveyai/harvey-labs#217 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
priority/medium roadmap/v1.1.1 stakeholder/rapr type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
databrickslabs/ontos#1420 ·
Maintainer thường phản hồi trong vòng 3 ngày