Skip to content

Commit fc23bf2

Browse files
autoupdate pre-commit hooks (#84)
* autoupdate pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.12 → v0.15.20](astral-sh/ruff-pre-commit@v0.15.12...v0.15.20) * Add hash to functions with __eq__() as advised by ruff * remove hash functions * ruff v0.15.20 -> v0.15.21 * remove python 3.15 * remove noqa * remove icetray tests --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kevin Meagher <11620178+kjmeagher@users.noreply.github.com>
1 parent 16775e0 commit fc23bf2

5 files changed

Lines changed: 38 additions & 35 deletions

File tree

.github/workflows/tests.yml

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ jobs:
2323
include:
2424
- python-version: "3.14"
2525
os: macos-26
26-
- python-version: "3.15"
27-
os: macos-26
2826
steps:
2927
- uses: actions/checkout@v6
3028
- name: Set up Python ${{ matrix.python-version }}
@@ -60,36 +58,36 @@ jobs:
6058
with:
6159
fail_ci_if_error: false
6260
verbose: true
63-
TestsIceTray:
64-
env:
65-
UV_SYSTEM_PYTHON: 1
66-
runs-on: ubuntu-latest
67-
container: icecube/icetray:icetray-devel-current-ubuntu22.04-X64
68-
strategy:
69-
fail-fast: false
70-
steps:
71-
- uses: actions/checkout@v6
72-
- name: Install uv
73-
uses: astral-sh/setup-uv@v7
74-
with:
75-
enable-cache: true
76-
- name: Install SimWeights
77-
run: uv pip install -e .[test]
78-
- name: Download Test Data
79-
run: |
80-
curl -u icecube:${{ secrets.ICECUBE_PASSWORD }} https://convey.icecube.wisc.edu/data/ana/Software/simweights/test-data/simweights_testdata.tar.gz -O
81-
tar xzvf simweights_testdata.tar.gz
82-
- name: Run Unit Tests
83-
env:
84-
SIMWEIGHTS_TESTDATA: .
85-
run: /opt/icetray/bin/icetray-shell python -m pytest --junit-xml=test-results-icetray.junit.xml
86-
- name: Upload Test Results
87-
uses: actions/upload-artifact@v7
88-
if: always()
89-
with:
90-
if-no-files-found: error
91-
name: test-results-icetray.junit.xml
92-
path: test-results-icetray.junit.xml
61+
# TestsIceTray:
62+
# env:
63+
# UV_SYSTEM_PYTHON: 1
64+
# runs-on: ubuntu-latest
65+
# container: icecube/icetray:icetray-devel-current-ubuntu22.04-X64
66+
# strategy:
67+
# fail-fast: false
68+
# steps:
69+
# - uses: actions/checkout@v6
70+
# - name: Install uv
71+
# uses: astral-sh/setup-uv@v7
72+
# with:
73+
# enable-cache: true
74+
# - name: Install SimWeights
75+
# run: uv pip install -e .[test]
76+
# - name: Download Test Data
77+
# run: |
78+
# curl -u icecube:${{ secrets.ICECUBE_PASSWORD }} https://convey.icecube.wisc.edu/data/ana/Software/simweights/test-data/simweights_testdata.tar.gz -O
79+
# tar xzvf simweights_testdata.tar.gz
80+
# - name: Run Unit Tests
81+
# env:
82+
# SIMWEIGHTS_TESTDATA: .
83+
# run: /opt/icetray/bin/icetray-shell python -m pytest --junit-xml=test-results-icetray.junit.xml
84+
# - name: Upload Test Results
85+
# uses: actions/upload-artifact@v7
86+
# if: always()
87+
# with:
88+
# if-no-files-found: error
89+
# name: test-results-icetray.junit.xml
90+
# path: test-results-icetray.junit.xml
9391
publish-test-results:
9492
name: "Publish Tests Results"
9593
needs: Tests

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
- id: blacken-docs
2929
args: [-l 100]
3030
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: v0.15.12
31+
rev: v0.15.21
3232
hooks:
3333
- id: ruff
3434
args: [--fix, --show-fixes]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ ignore = [
8686
"S101", # assert-used
8787
"COM812", # conflicts with ruff formatter
8888
"ISC001", # conflicts with ruff formatter
89+
"PLR0913", # Too many arguments in function definition
8990
"PLR0911", # Too many return statement
9091
"PLW1641" # object does not implement `__hash__` method
9192
]

src/simweights/_generation_surface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def get_cos_zenith_range(self: "CompositeSurface", pdgid: "PDGCode | None" = Non
159159
assert np.isfinite(czmax)
160160
return czmin, czmax
161161

162-
def __eq__(self, other: object) -> bool:
162+
def __eq__(self: GenerationSurface, other: object) -> bool:
163163
# must handle the same set of particle types
164164
if isinstance(other, GenerationSurface):
165165
return self == CompositeSurface(other)

tests/test_weighter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
#
55
# SPDX-License-Identifier: BSD-2-Clause
66

7+
import contextlib
78
import unittest
89
from copy import deepcopy
910

1011
import numpy as np
1112

1213
from simweights import TIG1996, IceTopSurface, NaturalRateCylinder, NuGenSurface, PowerLaw, Weighter
1314

15+
with contextlib.suppress(ImportError):
16+
import nuflux
17+
1418

1519
def fluxfun1(energy):
1620
return energy**2
@@ -311,7 +315,7 @@ def test_nuflux(self):
311315
weighter1.add_weight_column("energy", data1["I3Weight"]["energy"])
312316
weighter1.add_weight_column("cos_zen", np.cos(data1["I3Weight"]["zenith"]))
313317

314-
honda = nuflux.makeFlux("honda2006") # noqa : F821
318+
honda = nuflux.makeFlux("honda2006")
315319
w = weighter1.get_weights(honda)
316320
fluxval = honda.getFlux(14, data1["I3Weight"]["energy"], np.cos(data1["I3Weight"]["zenith"]))
317321
oneweight = weighter1.get_weights(1)

0 commit comments

Comments
 (0)