Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release to main #51

Merged
merged 15 commits into from
Nov 4, 2024
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
20 changes: 12 additions & 8 deletions .github/workflows/BuildDeployDoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and Deploy Documentation
on:
push:
branches:
- master
- main
- dev
tags: "*"
pull_request:
Expand All @@ -18,15 +18,19 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: "1.10"
- name: Add custom registry
version: '1.10'
- name: clone integration test tools
run: |
julia --project=docs/ -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/QEDjl-project/registry.git"));'
julia --project=docs/ -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/JuliaRegistries/General"));'
- name: Install dependencies
git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /tmp/integration_test_tools/
- name: set dev dependencies
run: |
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
$(julia --project=. /tmp/integration_test_tools/.ci/integTestGen/src/get_project_name_version_path.jl)
echo "CI_DEV_PKG_NAME -> $CI_DEV_PKG_NAME"
echo "CI_DEV_PKG_VERSION -> $CI_DEV_PKG_VERSION"
echo "CI_DEV_PKG_PATH -> $CI_DEV_PKG_PATH"
julia --project=docs/ /tmp/integration_test_tools/.ci/SetupDevEnv/src/SetupDevEnv.jl
julia --project=docs/ -e 'import Pkg; Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia --project=docs/ docs/make.jl
9 changes: 1 addition & 8 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
pull-requests: write
jobs:
CompatHelper:
if: github.repository == 'QEDjl-project/QEDfields.jl'
if: github.repository == 'QEDjl-project/QEDevents.jl'
runs-on: ubuntu-latest
steps:
- name: Check if Julia is already available in the PATH
Expand All @@ -27,12 +27,6 @@ jobs:
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Add QED custom registry"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/QEDjl-project/registry.git"))
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
Expand All @@ -48,5 +42,4 @@ jobs:
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
31 changes: 31 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: "3"
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.TAGBOT_PRIV }}
2 changes: 1 addition & 1 deletion .github/workflows/formatter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: install Julia
uses: julia-actions/setup-julia@v1
with:
version: 1.10
version: "1.10"
- name: Install Julia requirements
run: julia --project=${GITHUB_WORKSPACE}/.formatting -e 'import Pkg; Pkg.instantiate()'
- name: Check code style
Expand Down
46 changes: 24 additions & 22 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ stages:
- run_integration_test
- verify-unit-test-deps

.untit_test_template:
.unit_test_template:
stage: unit-test
script:
- apt update && apt install -y git
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QED.jl.git /QEDjl
- julia --project=. -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/QEDjl-project/registry.git"));'
- julia --project=. -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/JuliaRegistries/General"));'
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /tmp/integration_test_tools/
- $(julia --project=. /tmp/integration_test_tools/.ci/integTestGen/src/get_project_name_version_path.jl)
- echo "CI_DEV_PKG_NAME -> $CI_DEV_PKG_NAME"
- echo "CI_DEV_PKG_VERSION -> $CI_DEV_PKG_VERSION"
- echo "CI_DEV_PKG_PATH -> $CI_DEV_PKG_PATH"
- >
if [[ $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_REF_NAME == "dev" ]]; then
# set name of the commit message from CI_COMMIT_MESSAGE to NO_MESSAGE, that the script does not read accidentally custom packages from the commit message of a merge commit
julia --project=. /QEDjl/.ci/SetupDevEnv/src/SetupDevEnv.jl ${CI_PROJECT_DIR}/Project.toml NO_MESSAGE
julia --project=. /tmp/integration_test_tools/.ci/SetupDevEnv/src/SetupDevEnv.jl ${CI_PROJECT_DIR}/Project.toml NO_MESSAGE
else
julia --project=. /QEDjl/.ci/SetupDevEnv/src/SetupDevEnv.jl ${CI_PROJECT_DIR}/Project.toml
julia --project=. /tmp/integration_test_tools/.ci/SetupDevEnv/src/SetupDevEnv.jl ${CI_PROJECT_DIR}/Project.toml
fi
- julia --project=. -e 'import Pkg; Pkg.instantiate()'
- julia --project=. -e 'import Pkg; Pkg.test(; coverage = true)'
Expand All @@ -25,57 +27,57 @@ stages:
- cpuonly

unit_tests_releases:
extends: .untit_test_template
extends: .unit_test_template
parallel:
matrix:
- JULIA_VERSION: ["1.6", "1.7", "1.8", "1.9", "1.10", "rc"]
- JULIA_VERSION: ["1.10", "1.11", "rc"]
image: julia:$JULIA_VERSION

