pyhf.schema.load_schema#
- pyhf.schema.load_schema(schema_id: str)[source]#
Get a schema by relative path from cache, or load it into the cache and return.
- Parameters:
schema_id (str) – Relative path to schema from
pyhf.schema.path
Example
>>> import pyhf >>> schema = pyhf.schema.load_schema("1.0.0/defs.json") >>> type(schema) <class 'dict'> >>> schema.keys() dict_keys(['$schema', '$id', 'definitions']) >>> pyhf.schema.load_schema("0.0.0/defs.json") Traceback (most recent call last): ... pyhf.exceptions.SchemaNotFound: ...
- Returns:
The loaded schema.
- Return type:
schema (dict)
- Raises:
SchemaNotFound – if the provided
schema_id
cannot be found.