diff --git a/src/pyhf/schema/loader.py b/src/pyhf/schema/loader.py index 920766c4dc..0562af0960 100644 --- a/src/pyhf/schema/loader.py +++ b/src/pyhf/schema/loader.py @@ -19,7 +19,7 @@ def load_schema(schema_id: str): Args: schema_id (str): Relative path to schema from :attr:`pyhf.schema.path` - Example: + Examples: >>> import pyhf >>> schema = pyhf.schema.load_schema("1.0.0/defs.json") >>> type(schema) @@ -31,6 +31,18 @@ def load_schema(schema_id: str): ... pyhf.exceptions.SchemaNotFound: ... + >>> import pyhf + >>> import os + >>> schema = pyhf.schema.load_schema(f"1.0.0{os.sep}defs.json") + >>> type(schema) + + >>> schema.keys() + dict_keys(['$schema', '$id', 'definitions']) + >>> pyhf.schema.load_schema(f"0.0.0{os.sep}defs.json") # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + pyhf.exceptions.SchemaNotFound: ... + Returns: schema (dict): The loaded schema.