Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/docs.yml

This file was deleted.

57 changes: 46 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,33 @@ concurrency:
cancel-in-progress: true
jobs:
Tests:
env:
UV_SYSTEM_PYTHON: 1
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-24.04]
include:
- python-version: "3.13"
os: macos-latest
os: macos-13
- python-version: "3.13"
os: macos-14
- python-version: "3.13"
os: macos-15
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install SimWeights
run: |
if [ "${{matrix.python-version}}" != "3.13" ]; then
python3 -m pip install nuflux
fi
python3 -m pip install flit
python3 -m flit install --symlink --deps=production --extras=test
run: uv pip install -e .[test]
- name: Download Test Data
run: |
curl -u icecube:${{ secrets.ICECUBE_PASSWORD }} https://convey.icecube.wisc.edu/data/ana/Software/simweights/test-data/simweights_testdata.tar.gz -O
Expand All @@ -60,14 +63,20 @@ jobs:
fail_ci_if_error: false
verbose: true
TestsIceTray:
env:
UV_SYSTEM_PYTHON: 1
runs-on: ubuntu-latest
container: icecube/icetray:icetray-devel-current-ubuntu22.04-X64
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install SimWeights
run: python3 -m pip install 'pytest>7' .[test]
run: uv pip install -e .[test]
- name: Download Test Data
run: |
curl -u icecube:${{ secrets.ICECUBE_PASSWORD }} https://convey.icecube.wisc.edu/data/ana/Software/simweights/test-data/simweights_testdata.tar.gz -O
Expand Down Expand Up @@ -104,3 +113,29 @@ jobs:
with:
files: "*.xml"
deduplicate_classes_by_file_name: true
Docs:
env:
UV_SYSTEM_PYTHON: 1
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install dependencies
run: |
uv pip install .[docs]
- name: Run Sphinx
working-directory: ./docs
run: make html
- name: Upload docs to docs.icecube.aq
if: ${{ github.ref_name == 'main' && !github.event.act }}
working-directory: ./docs
run: |
tar -czvf simweights_docs.tar.gz -C_build/html .
curl -XPUT -i --data-binary @simweights_docs.tar.gz https://docs.icecube.aq/api/upload?path=simweights/${{ github.ref_name }} -u icecube:${{ secrets.ICECUBE_PASSWORD }}
6 changes: 1 addition & 5 deletions tests/test_weighter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
#
# SPDX-License-Identifier: BSD-2-Clause

import contextlib
import unittest
from copy import deepcopy

import numpy as np

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

with contextlib.suppress(ImportError):
import nuflux


def fluxfun1(energy):
return energy**2
Expand Down Expand Up @@ -315,7 +311,7 @@ def test_nuflux(self):
weighter1.add_weight_column("energy", data1["I3Weight"]["energy"])
weighter1.add_weight_column("cos_zen", np.cos(data1["I3Weight"]["zenith"]))

honda = nuflux.makeFlux("honda2006")
honda = nuflux.makeFlux("honda2006") # noqa : F821
w = weighter1.get_weights(honda)
fluxval = honda.getFlux(14, data1["I3Weight"]["energy"], np.cos(data1["I3Weight"]["zenith"]))
oneweight = weighter1.get_weights(1)
Expand Down