unit_tests_nightly:
extends: .untit_test_template
extends: .unit_test_template
# use the same baseimage like the official julia images
image: debian:bookworm-slim
variables:
# path where julia tar bal should be downloaded
JULIA_DONWLOAD: /julia/download
JULIA_DOWNLOAD: /julia/download
# path where julia should be extracted
JULIA_EXTRACT: /julia/extract
before_script:
- apt update && apt install -y wget
- mkdir -p $JULIA_DONWLOAD
- mkdir -p $JULIA_DOWNLOAD
- mkdir -p $JULIA_EXTRACT
- >
if [[ $CI_RUNNER_EXECUTABLE_ARCH == "linux/arm64" ]]; then
wget https://julialangnightlies-s3.julialang.org/bin/linux/aarch64/julia-latest-linux-aarch64.tar.gz -O $JULIA_DONWLOAD/julia-nightly.tar.gz
wget https://julialangnightlies-s3.julialang.org/bin/linux/aarch64/julia-latest-linux-aarch64.tar.gz -O $JULIA_DOWNLOAD/julia-nightly.tar.gz
elif [[ $CI_RUNNER_EXECUTABLE_ARCH == "linux/amd64" ]]; then
wget https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-latest-linux-x86_64.tar.gz -O $JULIA_DONWLOAD/julia-nightly.tar.gz
wget https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-latest-linux-x86_64.tar.gz -O $JULIA_DOWNLOAD/julia-nightly.tar.gz
else
echo "unknown runner architecture -> $CI_RUNNER_EXECUTABLE_ARCH"
exit 1
fi
- tar -xf $JULIA_DONWLOAD/julia-nightly.tar.gz -C $JULIA_EXTRACT
- tar -xf $JULIA_DOWNLOAD/julia-nightly.tar.gz -C $JULIA_EXTRACT
# we need to search for the julia base folder name, because the second part of the name is the git commit hash
# e.g. julia-b0c6781676f
- JULIA_EXTRACT_FOLDER=${JULIA_EXTRACT}/$(ls $JULIA_EXTRACT | grep -m1 julia)
# copy everything to /usr to make julia public available
# mv is not possible, because it cannot merge folder
- cp -r $JULIA_EXTRACT_FOLDER/* /usr
allow_failure: true
tags:
- cpuonly

generate_integration_tests:
image: julia:1.10
stage: generate_integration_test
script:
# extract package name
- export CI_DEPENDENCY_NAME=$(cat $CI_PROJECT_DIR/Project.toml | grep name | awk '{ print $3 }' | tr -d '"')
- echo "CI_DEPENDENCY_NAME -> $CI_DEPENDENCY_NAME"
- apt update && apt install -y git
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QED.jl.git /QEDjl
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /QEDjl
- $(julia --project /QEDjl/.ci/integTestGen/src/get_project_name_version_path.jl)
- echo "CI_DEV_PKG_NAME -> $CI_DEV_PKG_NAME"
- echo "CI_DEV_PKG_VERSION -> $CI_DEV_PKG_VERSION"
- echo "CI_DEV_PKG_PATH -> $CI_DEV_PKG_PATH"
- cd /QEDjl/.ci/integTestGen/
# use local registry of the QED project
- julia --project=. -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/QEDjl-project/registry.git"));'
# needs to add General registry again, if local registry was added
- julia --project=. -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/JuliaRegistries/General"));'
- julia --project=. -e 'import Pkg; Pkg.instantiate()'
# paths of artifacts are relative to CI_PROJECT_DIR
- >
Expand Down Expand Up @@ -107,7 +109,7 @@ verify-unit-test-deps_julia1.10:
stage: verify-unit-test-deps
script:
- apt update && apt install -y git
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QED.jl.git /QEDjl
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /QEDjl
- >
if [[ $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_REF_NAME == "dev" ]]; then
# does not check for custom package URLs on the main and dev branch
Expand Down
21 changes: 15 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
name = "QEDevents"
uuid = "fc3ce04a-5be5-4f3a-acff-eceaab723759"
authors = ["Uwe Hernandez Acosta <[email protected]>", "Simeon Ehrig", "Klaus Steiniger", "Tom Jungnickel", "Anton Reinhard"]
version = "0.1.0"
authors = [
"Uwe Hernandez Acosta <[email protected]>",
"Simeon Ehrig",
"Klaus Steiniger",
"Tom Jungnickel",
"Anton Reinhard",
]
version = "0.2.0"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
QEDbase = "10e22c08-3ccb-4172-bfcf-7d7aa3d04d93"
QEDcore = "35dc0263-cb5f-4c33-a114-1d7f54ab753e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
Distributions = "0.25"
DocStringExtensions = "0.9"
QEDbase = "0.2.2"
QEDcore = "0.1"
julia = "1.6"
QEDbase = "0.3"
QEDcore = "0.2"
StatsBase = "0.34"
julia = "1.10"

[extras]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
AntonReinhard marked this conversation as resolved.
Show resolved Hide resolved
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Random", "SafeTestsets", "Test"]
test = ["LinearAlgebra", "Random", "SafeTestsets", "Test"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# QEDevents

[![Doc Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://qedjl-project.github.io/QEDevents.jl/main)
[![Doc Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://qedjl-project.github.io/QEDevents.jl/stable)
[![Doc Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://qedjl-project.github.io/QEDevents.jl/dev)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)

Expand Down
10 changes: 9 additions & 1 deletion src/QEDevents.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
module QEDevents

export ParticleSampleable, weight
export ParticleSampleable, weight, max_weight

export SingleParticleDistribution
export MultiParticleDistribution
export ScatteringProcessDistribution

# single particle distributions
export MaxwellBoltzmannParticle, temperature

import Random: AbstractRNG
import Distributions: rand, rand!, _rand!
using Distributions: Distributions
Expand All @@ -15,11 +18,16 @@ using QEDcore

using DocStringExtensions

# patch Distributions.jl
include("patch_Distributions.jl")
export MaxwellBoltzmann

include("utils.jl")

include("interfaces/particle_distribution.jl")
include("interfaces/single_particle_distribution.jl")
include("interfaces/multi_particle_distribution.jl")
include("interfaces/process_distribution.jl")

include("sampler/single_particle_dists/maxwell_boltzmann.jl")
end
Loading
Loading