Skip to content

Commit

Permalink
add an additional example that is os-independent
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg committed Oct 24, 2023
1 parent ad56f81 commit 8df78f2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/pyhf/schema/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
<class 'dict'>
>>> 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.
Expand Down

0 comments on commit 8df78f2

Please sign in to comment.