Schema

class pyhf.schema.Schema(name, doc=None)[source]

Bases: module

A module-level wrapper around pyhf.schema which will provide additional functionality for interacting with schemas.

Example (callable)

>>> import pyhf.schema
>>> import pathlib
>>> curr_path = pyhf.schema.path
>>> curr_path  
PosixPath('.../pyhf/schemas')
>>> new_path = pathlib.Path("/home/root/my/new/path")
>>> pyhf.schema(new_path)  
<module 'pyhf.schema' from ...>
>>> pyhf.schema.path
PosixPath('/home/root/my/new/path')
>>> pyhf.schema(curr_path)  
<module 'pyhf.schema' from ...>
>>> pyhf.schema.path  
PosixPath('.../pyhf/schemas')

Example (context-manager)

>>> import pyhf.schema
>>> import pathlib
>>> curr_path = pyhf.schema.path
>>> curr_path  
PosixPath('.../pyhf/schemas')
>>> new_path = pathlib.Path("/home/root/my/new/path")
>>> with pyhf.schema(new_path):
...     print(repr(pyhf.schema.path))
...
PosixPath('/home/root/my/new/path')
>>> pyhf.schema.path  
PosixPath('.../pyhf/schemas')
__init__(*args, **kwargs)

Attributes

path

The local path for schemas.

version

The default version used for finding schemas.

Methods