Skip to content

Instantly share code, notes, and snippets.

View cwells's full-sized avatar

Cliff Wells cwells

  • Portland, Oregon USA
  • 07:39 (UTC -07:00)
View GitHub Profile
@kratsg
kratsg / example.py
Created April 2, 2020 18:52
python-jsonschema recursive RefResolver class
>>> import jsonschema
>>> resolver = jsonschema.RefResolver(base_uri='https://scikit-hep.org/pyhf/schemas/1.0.0/', referrer='workspace.json')
>>> rec_resolver = RecursiveRefResolver(base_uri='https://scikit-hep.org/pyhf/schemas/1.0.0/', referrer='workspace.json')
>>> resolver.resolve('https://scikit-hep.org/pyhf/schemas/1.0.0/workspace.json')
('https://scikit-hep.org/pyhf/schemas/1.0.0/workspace.json',
{'$schema': 'http://json-schema.org/draft-06/schema#',
'$id': 'https://scikit-hep.org/pyhf/schemas/1.0.0/workspace.json',
'$ref': 'defs.json#/definitions/workspace'})
>>> rec_resolver.resolve('https://scikit-hep.org/pyhf/schemas/1.0.0/workspace.json')
{'$schema': 'http://json-schema.org/draft-06/schema#',

NOT UP TO DATE!

Things in this document might not work or be broken nowadays

my laptop:

I'm writing this here because a few things in here are spesific to this model laptop.
Dell XPS 15 9560 (4k) touch screen

Some notes:

Most things after setup are not specific for this laptop
# = run as root