Skip to content

Commit

Permalink
Merge branch 'CRPropa:master' into new_bremsstrahlung
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienDoerner authored Jul 31, 2024
2 parents eb8c338 + beee8ad commit 81fc529
Show file tree
Hide file tree
Showing 46 changed files with 1,548 additions and 197 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/create_coverage_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: create-coverage-report
on: [workflow_dispatch]

jobs:
create-coverage-report:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
config:
- name: "ubuntu-22"
os: ubuntu-22.04
cxx: "g++-11"
cc: "gcc-11"
fc: "gfortran-11"
swig_builtin: "On" #uses swig 4.0.2
py: "/usr/bin/python3" #python 3.10
# define steps to take
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prerequirements
run: |
sudo apt-get update
sudo apt-get install libmuparser-dev libhdf5-serial-dev libomp5 libomp-dev libfftw3-dev libcfitsio-dev lcov doxygen graphviz
sudo apt-get install pandoc # do not only use pip to install pandoc, see https://stackoverflow.com/questions/62398231/building-docs-fails-due-to-missing-pandoc
pip install -r doc/pages/example_notebooks/requirements.txt # load requirements for notebooks
pip install sphinx==7.2.6 sphinx_rtd_theme m2r2 nbsphinx lxml_html_clean breathe pandoc exhale # load requirements for documentation
- name: Set up the build
env:
CXX: ${{ matrix.config.cxx }}
CC: ${{ matrix.config.cc }}
FC: ${{ matrix.config.fc }}
run: |
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local -DENABLE_PYTHON=True -DPython_EXECUTABLE=${{ matrix.config.py }} -DENABLE_TESTING=On -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=native -DPython_INSTALL_PACKAGE_DIR=/home/runner/.local/ -DBUILD_DOC=OFF -DENABLE_COVERAGE=On
- name: Build CRPropa
run: |
cd build
make -j
- name: run test
run: |
cd build
make test
continue-on-error: true
- name: coverage report
run: |
cd build
make coverage
tar -zcvf coverage.tar.gz coverageReport
- name: archive documentation
uses: actions/upload-artifact@v4
with:
name: "coverage"
path: |
build/coverage.tar.gz
33 changes: 13 additions & 20 deletions .github/workflows/create_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,25 @@ jobs:
fail-fast: false
matrix:
config:
- name: "ubuntu-20"
os: ubuntu-20.04
cxx: "g++-9"
cc: "gcc-9"
fc: "gfortran-9"
swig_builtin: "Off" #uses swig 4.0.1
- name: "ubuntu-22"
os: ubuntu-22.04
cxx: "g++-11"
cc: "gcc-11"
fc: "gfortran-11"
swig_builtin: "On" #uses swig 4.0.2
py: "/usr/bin/python3" #python 3.10

# define steps to take
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Python install
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
uses: actions/checkout@v4
- name: Prerequirements
run: |
sudo apt-get update
sudo apt-get install libmuparser-dev libhdf5-serial-dev libomp5 libomp-dev libfftw3-dev libcfitsio-dev lcov doxygen graphviz
sudo apt-get install pandoc # do not only use pip to install pandoc, see https://stackoverflow.com/questions/62398231/building-docs-fails-due-to-missing-pandoc
pip install -r doc/pages/example_notebooks/requirements.txt # load requirements for notebooks
pip install sphinx sphinx_rtd_theme m2r2 nbsphinx breathe pandoc exhale # load requirements for documentation
pip install sphinx==7.2.6 sphinx_rtd_theme m2r2 nbsphinx lxml_html_clean breathe pandoc exhale # load requirements for documentation
- name: Set up the build
env:
CXX: ${{ matrix.config.cxx }}
Expand All @@ -40,9 +36,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local \
-DENABLE_PYTHON=True -DENABLE_TESTING=ON -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} \
-DSIMD_EXTENSIONS=native -DBUILD_DOC=True -DENABLE_COVERAGE=True
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local -DENABLE_PYTHON=True -DPython_EXECUTABLE=${{ matrix.config.py }} -DENABLE_TESTING=On -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=native -DPython_INSTALL_PACKAGE_DIR=/home/runner/.local/ -DBUILD_DOC=On -DENABLE_COVERAGE=On
- name: Build CRPropa
run: |
cd build
Expand All @@ -56,16 +50,15 @@ jobs:
run: |
cd build
make coverage
tar -zcvf coverage.tar.gz coverageReport
- name: build documentation
run: |
cd build
make doc
tar -zcvf documentation.tar.gz doc
cp -r coverageReport doc/pages/coverageReport
tar -zcvf documentation.tar.gz doc
- name: archive documentation
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "documentation"
path: |
build/documentation.tar.gz
build/coverage.tar.gz
69 changes: 69 additions & 0 deletions .github/workflows/deploy_new_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: deploy-documentation
on:
push:
branches:
- main
- 'releases/**'

jobs:
build-and-deploy:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
config:
- name: "ubuntu-22"
os: ubuntu-22.04
cxx: "g++-11"
cc: "gcc-11"
fc: "gfortran-11"
swig_builtin: "On" #uses swig 4.0.2
py: "/usr/bin/python3" #python 3.10

# define steps to take
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prerequirements
run: |
sudo apt-get update
sudo apt-get install libmuparser-dev libhdf5-serial-dev libomp5 libomp-dev libfftw3-dev libcfitsio-dev lcov doxygen graphviz
sudo apt-get install pandoc # do not only use pip to install pandoc, see https://stackoverflow.com/questions/62398231/building-docs-fails-due-to-missing-pandoc
pip install -r doc/pages/example_notebooks/requirements.txt # load requirements for notebooks
pip install sphinx==7.2.6 sphinx_rtd_theme m2r2 nbsphinx lxml_html_clean breathe pandoc exhale # load requirements for documentation
- name: Set up the build
env:
CXX: ${{ matrix.config.cxx }}
CC: ${{ matrix.config.cc }}
FC: ${{ matrix.config.fc }}
run: |
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local -DENABLE_PYTHON=True -DPython_EXECUTABLE=${{ matrix.config.py }} -DENABLE_TESTING=On -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=native -DPython_INSTALL_PACKAGE_DIR=/home/runner/.local/ -DBUILD_DOC=On -DENABLE_COVERAGE=On
- name: Build CRPropa
run: |
cd build
make -j
- name: run test
run: |
cd build
make test
continue-on-error: true
- name: coverage report
run: |
cd build
make coverage
- name: build documentation
run: |
cd build
make doc
- name: move final documentation # to avoid conflict with .gitignore
run: |
mv build/doc ~/final_doc
cp -r build/coverageReport ~/final_doc/pages/coverageReport
- name: deploy documentation #deploys the documentation to the gh-pages branch
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ~/final_doc

