Skip to content

Commit 7cc1534

Browse files
fix: Use uproot3 namespace (#1192)
* Use uproot3 library namespace explicitly to avoid errors from uproot-methods v0.9.1 - Use uproot3 in 'xmlio' extra * Use pattern: import uproot3 as uproot
1 parent a33badd commit 7cc1534

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
'torch': ['torch~=1.2'],
1010
'jax': ['jax~=0.2.4', 'jaxlib~=0.1.56'],
11-
'xmlio': ['uproot~=3.6'], # Future proof against uproot4 API changes
11+
'xmlio': ['uproot3~=3.14'], # Future proof against uproot4 API changes
1212
'minuit': ['iminuit~=1.4.3'], # v1.5.0 breaks pyhf for 32b TensorFlow and PyTorch
1313
}
1414
extras_require['backends'] = sorted(
@@ -40,7 +40,6 @@
4040
'papermill~=2.0',
4141
'nteract-scrapbook~=0.2',
4242
'jupyter',
43-
'uproot~=3.3',
4443
'graphviz',
4544
'jsonpatch',
4645
]

src/pyhf/cli/rootio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def cli():
3232
def xml2json(entrypoint_xml, basedir, output_file, track_progress):
3333
"""Entrypoint XML: The top-level XML file for the PDF definition."""
3434
try:
35-
import uproot
35+
import uproot3 as uproot
3636

3737
assert uproot
3838
except ImportError:
@@ -61,7 +61,7 @@ def xml2json(entrypoint_xml, basedir, output_file, track_progress):
6161
def json2xml(workspace, output_dir, specroot, dataroot, resultprefix, patch):
6262
"""Convert pyhf JSON back to XML + ROOT files."""
6363
try:
64-
import uproot
64+
import uproot3 as uproot
6565

6666
assert uproot
6767
except ImportError:

src/pyhf/readxml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import xml.etree.ElementTree as ET
77
import numpy as np
88
import tqdm
9-
import uproot
9+
import uproot3 as uproot
1010
import re
1111

1212
log = logging.getLogger(__name__)

src/pyhf/writexml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pkg_resources
66
import xml.etree.cElementTree as ET
77
import numpy as np
8-
import uproot
8+
import uproot3 as uproot
99
from uproot_methods.classes import TH1
1010

1111
from .mixins import _ChannelSummaryMixin

tests/test_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pyhf
22
import pyhf.readxml
33
import numpy as np
4-
import uproot
4+
import uproot3 as uproot
55
from pathlib import Path
66
import pytest
77
import xml.etree.cElementTree as ET

0 commit comments

Comments
 (0)