Skip to content

Commit dc1e694

Browse files
Initial commit
0 parents  commit dc1e694

37 files changed

+2247
-0
lines changed

.JuliaFormatter.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# See https://domluna.github.io/JuliaFormatter.jl/stable/ for a list of options
2+
style = "blue"

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/workflows/CI.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
- 'releases/**'
9+
tags: '*'
10+
pull_request:
11+
release:
12+
workflow_dispatch:
13+
14+
concurrency:
15+
# Skip intermediate builds: always.
16+
# Cancel intermediate builds: only if it is a pull request build.
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
19+
20+
jobs:
21+
test:
22+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
23+
runs-on: ${{ matrix.os }}
24+
continue-on-error: ${{ matrix.version == 'nightly' }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
version:
29+
- '1.10'
30+
- '1'
31+
- 'pre'
32+
os:
33+
- ubuntu-latest
34+
arch:
35+
- x64
36+
include:
37+
- version: 1
38+
os: ubuntu-latest
39+
arch: x86
40+
- version: 1
41+
os: macOS-latest
42+
arch: arm64
43+
- version: 1
44+
os: windows-latest
45+
arch: x64
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: julia-actions/setup-julia@v2
49+
with:
50+
version: ${{ matrix.version }}
51+
arch: ${{ matrix.arch }}
52+
- uses: julia-actions/cache@v2
53+
- uses: julia-actions/julia-buildpkg@v1
54+
- uses: julia-actions/julia-runtest@v1
55+
with:
56+
coverage: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' }}
57+
- uses: julia-actions/julia-processcoverage@v1
58+
if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64'
59+
- uses: codecov/codecov-action@v5
60+
if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64'
61+
with:
62+
fail_ci_if_error: true
63+
token: ${{ secrets.CODECOV_TOKEN }}
64+
files: lcov.info
65+
docs:
66+
name: Documentation
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
- uses: julia-actions/setup-julia@v2
71+
with:
72+
version: '1'
73+
- uses: julia-actions/cache@v2
74+
- uses: julia-actions/julia-buildpkg@v1
75+
- uses: julia-actions/julia-docdeploy@v1
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
# Needed due to https://github.com/JuliaDocs/Documenter.jl/issues/1177
79+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
80+
GKSwstype: 'nul'

.github/workflows/CompatHelper.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
CompatHelper:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v2
19+
with:
20+
version: '1'
21+
arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
29+
- name: "Install CompatHelper"
30+
run: |
31+
import Pkg
32+
name = "CompatHelper"
33+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
34+
version = "3"
35+
Pkg.add(; name, uuid, version)
36+
shell: julia --color=yes {0}
37+
- name: "Run CompatHelper"
38+
run: |
39+
import CompatHelper
40+
CompatHelper.main()
41+
shell: julia --color=yes {0}
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
45+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Doc Preview Cleanup
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
# Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time
8+
concurrency:
9+
group: doc-preview-cleanup
10+
cancel-in-progress: false
11+
12+
jobs:
13+
doc-preview-cleanup:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
steps:
18+
- name: Checkout gh-pages branch
19+
uses: actions/checkout@v4
20+
with:
21+
ref: gh-pages
22+
- name: Delete preview and history + push changes
23+
run: |
24+
if [ -d "${preview_dir}" ]; then
25+
git config user.name "Documenter.jl"
26+
git config user.email "documenter@juliadocs.github.io"
27+
git rm -rf "${preview_dir}"
28+
git commit -m "delete preview"
29+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
30+
git push --force origin gh-pages-new:gh-pages
31+
fi
32+
env:
33+
preview_dir: previews/PR${{ github.event.number }}

.github/workflows/TagBot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: "3"
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
23+
jobs:
24+
TagBot:
25+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: JuliaRegistries/TagBot@v1
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/Manifest.toml
2+
/docs/Manifest.toml
3+
/docs/build/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Uwe Hernandez Acosta <u.hernandez@hzdr.de>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Project.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name = "HEPExampleProject"
2+
uuid = "f779019a-d216-4ac1-8c1a-8c09799cc4e6"
3+
authors = ["Uwe Hernandez Acosta <u.hernandez@hzdr.de>"]
4+
version = "0.0.1-DEV"
5+
6+
[deps]
7+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
8+
9+
[weakdeps]
10+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
11+
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
12+
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
13+
14+
[extensions]
15+
HEPExampleProjectMakieExt = "Makie"
16+
HEPExampleProjectPlotsExt = ["Plots", "RecipesBase"]
17+
18+
[compat]
19+
Makie = "0.22.9"
20+
Plots = "1"
21+
Random = "1"
22+
RecipesBase = "1"
23+
julia = "1.10"

README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# HEPExampleProject.jl
2+
3+
`HEPExampleProject.jl` is a demonstration package for showcasing how to develop software
4+
in the context of high-energy physics (HEP) using the Julia programming language. This project
5+
serves as a template for researchers, developers, and students interested in adopting Julia
6+
for HEP-specific workflows.
7+
8+
## Key Features
9+
10+
- **HEP-Focused Design**: Structures common to high-energy physics are implemented with a focus on performance and flexibility.
11+
- **Modular Architecture**: Designed to be easily extensible for new use cases and HEP-related calculations.
12+
- **Integration with JuliaHEP**: Part of the [JuliaHEP](https://github.com/JuliaHEP) ecosystem, which aims to facilitate the use of Julia in high-energy physics research and analysis.
13+
14+
## Installation
15+
16+
This package is not registered (and most probably will never be).
17+
18+
To install `HEPExampleProject.jl`, use Julia's built-in package manager. In the Julia REPL, type:
19+
20+
```julia
21+
julia> using Pkg
22+
julia> Pkg.add("https://github.com/JuliaHEP/HEPExampleProject.jl")
23+
```
24+
25+
Alternatively, you can enter the Pkg mode by pressing `]` in the REPL, then type:
26+
27+
```julia
28+
pkg> add https://github.com/JuliaHEP/HEPExampleProject.jl
29+
```
30+
31+
## Usage
32+
33+
Once installed, you can begin using `HEPExampleProject.jl` by importing the package:
34+
35+
```julia
36+
using HEPExampleProject
37+
```
38+
39+
### Example
40+
41+
The following example demonstrates a simple use of the package:
42+
43+
```julia
44+
using HEPExampleProject
45+
using Random
46+
47+
# define random number generator for reproducability
48+
RNG = Xoshiro(137)
49+
50+
# Define some input parameters for the HEP process
51+
incoming_electron_energy = 1000.0
52+
53+
# generate 1M events
54+
event_list = generate_events_cpu(RNG,incoming_electron_energy,1_000_000)
55+
```
56+
57+
If you separately install the package `Plots` (`pkg> add Plots`), you can plot
58+
the generated events:
59+
60+
```Julia
61+
using Plots
62+
plot(event_list)
63+
```
64+
65+
![event_plot](docs/assets/event_plot.png)
66+
67+
You can also plot event lists using via the Makie plotting system, by using
68+
one of the Makie plotting backends (CairoMakie, WGLMakie, etc.):
69+
70+
```Julia
71+
using CairoMakie
72+
plot(event_list)
73+
```
74+
75+
## Contributing
76+
77+
We welcome contributions to improve this project! If you're interested in contributing, please:
78+
79+
1. Fork the repository.
80+
2. Create a new branch for your feature or bug fix.
81+
3. Submit a pull request with a detailed description of your changes.
82+
83+
You can also open an issue if you encounter any problems or have feature suggestions.
84+
85+
## Acknowledgements
86+
87+
This project is part of the JuliaHEP ecosystem, which is developed by a community of scientists
88+
and developers passionate about using Julia for high-energy physics. We are grateful to
89+
all contributors and users who support the growth of this project.
90+
91+
## License
92+
93+
`HEPExampleProject.jl` is licensed under the MIT License.
94+
See the [LICENSE](https://github.com/JuliaHEP/HEPExampleProject.jl/blob/main/LICENSE) file for more details.

0 commit comments

Comments
 (0)