mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Map RdSAP-Schema-19.0 certs to EpcPropertyData 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fcc2e5d0f8
commit
5178197dc2
3 changed files with 1027 additions and 4 deletions
1000
backend/epc_api/json_samples/RdSAP-Schema-19.0/corpus.jsonl
Normal file
1000
backend/epc_api/json_samples/RdSAP-Schema-19.0/corpus.jsonl
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -62,3 +62,21 @@ def _cases(schemas: set[str]) -> list[Any]:
|
|||
def test_supported_schemas_map(cert: dict[str, Any]) -> None:
|
||||
result = EpcPropertyDataMapper.from_api_response(cert)
|
||||
assert isinstance(result, EpcPropertyData)
|
||||
|
||||
|
||||
def _first(schema: str) -> dict[str, Any]:
|
||||
certs = _load(schema)
|
||||
if not certs:
|
||||
pytest.skip(f"no {schema} corpus harvested")
|
||||
return certs[0]
|
||||
|
||||
|
||||
def test_rdsap_19_0_maps() -> None:
|
||||
# Arrange
|
||||
cert = _first("RdSAP-Schema-19.0")
|
||||
|
||||
# Act
|
||||
result = EpcPropertyDataMapper.from_api_response(cert)
|
||||
|
||||
# Assert
|
||||
assert isinstance(result, EpcPropertyData)
|
||||
|
|
|
|||
|
|
@ -44,10 +44,15 @@ SOURCES: list[tuple[str, str, int]] = [
|
|||
# ("certificates-2026.json", "RdSAP-Schema-21.0.1", 1000),
|
||||
# ("certificates-2022.json", "RdSAP-Schema-20.0.0", 1000),
|
||||
# pre-SAP10 RdSAP family — NOT the SAP-Schema-* full/design-SAP family.
|
||||
# schema_type scan: RdSAP-Schema-18.0 is ~82% of certificates-2018.json,
|
||||
# 17.1 dominant in 2017, 17.0 dominant in 2015.
|
||||
("certificates-2018.json", "RdSAP-Schema-18.0", 1000),
|
||||
("certificates-2017.json", "RdSAP-Schema-17.1", 1000),
|
||||
# schema_type scan (first 300k lines of each dump):
|
||||
# 18.0 ~82% of certificates-2018.json
|
||||
# 17.1 dominant in 2017
|
||||
# 19.0 dominant in certificates-2020.json (~59%); only ~21% in 2019
|
||||
# (behind 18.0), so harvest from 2020.
|
||||
# 17.0 dominant in certificates-2015.json (~89%); 2016 a fallback.
|
||||
# ("certificates-2018.json", "RdSAP-Schema-18.0", 1000),
|
||||
# ("certificates-2017.json", "RdSAP-Schema-17.1", 1000),
|
||||
("certificates-2020.json", "RdSAP-Schema-19.0", 1000),
|
||||
# ("certificates-2015.json", "RdSAP-Schema-17.0", 1000),
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue