Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into GridProps
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienDoerner committed Apr 23, 2024
2 parents 6c9ff3e + c477436 commit fd86a0a
Show file tree
Hide file tree
Showing 138 changed files with 4,725 additions and 15,277 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/create_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: create-documentation
on: [workflow_dispatch]

jobs:
create-documentation:
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 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
tar -zcvf coverage.tar.gz coverageReport
- name: build documentation
run: |
cd build
make doc
tar -zcvf documentation.tar.gz doc
- name: archive documentation
uses: actions/upload-artifact@v4
with:
name: "documentation"
path: |
build/documentation.tar.gz
build/coverage.tar.gz
77 changes: 77 additions & 0 deletions .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: crpropa-example-test
on: [push, pull_request]

jobs:
linux:
runs-on: ${{ matrix.config.os }}
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
steps:
- name: Checkout repository
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
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 }}
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=Off -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=native -DPython_INSTALL_PACKAGE_DIR=/home/runner/.local/
- name: Build CRPropa
run: |
cd build
make install -j
- name: convert notebooks to python
env:
PYTHONPATH: "/home/runner/.local"
runfolder: "/home/runner/notebook_run"
run: |
mkdir "$runfolder"
cd doc/pages/example_notebooks/
for file in */*.ipynb; do
echo "$file"
if [ -f "$file" ]; then
f=(${file//// })
f=${f[1]}
f=(${f//./})
finalFile="$runfolder"/"$f".py
echo "convert notebook $file to script $finalFile"
jupyter nbconvert --to python "$file" --stdout | grep -v -e "^get_ipython" > "$runfolder"/"$f".py
fi
done
- name: run all python scripts
env:
PYTHONPATH: "/home/runner/.local"
runfolder: "/home/runner/notebook_run"
run: |
cp doc/pages/example_notebooks/galactic_lensing/crpropa_output.txt "$runfolder"/
cd "$runfolder"
for file in *.py; do
if [ "$file" = "custom-photon-fieldipynb.py" ] ||
[ "$file" = "MHD_modelsipynb.py" ] ||
[ "$file" = "density_grid_samplingipynb.py" ] ||
[ "$file" = "lensing_crv4ipynb.py" ] ||
[ "$file" = "lensing_mapsv4ipynb.py" ]; then
echo "skip file $file"
else
echo "run file $file"
python3 $file
fi
done
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ jobs:
fail-fast: false
matrix:
config:
- name: "macos-11"
os: macos-11
- name: "macos-14"
os: macos-14
cxx: "clang++"
cc: "clang"
fc: "gfortran-11"
swig_builtin: "On" #uses swig 4.0.2
py: "/usr/bin/python"
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
brew install hdf5 fftw cfitsio muparser libomp numpy swig
- name: Set up the build
env:
CXX: ${{ matrix.config.cxx }}
Expand All @@ -29,7 +29,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DENABLE_PYTHON=True -DPYTHON_EXECUTABLE=${{ matrix.config.py }} -DENABLE_TESTING=On -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=avx
cmake .. -DENABLE_PYTHON=True -DENABLE_TESTING=On -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS="none"
- name: Build CRPropa
run: |
cd build
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: crpropa-testing
name: crpropa-testing_ubuntu20
on: [push, pull_request]

jobs:
Expand All @@ -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 @@ -30,7 +30,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DENABLE_PYTHON=True -DPYTHON_EXECUTABLE=${{ matrix.config.py }} -DENABLE_TESTING=On -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=native
cmake .. -DENABLE_PYTHON=True -DENABLE_TESTING=On -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=native
- name: Build CRPropa
run: |
cd build
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
6 changes: 3 additions & 3 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 @@ -30,7 +30,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DENABLE_PYTHON=True -DPYTHON_EXECUTABLE=${{ matrix.config.py }} -DENABLE_TESTING=On -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=native
cmake .. -DENABLE_PYTHON=True -DENABLE_TESTING=On -DPython_EXECUTABLE=${{ matrix.config.py }} -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=native
- name: Build CRPropa
run: |
cd build
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
47 changes: 39 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,56 @@
# CRPropa vNext
## CRPropa vNext

### Bug fixes:
* Fixed sign for exponential decay of magn. field strength with Galactic height in LogarithmicSpiralField
* Fixed r term in source distribution for SNR and Pulsar

### New features:

### Interface changes:

### Features that are deprecated and will be removed after this release
* EBL model from Finke et al. 2022

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

### New plugins and resources linked on the webpages


## CRPropa 3.2.1

### Bug fixes:
* Re-added ToroidalHaloField and LogarithmicSpiralField models. Note, that the class name was also corrected in spelling: TorroidalHaloField --> ToroidalHaloField
* Synchronized signature of ParticleSplitting constructor

### New features:
* new candidate property tagOrigin to trace back which source or which interaction created the candidate
* new interace for massdistributions given on a Grid1f
* grids can be restricted to the volume without repetition
* sourceFeature to sample the source position from a given massdistribution
* New candidate property tagOrigin to trace back which source or which interaction created the candidate
* New interface for massdistributions given on a Grid1f
* Grids can be restricted to the volume without repetition (clipVolume parameter)
* SourceFeature to sample the source position from a given massdistribution
* EBL model from Saldana-Lopez et al. 2021
* New module CandidateSplitting for better statistics at high energies for e.g. diffusive shock acceleration
* New advection fields for modeling diffusive shock acceleration at 1D planar, oblique and spherical shocks

### Interface changes:
* Weight column in hdf-Output is now called "W", which is the same as for TextOutput.

### Features that are deprecated and will be removed after this release
* ObserverPoint will be renamed into Observer1D.
* AMRMagenticField - underlying library (saga) is no longer supported.

### New plugins and resources linked on the webpages:
* AMRMagneticField - underlying library (saga) is no longer supported.

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

### New plugins and resources linked on the webpages:
* FieldlineIntegrator
* grplinst
* monopole
* ROOTOutputPlugin


## CRPropa 3.2

Expand Down
12 changes: 12 additions & 0 deletions CITATION.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@ARTICLE{crpropa3.2,
author = {{Alves Batista}, Rafael and {Becker Tjus}, Julia and {D{\"o}rner}, Julien and {Dundovic}, Andrej and {Eichmann}, Bj{\"o}rn and {Frie}, Antonius and {Heiter}, Christopher and {Hoerbe}, Mario R. and {Kampert}, Karl-Heinz and {Merten}, Lukas and {M{\"u}ller}, Gero and {Reichherzer}, Patrick and {Saveliev}, Andrey and {Schlegel}, Leander and {Sigl}, G{\"u}nter and {van Vliet}, Arjen and {Winchen}, Tobias},
title = "{CRPropa 3.2 - an advanced framework for high-energy particle propagation in extragalactic and galactic spaces}",
journal = {Journal of Cosmology and Astroparticle Physics},
year = 2022,
volume = {9},
eid = {035},
pages = {035},
doi = {10.1088/1475-7516/2022/09/035},
eprint = {2208.00107}
}

Loading

0 comments on commit fd86a0a

Please sign in to comment.