5 changes: 2 additions & 3 deletions .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ jobs:
py: "/usr/bin/python3" #python 3.10
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Preinstall
run: |
sudo apt-get update
sudo apt-get install libmuparser-dev python3 python3-dev python3-numpy python3-setuptools python-setuptools libhdf5-serial-dev libomp5 libomp-dev libfftw3-dev libcfitsio-dev lcov
sudo apt-get install libmuparser-dev python3 python3-dev python3-setuptools python-setuptools libhdf5-serial-dev libomp5 libomp-dev libfftw3-dev libcfitsio-dev lcov
pip3 install -r doc/pages/example_notebooks/requirements.txt # load requrements for notebooks
pip3 install --upgrade Pygments
pip3 install --upgrade numpy
- name: Set up the build
env:
CXX: ${{ matrix.config.cxx }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing_OSX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
py: "/usr/bin/python3"
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Preinstall
run: |
brew install hdf5 fftw cfitsio muparser libomp numpy swig
Expand All @@ -42,7 +42,7 @@ jobs:
make test
- name: Archive test results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "test-report_${{matrix.config.name}}"
path: build/Testing/Temporary/LastTest.log
4 changes: 2 additions & 2 deletions .github/workflows/testing_ubuntu20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
py: "/usr/bin/python3" #python 3.8
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Preinstall
run: |
sudo apt-get update
Expand All @@ -41,7 +41,7 @@ jobs:
make test
- name: Archive test results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "test-report_${{matrix.config.name}}"
path: build/Testing/Temporary/LastTest.log
4 changes: 2 additions & 2 deletions .github/workflows/testing_ubuntu22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
py: "/usr/bin/python3" #python 3.10
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Preinstall
run: |
sudo apt-get update
Expand All @@ -41,7 +41,7 @@ jobs:
make test
- name: Archive test results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "test-report_${{matrix.config.name}}"
path: build/Testing/Temporary/LastTest.log
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ lib/
share/
doc/api/

!final_doc/ # needed for deployment of the documentation

cmake/CMakeCache.txt
cmake/CMakeFiles/

Expand Down
27 changes: 16 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
## CRPropa vNext

### Bug fixes:
* Fixed sign for exponential decay of magn. field strength with Galactic height in LogarithmicSpiralField
* Fixed sign for exponential decay of magn. field strength with Galactic height in LogarithmicSpiralField
* Fixed r term in source distribution for SNR and Pulsar
* Fixed wrong mass inheritance for secondaries other than nuclei or electron/positron

### New features:
* Added new backwards-compatible function particleMass that returns particle mass also for non-nuclei
* Added the new Galactic magnetic field models from Unger&Farrar arXiv:2311.12120
* Added EBL model from Finke et al. 2022

### Interface changes:

### Features that are deprecated and will be removed after this release

### Removed features
### Removed features
* AMRMagneticField - underlying library (saga) is no longer supported.
* ObserverPoint: Use Observer1D instead.

Expand Down Expand Up @@ -38,8 +43,8 @@
* ObserverPoint will be renamed into Observer1D.
* AMRMagneticField - underlying library (saga) is no longer supported.

### Removed features
* External extensions DINT and Eleca, which can be replaced with the
### Removed features
* External extensions DINT and Eleca, which can be replaced with the
EM*-modules combined with the thinning option for reasonable computation
times.

Expand All @@ -48,20 +53,20 @@
* grplinst
* monopole
* ROOTOutputPlugin


## CRPropa 3.2

### Bug fixes:
* Fix of reflective boundary condition for scalar- and vectorgrids
that showed asymmetry and discontinuities (See issue [#361]).
* Fix in EMTripletPairProduction
* Fix of the data files of the Hackstein EGMF models as well as the
* Fix of the data files of the Hackstein EGMF models as well as the
corresponding example notebook.
* Fix of axis normalization of getRotated in Vector3.h.
* Fix of secondary spectra in electromagnetic interactions
(EM*-modules), issue [#334] and pull request [#15] in crpropa-data.
* Fix weight inheritance for secondary particles; they are created with
* Fix weight inheritance for secondary particles; they are created with
their parents weights as intial weights now.

### New features:
Expand All @@ -71,15 +76,15 @@
and vectorgrids.
* Add the new PolarizedSingleModeMagneticField class for polarized/
helical single mode magnetic field models.
* Add a source feature for targeted emission, following the
* Add a source feature for targeted emission, following the
von-Mises-Fisher distribution
* Updates in SNR and pulsar source distributions
* Updates in SNR and pulsar source distributions

### Interface changes:
* Plane wave and grid turbulence models use same parameter convention now
* Plane wave and grid turbulence models use same parameter convention now

### Features that are deprecated and will be removed after this release
* External extensions DINT and Eleca, which can be replaced with the
* External extensions DINT and Eleca, which can be replaced with the
EM*-modules combined with the thinning option for reasonable computation
times.

Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ endif(APPLE)
# Download data files (interaction data, masses, decay data ...)
# ----------------------------------------------------------------------------
OPTION(DOWNLOAD_DATA "Download CRPropa data files" ON)
set(CRPROPA_DATAFILE_VER "2023-10-20")
set(CRPROPA_DATAFILE_VER "2024-04-30")
if(DOWNLOAD_DATA)
message("-- Downloading data files from sciebo ~ 73 MB")
file(DOWNLOAD
https://ruhr-uni-bochum.sciebo.de/public.php/webdav/data-${CRPROPA_DATAFILE_VER}.tar.gz-CHECKSUM
${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz-CHECKSUM
${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz-CHECKSUM
USERPWD "3juW9sntQX2IWBS")
file(STRINGS ${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz-CHECKSUM DATA_CHECKSUM LIMIT_COUNT 1 LENGTH_MINIMUM 32 LENGTH_MAXIMUM 32)
file(DOWNLOAD
Expand Down Expand Up @@ -402,6 +402,7 @@ add_library(crpropa SHARED
src/magneticField/turbulentField/PlaneWaveTurbulence.cpp
src/magneticField/turbulentField/SimpleGridTurbulence.cpp
src/magneticField/TF17Field.cpp
src/magneticField/UF23Field.cpp
src/magneticField/CMZField.cpp
src/advectionField/AdvectionField.cpp
src/massDistribution/ConstantDensity.cpp
Expand Down Expand Up @@ -466,7 +467,7 @@ if(ENABLE_PYTHON AND Python_FOUND)
endif(Python_Development_FOUND)


# use Python_INSTALL_PACKAGE_DIR if provided; otherwise, install in Python_SITELIB
# use Python_INSTALL_PACKAGE_DIR if provided; otherwise, install in Python_SITELIB
set(Python_INSTALL_PACKAGE_DIR "${Python_SITELIB}" CACHE PATH "folder in which the python package is installed")
message(STATUS " package install directory: ${Python_INSTALL_PACKAGE_DIR}")

Expand Down
Loading

0 comments on commit 81fc529

Please sign in to comment.