Spaces:
Running
Running
Download sinetti_operator/red_reference.py from Couscouskabyle/iscc-app: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/Couscouskabyle/iscc-app/resolve/main/sinetti_operator/red_reference.py
- Command line
-
hf download hf://spaces/Couscouskabyle/iscc-app/sinetti_operator/red_reference.py
-
curl -L -o red_reference.py https://huggingface.co/spaces/Couscouskabyle/iscc-app/resolve/main/sinetti_operator/red_reference.py
1.05 kB
| """Project reviewed RED reference answers without shipping source-builder metadata.""" | |
| import json | |
| from pathlib import Path | |
| from sinetti_contracts.red_reference import SHAPE, validate_result | |
| from sinetti_contracts.customer_payloads import project | |
| def build_red_reference_results(annex_v_path, annex_vi_path): | |
| annex_v = json.loads(Path(annex_v_path).read_text(encoding="utf-8")) | |
| annex_vi = json.loads(Path(annex_vi_path).read_text(encoding="utf-8")) | |
| approved = { | |
| "annex_v": {**annex_v, | |
| "material_mapping": [{"material": material, "pathway_keys": keys} | |
| for material, keys in annex_v["material_mapping"].items() | |
| if not material.startswith("_")], | |
| "materials_without_default_value": annex_v["materials_without_default_value"]["materials"]}, | |
| "annex_vi": annex_vi, | |
| } | |
| approved = project(approved, SHAPE) | |
| validate_result(approved) | |
| return {"red_reference": {"": approved}} | |