研究输入冻结
原能力
提交资料版本、指标含义、期限、约束和待核证据,保留当时的研究口径。(细化版 p.16–17)
首选项目
DVC(Apache-2.0)。 DVC
匹配范围
锁定资料版本、文件和依赖链。
源码
DVC · def to_lockfile(
dvc/stage/serialize.py · 195–208 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def to_lockfile(stage: "PipelineStage", **kwargs) -> dict:
assert stage.name
return {stage.name: to_single_stage_lockfile(stage, **kwargs)}
def to_single_stage_file(stage: "Stage", **kwargs):
state = stage.dumpd(**kwargs)
# When we load a stage we parse yaml with a fast parser, which strips
# off all the comments and formatting. To retain those on update we do
# a trick here:
# - reparse the same yaml text with a slow but smart ruamel yaml parser
# - apply changes to a returned structure
# - serialize it
DVC · def checkout(
dvc/repo/checkout.py · 110–123 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def checkout( # noqa: C901
self,
targets=None,
with_deps=False,
force=False,
relink=False,
recursive=False,
allow_missing=False,
**kwargs,
):
from dvc.repo.index import build_data_index
from dvc.stage.exceptions import StageFileBadNameError, StageFileDoesNotExistError
from dvc_data.index.checkout import ADD, DELETE, MODIFY, apply, compare
实现与验收要点
各研究口径、时点、授权和待核状态的正式快照。