pyhf.readxml.parse

pyhf.readxml.parse(configfile: pyhf.typing.PathOrStr | IO[bytes] | IO[str], rootdir: pyhf.typing.PathOrStr, mounts: Iterable[Tuple[pathlib.Path, pathlib.Path]] | None = None, track_progress: bool = False, validation_as_error: bool = True) pyhf.typing.Workspace[source]

Parse the configfile with respect to the rootdir.

Parameters:
  • configfile (pathlib.Path or str or file object) – The top-level XML config file to parse.

  • rootdir (pathlib.Path or str) – The path to the working directory for interpreting relative paths in the configuration.

  • mounts (None or list of 2-tuple of os.PathLike objects) – The first field is the local path to where files are located, the second field is the path where the file or directory are saved in the XML configuration. This is similar in spirit to Docker volume mounts. Default is None.

  • track_progress (bool) – Show the progress bar. Default is to hide the progress bar.

  • validation_as_error (bool) – Throw an exception (True) or print a warning (False) if the resulting HistFactory JSON does not adhere to the schema. Default is to throw an exception.

Returns:

The newly built HistFactory JSON specification

Return type:

spec (jsonable)