Skip to content

Commit

Permalink
re-include pre-filling of cache that was dropped in scikit-hep#1753
Browse files Browse the repository at this point in the history
  • Loading branch information
lhenkelm authored and matthewfeickert committed Aug 12, 2022
1 parent 910b665 commit 6c837fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pyhf/schema/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ def load_schema(schema_id: str):
schema = json.load(json_schema)
variables.SCHEMA_CACHE[schema['$id']] = schema
return variables.SCHEMA_CACHE[schema['$id']]


# pre-populate the cache to avoid network access
# on first validation in standard usage
# (not in pyhf.schema.variables to avoid circular imports)
load_schema(f'{variables.SCHEMA_VERSION}/defs.json')

0 comments on commit 6c837fe

Please sign in to comment.