Skip to content

Commit

Permalink
GH Actions: python 3.11 (#77)
Browse files Browse the repository at this point in the history
* GH Actions: python 3.11

* GH Actions: cibuildwheel 2.13.1

* config.py: better support for mutable dataclass fields
  • Loading branch information
Areustle authored Jun 27, 2023
1 parent 173a52d commit a22e59f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pypi-build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
python: [37, 38, 39, 310]
python: [37, 38, 39, 310, 311]
include:
- os: ubuntu-latest
platform_id: manylinux_x86_64
Expand All @@ -30,7 +30,7 @@ jobs:
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Build wheels
uses: pypa/cibuildwheel@v2.12.0
uses: pypa/cibuildwheel@v2.13.1
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: [37, 38, 39, 310]
python: [37, 38, 39, 310, 311]
include:
- os: ubuntu-latest
platform_id: manylinux_x86_64
Expand All @@ -40,7 +40,7 @@ jobs:
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Build wheels
uses: pypa/cibuildwheel@v2.3.0
uses: pypa/cibuildwheel@v2.13.1
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
Expand Down
13 changes: 7 additions & 6 deletions src/nuspacesim/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

"""Module holding conifiguration class definitions."""

####

from __future__ import annotations

from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Any, Union

try:
Expand Down Expand Up @@ -176,7 +175,9 @@ class SimulationParameters:
"""Number of thrown trajectories. Default = 1000"""
theta_ch_max: float = radians(3.0)
"""Maximum Cherenkov Angle in radians. Default = π/60 radians (3 degrees)."""
spectrum: Union[MonoSpectrum, PowerSpectrum, FileSpectrum] = MonoSpectrum()
spectrum: Union[MonoSpectrum, PowerSpectrum, FileSpectrum] = field(
default_factory=MonoSpectrum
)
"""Distribution from which to draw nu_tau energies."""
e_shower_frac: float = 0.5
"""Fraction of ETau in Shower. Default = 0.5."""
Expand Down Expand Up @@ -259,9 +260,9 @@ class NssConfig:
"""

detector: DetectorCharacteristics = DetectorCharacteristics()
detector: DetectorCharacteristics = field(default_factory=DetectorCharacteristics)
"""The Detector Characteristics."""
simulation: SimulationParameters = SimulationParameters()
simulation: SimulationParameters = field(default_factory=SimulationParameters)
"""The Simulation Parameters."""
constants: const.Fund_Constants = const.Fund_Constants()
constants: const.Fund_Constants = field(default_factory=const.Fund_Constants)
"""The Fudimental physical constants."""

0 comments on commit a22e59f

Please sign in to comment.