Skip to content

Commit 7da6a26

Browse files
Bump the actions group with 2 updates (#74)
* Bump the actions group with 2 updates Bumps the actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/upload-artifact` from 6 to 7 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v6...v7) Updates `actions/download-artifact` from 7 to 8 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v7...v8) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> * fix get_column for new uproot --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kevin Meagher <11620178+kjmeagher@users.noreply.github.com>
1 parent 4679fb9 commit 7da6a26

5 files changed

Lines changed: 70 additions & 63 deletions

File tree

.github/workflows/tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python-version: ["3.10", "3.11", "3.12", "3.13"]
21+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2222
os: [ubuntu-24.04]
2323
include:
24-
- python-version: "3.13"
24+
- python-version: "3.14"
2525
os: macos-15-intel
26-
- python-version: "3.13"
26+
- python-version: "3.14"
2727
os: macos-14
28-
- python-version: "3.13"
28+
- python-version: "3.14"
2929
os: macos-15
30-
- python-version: "3.13"
30+
- python-version: "3.14"
3131
os: macos-26
3232
steps:
3333
- uses: actions/checkout@v6
@@ -50,7 +50,7 @@ jobs:
5050
SIMWEIGHTS_TESTDATA: .
5151
run: python3 -m pytest --cov-report=xml --junit-xml=test-results-${{matrix.os}}-${{matrix.python-version}}.junit.xml
5252
- name: Upload Test Results
53-
uses: actions/upload-artifact@v6
53+
uses: actions/upload-artifact@v7
5454
if: always()
5555
with:
5656
if-no-files-found: error
@@ -88,7 +88,7 @@ jobs:
8888
SIMWEIGHTS_TESTDATA: .
8989
run: /opt/icetray/bin/icetray-shell python -m pytest --junit-xml=test-results-icetray.junit.xml
9090
- name: Upload Test Results
91-
uses: actions/upload-artifact@v6
91+
uses: actions/upload-artifact@v7
9292
if: always()
9393
with:
9494
if-no-files-found: error
@@ -105,7 +105,7 @@ jobs:
105105
if: always()
106106
steps:
107107
- name: Download Artifacts
108-
uses: actions/download-artifact@v7
108+
uses: actions/download-artifact@v8
109109
with:
110110
path: .
111111
pattern: test-results-*

.pre-commit-config.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
hooks:
1111
- id: yamlfmt
1212
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
13-
rev: v2.15.0
13+
rev: v2.16.0
1414
hooks:
1515
- id: pretty-format-toml
1616
args: [--autofix]
@@ -27,22 +27,15 @@ repos:
2727
hooks:
2828
- id: blacken-docs
2929
args: [-l 100]
30-
- repo: https://github.com/pre-commit/mirrors-mypy
31-
rev: v1.19.1
32-
hooks:
33-
- id: mypy
34-
files: simweights
35-
additional_dependencies: [numpy]
36-
exclude: ^contrib/
3730
- repo: https://github.com/pycqa/pylint
38-
rev: v4.0.4
31+
rev: v4.0.5
3932
hooks:
4033
- id: pylint
4134
files: simweights
4235
exclude: ^contrib/
4336
additional_dependencies: [numpy, pandas]
4437
- repo: https://github.com/astral-sh/ruff-pre-commit
45-
rev: v0.14.10
38+
rev: v0.15.4
4639
hooks:
4740
- id: ruff
4841
args: [--fix, --show-fixes]
@@ -62,7 +55,7 @@ repos:
6255
- id: rst-directive-colons
6356
- id: rst-inline-touching-normal
6457
- repo: https://github.com/Lucas-C/pre-commit-hooks
65-
rev: v1.5.5
58+
rev: v1.5.6
6659
hooks:
6760
- id: forbid-crlf
6861
- id: forbid-tabs

pyproject.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ classifiers = [
2121
'Programming Language :: Python :: 3.11',
2222
'Programming Language :: Python :: 3.12',
2323
'Programming Language :: Python :: 3.13',
24+
'Programming Language :: Python :: 3.14',
2425
'Topic :: Scientific/Engineering :: Astronomy',
2526
'Topic :: Scientific/Engineering :: Physics'
2627
]
27-
dependencies = ["numpy>=1.21.2", "scipy"]
28+
dependencies = ["numpy>=2", "scipy"]
2829
dynamic = ["version", "description"]
2930
keywords = ["python", "science", "astronomy", "astrophysics", "IceCube", "neutrino", "simulation"]
3031
license = {file = "LICENSES/BSD-2-Clause.txt"}
@@ -33,7 +34,7 @@ readme = "README.rst"
3334
requires-python = "~=3.8"
3435

3536
[project.optional-dependencies]
36-
dev = ["pytest", "pre-commit", "reuse", "black", "ruff", "pylint", "mypy"]
37+
dev = ["pytest", "pre-commit", "reuse", "ruff", "pylint"]
3738
docs = ["sphinx", "sphinx-rtd-theme", "pandas"]
3839
examples = ['matplotlib']
3940
test = [
@@ -68,11 +69,6 @@ source = ["simweights"]
6869
[tool.doc8]
6970
max-line-length = 128
7071

71-
[tool.mypy]
72-
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
73-
strict = true
74-
warn_unreachable = true
75-
7672
[tool.pylint.format]
7773
max-line-length = "128"
7874

src/simweights/_fluxes.py

Lines changed: 53 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -184,21 +184,31 @@ class GaisserH3a(CosmicRayFlux):
184184

185185
pdgids = PDGID_5COMP
186186
_funcs = (
187-
lambda E: 0.7860 * E**-2.66 * exp(-E / (4e6 * 1))
188-
+ 0.0020 * E**-2.4 * exp(-E / (3e7 * 1))
189-
+ 0.00017 * E**-2.4 * exp(-E / (2e9 * 1)),
190-
lambda E: 0.3550 * E**-2.58 * exp(-E / (4e6 * 2))
191-
+ 0.0020 * E**-2.4 * exp(-E / (3e7 * 2))
192-
+ 0.00017 * E**-2.4 * exp(-E / (2e9 * 2)),
193-
lambda E: 0.2200 * E**-2.63 * exp(-E / (4e6 * 7))
194-
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 7))
195-
+ 0.000114 * E**-2.4 * exp(-E / (2e9 * 7)),
196-
lambda E: 0.1430 * E**-2.67 * exp(-E / (4e6 * 13))
197-
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 13))
198-
+ 0.000114 * E**-2.4 * exp(-E / (2e9 * 13)),
199-
lambda E: 0.2120 * E**-2.63 * exp(-E / (4e6 * 26))
200-
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 26))
201-
+ 0.000114 * E**-2.4 * exp(-E / (2e9 * 26)),
187+
lambda E: (
188+
0.7860 * E**-2.66 * exp(-E / (4e6 * 1))
189+
+ 0.0020 * E**-2.4 * exp(-E / (3e7 * 1))
190+
+ 0.00017 * E**-2.4 * exp(-E / (2e9 * 1))
191+
),
192+
lambda E: (
193+
0.3550 * E**-2.58 * exp(-E / (4e6 * 2))
194+
+ 0.0020 * E**-2.4 * exp(-E / (3e7 * 2))
195+
+ 0.00017 * E**-2.4 * exp(-E / (2e9 * 2))
196+
),
197+
lambda E: (
198+
0.2200 * E**-2.63 * exp(-E / (4e6 * 7))
199+
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 7))
200+
+ 0.000114 * E**-2.4 * exp(-E / (2e9 * 7))
201+
),
202+
lambda E: (
203+
0.1430 * E**-2.67 * exp(-E / (4e6 * 13))
204+
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 13))
205+
+ 0.000114 * E**-2.4 * exp(-E / (2e9 * 13))
206+
),
207+
lambda E: (
208+
0.2120 * E**-2.63 * exp(-E / (4e6 * 26))
209+
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 26))
210+
+ 0.000114 * E**-2.4 * exp(-E / (2e9 * 26))
211+
),
202212
)
203213

204214

@@ -212,9 +222,9 @@ class GaisserH4a(CosmicRayFlux):
212222

213223
pdgids = PDGID_5COMP
214224
_funcs = (
215-
lambda E: 0.7860 * E**-2.66 * exp(-E / (4e6 * 1))
216-
+ 0.0020 * E**-2.4 * exp(-E / (3e7 * 1))
217-
+ 0.0200 * E**-2.6 * exp(-E / 6e10),
225+
lambda E: (
226+
0.7860 * E**-2.66 * exp(-E / (4e6 * 1)) + 0.0020 * E**-2.4 * exp(-E / (3e7 * 1)) + 0.0200 * E**-2.6 * exp(-E / 6e10)
227+
),
218228
lambda E: 0.3550 * E**-2.58 * exp(-E / (4e6 * 2)) + 0.002 * E**-2.4 * exp(-E / (3e7 * 2)),
219229
lambda E: 0.2200 * E**-2.63 * exp(-E / (4e6 * 7)) + 0.00134 * E**-2.4 * exp(-E / (3e7 * 7)),
220230
lambda E: 0.1430 * E**-2.67 * exp(-E / (4e6 * 13)) + 0.00134 * E**-2.4 * exp(-E / (3e7 * 13)),
@@ -233,14 +243,16 @@ class GaisserH4a_IT(CosmicRayFlux):
233243
# pylint: disable=invalid-name
234244
pdgids = PDGID_4COMP
235245
_funcs = (
236-
lambda E: 0.7860 * E**-2.66 * exp(-E / (4e6 * 1))
237-
+ 0.0020 * E**-2.4 * exp(-E / (3e7 * 1))
238-
+ 0.0200 * E**-2.6 * exp(-E / 6e10),
246+
lambda E: (
247+
0.7860 * E**-2.66 * exp(-E / (4e6 * 1)) + 0.0020 * E**-2.4 * exp(-E / (3e7 * 1)) + 0.0200 * E**-2.6 * exp(-E / 6e10)
248+
),
239249
lambda E: 0.3550 * E**-2.58 * exp(-E / (4e6 * 2)) + 0.0020 * E**-2.4 * exp(-E / (3e7 * 2)),
240-
lambda E: 0.2200 * E**-2.63 * exp(-E / (4e6 * 7))
241-
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 7))
242-
+ 0.1430 * E**-2.67 * exp(-E / (4e6 * 13))
243-
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 13)),
250+
lambda E: (
251+
0.2200 * E**-2.63 * exp(-E / (4e6 * 7))
252+
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 7))
253+
+ 0.1430 * E**-2.67 * exp(-E / (4e6 * 13))
254+
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 13))
255+
),
244256
lambda E: 0.2120 * E**-2.63 * exp(-E / (4e6 * 26)) + 0.00134 * E**-2.4 * exp(-E / (3e7 * 26)),
245257
)
246258

@@ -304,9 +316,11 @@ class GlobalFitGST(CosmicRayFlux):
304316
lambda E: 0.32 * E**-2.58 * exp(-E / 1.2e5 / 2) + 0.0065 * E**-2.3 * exp(-E / 4e6 / 2),
305317
lambda E: 0.01 * E**-2.40 * exp(-E / 1.2e5 / 7) + 0.0006 * E**-2.3 * exp(-E / 4e6 / 7),
306318
lambda E: 0.013 * E**-2.40 * exp(-E / 1.2e5 / 13) + 0.0007 * E**-2.3 * exp(-E / 4e6 / 13),
307-
lambda E: 0.006 * E**-2.30 * exp(-E / 1.2e5 / 26)
308-
+ 0.00023 * E**-2.2 * exp(-E / 4e6 / 26)
309-
+ 0.0000025 * E**-2.2 * exp(-E / 1.3e9 / 26),
319+
lambda E: (
320+
0.006 * E**-2.30 * exp(-E / 1.2e5 / 26)
321+
+ 0.00023 * E**-2.2 * exp(-E / 4e6 / 26)
322+
+ 0.0000025 * E**-2.2 * exp(-E / 1.3e9 / 26)
323+
),
310324
)
311325

312326

@@ -320,13 +334,17 @@ class GlobalFitGST_IT(CosmicRayFlux): # pylint: disable=invalid-name
320334
_funcs = (
321335
lambda E: 0.7 * E**-2.66 * exp(-E / 1.2e5) + 0.015 * E**-2.4 * exp(-E / 4e6) + 0.0014 * E**-2.4 * exp(-E / 1.3e9),
322336
lambda E: 0.32 * E**-2.58 * exp(-E / 1.2e5 / 2) + 0.0065 * E**-2.3 * exp(-E / 4e6 / 2),
323-
lambda E: 0.01 * E**-2.40 * exp(-E / 1.2e5 / 7)
324-
+ 0.0006 * E**-2.3 * exp(-E / 4e6 / 7)
325-
+ 0.013 * E**-2.40 * exp(-E / 1.2e5 / 13)
326-
+ 0.0007 * E**-2.3 * exp(-E / 4e6 / 13),
327-
lambda E: 0.006 * E**-2.30 * exp(-E / 1.2e5 / 26)
328-
+ 0.00023 * E**-2.2 * exp(-E / 4e6 / 26)
329-
+ 0.0000025 * E**-2.2 * exp(-E / 1.3e9 / 26),
337+
lambda E: (
338+
0.01 * E**-2.40 * exp(-E / 1.2e5 / 7)
339+
+ 0.0006 * E**-2.3 * exp(-E / 4e6 / 7)
340+
+ 0.013 * E**-2.40 * exp(-E / 1.2e5 / 13)
341+
+ 0.0007 * E**-2.3 * exp(-E / 4e6 / 13)
342+
),
343+
lambda E: (
344+
0.006 * E**-2.30 * exp(-E / 1.2e5 / 26)
345+
+ 0.00023 * E**-2.2 * exp(-E / 4e6 / 26)
346+
+ 0.0000025 * E**-2.2 * exp(-E / 1.3e9 / 26)
347+
),
330348
)
331349

332350

src/simweights/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ def has_column(table: Any, name: str) -> bool:
8181

8282
def get_column(table: Any, name: str) -> Any:
8383
"""Helper function getting a column from a table, works with h5py, pytables, and pandas."""
84+
if hasattr(table, "arrays"):
85+
return table.arrays(library="np")[name]
8486
if hasattr(table, "cols"):
8587
return np.asarray(getattr(table.cols, name)[:], dtype=np.float64)
8688
if hasattr(table, name):
@@ -92,8 +94,6 @@ def get_column(table: Any, name: str) -> Any:
9294
if hasattr(table, "primary") and hasattr(table.primary.dir, name):
9395
return np.asarray(np.atleast_1d(getattr(table.primary.dir, name)), dtype=np.float64)
9496
column = table[name]
95-
if hasattr(column, "array") and callable(column.array):
96-
return np.asarray(column.array(library="np"), dtype=np.float64)
9797
return np.asarray(np.atleast_1d(column), dtype=np.float64)
9898

9999

0 commit comments

Comments
 (0)