Skip to content

Commit

Permalink
Add nuleptonsim & nupyprop_bdhm tables in Taus data lookup options.
Browse files Browse the repository at this point in the history
  • Loading branch information
Areustle committed Feb 3, 2025
1 parent af68bb6 commit 4809515
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi-build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
CIBW_TEST_SKIP: "*_aarch64, *macosx*, *_arm64, *_universal2:arm64"

- name: Upload Build Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: nuspacesim-gh-pypi-artifact
path: wheelhouse/*.whl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
CIBW_TEST_SKIP: "*_aarch64, *macosx*, *_arm64, *_universal2:arm64"

- name: Upload Build Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: nuspacesim-gh-pypi-artifact
path: wheelhouse/*.whl
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: check-added-large-files
args: ["--maxkb", "8192"]
- id: check-xml

- repo: https://github.com/ambv/black
rev: 23.11.0
rev: 25.1.0
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.1.1
hooks:
- id: flake8

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 6.0.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
rev: v2.7.0
hooks:
- id: setup-cfg-fmt
args: ["--include-version-classifiers", "--max-py-version=3.11"]
args: ["--include-version-classifiers", "--max-py-version=3.13"]
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = ["setuptools>=46",
requires = ["setuptools>=65.0.0",
"setuptools_scm[toml]>=3.4",
"wheel",
"wheel>=0.41.0",
"pybind11>=2.8",
"numpy>1.17",
]
Expand All @@ -18,7 +18,7 @@ test-requires = "pytest"
test-command = "pytest {project}/test"

[tool.cibuildwheel.macos]
archs = ["x86_64"] #, "universal2", "arm64"]
archs = ["x86_64", "universal2", "arm64"]

[tool.cibuildwheel.linux]
archs = ["x86_64"]
Expand Down
9 changes: 6 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ classifiers =
Programming Language :: C++
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
keywords =
NASA
neutrinos
Expand All @@ -41,7 +42,7 @@ install_requires =
importlib-metadata;python_version<"3.8"
importlib-resources;python_version<"3.9"
tomli;python_version<"3.11"
python_requires = >=3.8
python_requires = >=3.9
ext_package = nuspacesim
package_dir =
= src
Expand Down Expand Up @@ -89,7 +90,7 @@ universal = 0

[tox:tox]
envlist =
py{38,39,310,311}
py{38,39,310,311,312,313}
docs
isolated_build = True

Expand All @@ -99,6 +100,8 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313

[testenv]
deps =
Expand Down
4 changes: 2 additions & 2 deletions src/nuspacesim/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class Ionosphere(BaseModel):
################ tau_shower classes ################

class NuPyPropShower(BaseModel):
id: Literal["nupyprop"] = "nupyprop"
id: Literal["nupyprop", "nuleptonsim", "nupyprop_bdhm"] = "nupyprop"
etau_frac: float = 0.5
"""Fraction of ETau in Shower. Default = 0.5."""
table_version: str = "3"
Expand Down Expand Up @@ -316,7 +316,7 @@ def serialize_rad(self, x: float) -> str:
""" Maximum Azimuthal Angle (Radians). """
angle_from_limb: float = np.radians(7)
""" Angle From Limb. Default (Radians). """
cherenkov_light_engine: Literal["Default"] = "Default" # "CHASM", "EASCherSim"
cherenkov_light_engine: Literal["Default"] = "Default" # , "CHASM" , "EASCherSim"
ionosphere: Optional[Ionosphere] = Ionosphere()
tau_shower: NuPyPropShower = NuPyPropShower()
""" Tau Shower Generator. """
Expand Down
4 changes: 2 additions & 2 deletions src/nuspacesim/simulation/taus/taus.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ def __init__(self, config: NssConfig):

# grid of pexit table
with as_file(
files("nuspacesim.data.nupyprop_tables")
files(f"nuspacesim.data.{config.simulation.tau_shower.id}_tables")
/ f"nu2tau_pexit.{config.simulation.tau_shower.table_version}.h5"
) as file:
self.pexit_grid = NssGrid.read(file, path="/", format="hdf5")

# grid of tau_cdf tables
with as_file(
files("nuspacesim.data.nupyprop_tables")
files(f"nuspacesim.data.{config.simulation.tau_shower.id}_tables")
/ f"nu2tau_cdf.{config.simulation.tau_shower.table_version}.h5"
) as file:
self.tau_cdf_grid = NssGrid.read(file, format="hdf5")
Expand Down

0 comments on commit 4809515

Please sign in to comment.