Skip to content

Commit 7f46f03

Browse files
build: drop explicit awkward dependency (#419)
* drop explicit dependency on awkward * remove awkward HEAD tests from nightly CI tests
1 parent 7b9b6af commit 7f46f03

File tree

4 files changed

+6
-32
lines changed

4 files changed

+6
-32
lines changed

.github/workflows/dependencies-head.yml

-25
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,6 @@ jobs:
3232
run: |
3333
python -m pytest -r sx
3434
35-
awkward:
36-
37-
runs-on: ${{ matrix.os }}
38-
strategy:
39-
matrix:
40-
os: [ubuntu-latest]
41-
python-version: ['3.11']
42-
43-
steps:
44-
- uses: actions/checkout@v3
45-
- name: Set up Python ${{ matrix.python-version }}
46-
uses: actions/setup-python@v4
47-
with:
48-
python-version: ${{ matrix.python-version }}
49-
- name: Install dependencies
50-
run: |
51-
python -m pip install --upgrade pip setuptools wheel
52-
python -m pip install --ignore-installed --upgrade -q --no-cache-dir -e .[test]
53-
python -m pip uninstall --yes awkward
54-
python -m pip install --upgrade --no-cache-dir git+https://github.com/scikit-hep/awkward-1.0.git
55-
python -m pip list
56-
- name: Test with pytest
57-
run: |
58-
python -m pytest -r sx
59-
6035
uproot:
6136

6237
runs-on: ${{ matrix.os }}

pyproject.toml

-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ python_version = "3.9"
3737
[[tool.mypy.overrides]]
3838
module = [
3939
"uproot",
40-
"awkward",
41-
"awkward._v2",
4240
"pyhf",
4341
"matplotlib.*",
4442
"iminuit",

setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ python_requires = >=3.8
2525
install_requires =
2626
pyhf[minuit]~=0.7.0 # model.config.suggested_fixed / .par_names API changes, set_poi(None)
2727
boost_histogram>=1.0.0 # subclassing with family, 1.02 for stdev scaling fix (currently not needed)
28-
awkward>=1.8 # _v2 API in submodule
2928
tabulate>=0.8.1 # multiline text
3029
matplotlib>=3.5.0 # layout kwarg for subplots
3130
# below are direct dependencies of cabinetry, which are also included via pyhf[iminuit]

src/cabinetry/tabulate.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pathlib
55
from typing import Any, Dict, List, Optional, Union
66

7-
import awkward as ak
87
import numpy as np
98
import pyhf
109
import tabulate
@@ -285,9 +284,12 @@ def yields(
285284

286285
if per_channel:
287286
# yields per channel
288-
model_yields_per_channel = np.sum(
289-
ak.from_iter(model_prediction.model_yields), axis=-1
290-
).tolist()
287+
n_channels = len(model_prediction.model.config.channels)
288+
model_yields_per_channel = [
289+
np.sum(model_prediction.model_yields[i_chan], axis=-1).tolist()
290+
for i_chan in range(n_channels)
291+
]
292+
291293
data_per_channel = [sum(d) for d in data_yields]
292294
per_channel_table = _yields_per_channel(
293295
model_prediction.model,

0 commit comments

Comments
 (0)