Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Alternative Schema Locations #1753

Merged
merged 30 commits into from
Mar 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
95dceec
add importlib_resources backport
kratsg Jan 24, 2022
3986a08
update schema loading to use the importlib
kratsg Jan 24, 2022
b36a615
drop pkg_resources from the utils
kratsg Jan 24, 2022
203c3c4
clarify the exception coverage
kratsg Jan 24, 2022
81a196e
migrate to getting version passed only into validate, but not load_sc…
kratsg Jan 24, 2022
effb164
base_uri should be full uri
kratsg Jan 24, 2022
ba4fa60
minor change
kratsg Jan 24, 2022
41f9735
refactor so we can override it via pyhf.utils.schemas
kratsg Jan 24, 2022
434b94f
fix up test to change signature for load_schema
kratsg Jan 24, 2022
9ea9f9d
drop pkg_resources
kratsg Jan 24, 2022
5148451
fix typo
kratsg Jan 24, 2022
5a83b80
matthew's suggestion fixes
kratsg Mar 22, 2022
492c3af
migrate schema utilities to a different location
kratsg Mar 22, 2022
39be7e5
fix up
kratsg Mar 22, 2022
a5f7cbc
update docs
kratsg Mar 22, 2022
58a979e
update tests
kratsg Mar 22, 2022
ba91e3c
fix up public api more
kratsg Mar 22, 2022
47192a7
check that things work
kratsg Mar 22, 2022
ab056a2
fix strpath
kratsg Mar 22, 2022
2ee03ab
last error
kratsg Mar 22, 2022
59319e6
fix contrib
kratsg Mar 22, 2022
6b0573e
add docs and example
kratsg Mar 23, 2022
9a2b834
add info about the module itself
kratsg Mar 23, 2022
a245353
minor tweak to api docs
kratsg Mar 23, 2022
f17f67d
fix
kratsg Mar 23, 2022
186903b
Update setup.cfg
kratsg Mar 23, 2022
12f7d59
Update src/pyhf/schema/loader.py
kratsg Mar 23, 2022
75bd603
Update src/pyhf/schema/variables.py
kratsg Mar 23, 2022
d46b82d
Update src/pyhf/utils.py
kratsg Mar 23, 2022
8b38df6
feickert suggestion
kratsg Mar 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update tests
  • Loading branch information
kratsg committed Mar 22, 2022
commit 58a979eca9a2a2a40699a0b69bc75e08094fdc59
18 changes: 18 additions & 0 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
import json


@pytest.mark.parametrize('version', ['1.0.0'])
@pytest.mark.parametrize(
'schema', ['defs.json', 'measurement.json', 'model.json', 'workspace.json']
)
def test_get_schema(version, schema):
assert pyhf.schema.load_schema(f'{version}/{schema}')


def test_load_missing_schema():
with pytest.raises(IOError):
pyhf.schema.load_schema('fake_schema.json')


def test_schema_callable():
assert callable(pyhf.schema)
assert pyhf.schema() == 42


def test_no_channels():
spec = {'channels': []}
with pytest.raises(pyhf.exceptions.InvalidSpecification):
Expand Down
13 changes: 0 additions & 13 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@
import pyhf


@pytest.mark.parametrize('version', ['1.0.0'])
@pytest.mark.parametrize(
'schema', ['defs.json', 'measurement.json', 'model.json', 'workspace.json']
)
def test_get_schema(version, schema):
assert pyhf.schema.load_schema(f'{version}/{schema}')


def test_load_missing_schema():
with pytest.raises(IOError):
pyhf.schema.load_schema('fake_schema.json')


@pytest.mark.parametrize(
'opts,obj',
[
Expand Down