Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
58108d4
Fix Bosch–Hale reactivity calculation in alpha_power_beam
grmtrkngtn Apr 7, 2026
6dc56f1
update alpha_power_beam docstring
grmtrkngtn Apr 7, 2026
cbb4576
incorporate changes to beam_fusion calculation in physics.py
grmtrkngtn Apr 7, 2026
62ff5da
Re-work beam_fusion execute routine in a more modular way. Updated do…
grmtrkngtn Apr 8, 2026
9cbf230
updated alpha_power_beam() function with new refactor. updated some d…
grmtrkngtn Apr 8, 2026
91b4c16
update fusion reaction tests to use refactored functions
grmtrkngtn Apr 8, 2026
e85d2a4
fixed inputs to beam_fusion, plasma profile in the wrong place
grmtrkngtn Apr 8, 2026
d67dc6d
removed debugging print
grmtrkngtn Apr 9, 2026
f683a23
removed debugging line
grmtrkngtn Apr 9, 2026
b22a368
Added references to beam_slowing_down_state
grmtrkngtn Apr 9, 2026
616b973
Added back clickable references to beam_fusion
grmtrkngtn Apr 9, 2026
c530e45
updated deuterium beam power variable name
grmtrkngtn Apr 10, 2026
db7ee5c
updated tritium beam power variable name
grmtrkngtn Apr 10, 2026
7154405
beam_reaction_rate docstring to correct otput units
grmtrkngtn Apr 10, 2026
711df66
Updated beam_reaction_rate, moved unit conversion inside function and…
grmtrkngtn Apr 10, 2026
d6b0eb5
renamed sigmav_dt_correction to f_sigmav_dt_profile_correction
grmtrkngtn Apr 10, 2026
089a691
renamed bh_profile_average to sigv_dt_bosch_hale_profile_avg
grmtrkngtn Apr 10, 2026
74f8da1
Renamed beam_slow_time to t_beam_slow
grmtrkngtn Apr 10, 2026
45c1ede
renamed deuterium_density
grmtrkngtn Apr 10, 2026
44c17f1
renamed tritium_density
grmtrkngtn Apr 10, 2026
59d94fb
renamed hot_beam_density to nd_beam_hot
grmtrkngtn Apr 10, 2026
cee64c9
renamed beam_depo_energy to e_beam_deposited_kev
grmtrkngtn Apr 10, 2026
1993de3
renamed alpha_power_beam outputs
grmtrkngtn Apr 10, 2026
3bde93c
update call of beam_fusion
grmtrkngtn Apr 10, 2026
34c3c20
fixed beam fusion call in stellarator
grmtrkngtn Apr 10, 2026
4b7d80e
update beam_reactions doc to reflect changes in beam_fusion and subse…
grmtrkngtn Apr 10, 2026
864b898
Removed indent in docs, fixes rendering
grmtrkngtn Apr 13, 2026
af84ce2
removed copy/paste
grmtrkngtn Apr 13, 2026
7dd4882
Create diamagnetic current class (#4156)
chris-ashe Apr 9, 2026
803fdb9
Update CI regression docs (#4162)
clmould Apr 9, 2026
382dd25
Upgrade CLI to use click (#4105)
je-cook Apr 9, 2026
599f7d1
Use hatch run in CI for plotting summary (#4169)
timothy-nunn Apr 9, 2026
4dbaaed
Add FwBlktVVShape enum (#4167)
chris-ashe Apr 9, 2026
cc50fe0
Convert costs 2015 to new data structure (#4153)
clmould Apr 9, 2026
0e35450
Move plot plasma current into summary.py (#4170)
timothy-nunn Apr 9, 2026
9ba200e
Ensure njit is used in plasma fields (#4172)
chris-ashe Apr 10, 2026
795273e
Remove unused configuration.py file (#4175)
je-cook Apr 10, 2026
15cfe63
Fix stacked plots writing multiple files (#4068)
chris-ashe Apr 10, 2026
64efe68
Add `enum` for profile shape (#4180)
chris-ashe Apr 13, 2026
84af3e4
Upgrade pre-commit versions (#4178)
je-cook Apr 13, 2026
17accde
fixed inputs to beam_fusion, plasma profile in the wrong place
grmtrkngtn Apr 8, 2026
7842ea0
removed print statement, fixed ruff issue
grmtrkngtn Apr 13, 2026
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
16 changes: 11 additions & 5 deletions .github/workflows/process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:
regression-test:
runs-on: ubuntu-latest
needs: [tracking]
# depend on make and tracking job but dont skip if tracking was skipped
# depend on make and tracking job but don't skip if tracking was skipped
# run PROCESS on the regression test input files and compare results to the tracked files
if: always()
continue-on-error: true
strategy:
Expand All @@ -80,6 +81,8 @@ jobs:

run-tracking-inputs:
runs-on: ubuntu-latest
# run PROCESS on the regression test input files and archive output MFILEs
# only runs upon merge to main
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
Expand Down Expand Up @@ -114,10 +117,12 @@ jobs:
run: hatch run lint:fmt

tracking:
# update tracker to include the MFILEs created by the run-tracking-inputs job
concurrency:
group: tracking-jobs
cancel-in-progress: false
runs-on: ubuntu-latest
# depends on run-tracking-inputs; only runs upon merge to main
needs: run-tracking-inputs
if: github.ref == 'refs/heads/main'
env:
Expand Down Expand Up @@ -168,6 +173,7 @@ jobs:
group: docs-jobs
cancel-in-progress: false
runs-on: ubuntu-latest
# depends on tracking; only runs upon merge to main
needs: tracking
if: github.ref == 'refs/heads/main'
steps:
Expand All @@ -190,10 +196,10 @@ jobs:
name: tracked-mfiles
path: tracking/
- run: mv tracking/large_tokamak_nof.SIG_TF.json tracking/large_tokamak_nof_SIG_TF.json
- name: Create an example plot proc
run: hatch run python process/core/io/plot_proc.py -f tracking/large_tokamak_nof_MFILE.DAT
- name: Move plot proc file to docs images
run: mv tracking/large_tokamak_nof_MFILE.DATSUMMARY.pdf documentation/source/images/plot_proc.pdf
- name: Create an example plot summary
run: hatch run process plot summary -f tracking/large_tokamak_nof_MFILE.DAT
- name: Move plot summary file to docs images
run: mv tracking/large_tokamak_nof_MFILE.DATSUMMARY.pdf documentation/source/images/plot_summary.pdf
- run: hatch run docs:build
- name: Download tracking html
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
exclude: ^.*\.DAT$|.*\.dat$|.*\.tex$|.*\.PPF$|.*\.FLD$|.*\.ps$|ref_dicts.json$|.*\.md$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v6.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-merge-conflict

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.3
rev: v0.15.10
hooks:
- id: ruff
args: [--fix]
Expand All @@ -22,14 +22,14 @@ repos:
args: [--mapping, '2', --sequence, '4', --offset, '2']

- repo: https://github.com/biomejs/pre-commit
rev: v2.3.8
rev: v2.4.11
hooks:
- id: biome-format
types: [json]
args: [--indent-style=space, --indent-width=2, --line-width=89]

- repo: https://github.com/kynan/nbstripout
rev: 0.5.0
rev: 0.9.1
hooks:
- id: nbstripout
args: [--extra-keys=metadata.language_info.version]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import plotly.graph_objects as go

import process.models.superconductors as superconductors
from process.models import superconductors

temp_c0max = 90.0 # Critical temperature (K) at zero field and strain
b_c20max = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import plotly.graph_objects as go

import process.models.superconductors as superconductors
from process.models import superconductors

# Create a grid of temperature and field values
temp_conductor = np.linspace(1, 11.0, 50) # Temperature range (K)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import plotly.graph_objects as go

import process.models.superconductors as superconductors
from process.models import superconductors

# Create a grid of temperature and field values
temp_conductor = np.linspace(1, 8.0, 50) # Temperature range (K)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import plotly.graph_objects as go

import process.models.superconductors as superconductors
from process.models import superconductors

# Create a grid of temperature and field values
temp_conductor = np.linspace(4.2, 30.0, 50) # Temperature range (K)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import plotly.graph_objects as go

import process.models.superconductors as superconductors
from process.models import superconductors

temp_c0max = 16.06 # Critical temperature (K) at zero field and strain
b_c20max = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import plotly.graph_objects as go

import process.models.superconductors as superconductors
from process.models import superconductors

# Create a grid of temperature and field values
temp_conductor = np.linspace(4.2, 40.0, 50) # Temperature range (K)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import plotly.graph_objects as go

import process.models.superconductors as superconductors
from process.models import superconductors

# Create a grid of temperature and field values
temp_conductor = np.linspace(1, 10.0, 50) # Temperature range (K)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import plotly.graph_objects as go

import process.models.superconductors as superconductors
from process.models import superconductors

temp_c0max = 16.34 # Critical temperature (K) at zero field and strain
b_c20max = (
Expand Down
11 changes: 8 additions & 3 deletions documentation/source/development/ci-guide.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@

# GitHub Actions

Our GitHub actions Continuous Integration (CI) pipeline serves to ensure each branch and pull request conforms to our testing and style requirements. Due to the requirement of all stages on the built PROCESS artefacts and Docker image, all of our CI can currently be found in one workflow file: `process.yml`. A summary of each job within this workflow can be found below:
Our GitHub actions Continuous Integration (CI) pipeline serves to ensure each branch and pull request conforms to our testing and style requirements. All of our CI can currently be found in one workflow file: `process.yml`. A summary of each job within this workflow can be found below:

| Name | Functionality |
| ---- | ------------- |
| unit-test | Installs PROCESS and runs the unit tests. The job will fail if any of the unit tests fail. |
| integration-test | Installs PROCESS and runs the integration tests. The job will fail if any of the integration tests fail. |
| regression-test | Installs PROCESS and runs the regression tests with a 0% and 5% tolerance, respectively. The job will fail if any of the regression tests fail. |
| regression-test | Installs PROCESS and runs the regression tests with a 0.2% and 5% tolerance, respectively. The job will fail if any of the regression tests fail. The job uses tracked MFILEs for regression test comparisons. |
| run-tracking-inputs | Installs PROCESS and runs the regression test input files, archiving the output MFILEs. Only runs on the **main** branch. |
| tracking | Collects MFILEs for input files of interest and creates a dashboard of changes in key values over time (one datapoint for each commit on main). Only runs on the **main** branch. |
| pre-commit-quality-check | ensures the pushed code meets our standards as defined in `.pre-commit-config.yaml`. |
| docs | Builds and deploys the documentation onto GitHub pages. |
| docs | Builds and deploys the documentation onto GitHub pages. |

!!! Info "Regression Job"
When creating a PR, the tracked MFILEs from the point at which you branched off main will be used during the regression test job. This job may fail on your PR. If so, these changes to the output will need to be reviewed. If the changes are accepted (i.e. they come from a necessary change to a model), upon merge to main the
`run-tracking-inputs` job will run the regression input files to generate the associated MFILEs to be tracked by the
`tracking job`, and these will now reflect the changes your PR has introduced. Therefore when the regression job runs upon merge of your code into main, it will use these updated tracked MFILEs, and the regression tests will pass.
18 changes: 12 additions & 6 deletions documentation/source/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@ filename, then call a method to create a plot file, then check that the plot was

### Regression tests

Regression tests detect changes in the entire program's behaviour by checking that for a given
Regression tests detect changes in the entire program's behaviour by checking that for a given
input, it produces exactly the same output as before those changes. It detects changes in the
program's output. Therefore if your code changes the program's output, it will fail the regression
test. In this case that output difference will need to be reviewed and if accepted, the expected (or
reference) will be updated.
program's output. Therefore, if your code changes the program's output, it will fail the regression
test. In this case, that output difference will need to be reviewed and, if accepted,
the expected (or reference) output will be updated to reflect these changes when your code is merged into main.

Regression tests compare the output of PROCESS locally when running an input file to a reference output stored in a
[repository](https://github.com/timothy-nunn/process-tracking-data). The test suite will download the reference output for the commit where the your current branch branched off of main. This means **each branch is accountable for only its changes since it branched off of main**.
[repository](https://github.com/timothy-nunn/process-tracking-data). The test suite will download the reference output for the commit where the current branch branched off main. This means **each branch is accountable for only its changes since it branched off main**.


!!! Info "CI System"
Our tests are run automatically using the Continous Integration (CI) system on GitHub.
More information about how the jobs run on our CI and update the tracked files can be found [here](https://ukaea.github.io/PROCESS/development/ci-guide/).


## pytest

Expand Down Expand Up @@ -154,7 +160,7 @@ something has changed, in this case by >5%.
### Running the CI on a branch

When those local changes are committed and pushed, the CI system for the branch runs. This runs 5%
and 0% tolerance regression jobs, which are allowed to fail. This shows the author and reviewer
and 0.2% tolerance regression jobs, which are allowed to fail. This shows the author and reviewer
what the changes to the regression results are as a result of the code changes on that branch.

## Drawbacks to this approach
Expand Down
2 changes: 1 addition & 1 deletion documentation/source/eng-models/machine-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


Simplified scale diagrams of the vertical and horizontal cross-sections of the machine can be
output in the summary created by using the utility `plot_proc.py` (currently stored in `process/process/core/io`).
output in the summary created by using the utility `summary.py` (currently stored in `process/process/core/io/plot`).

The coordinate system is $(R,Z)$ system, where $R$ is the radial distance from the vertical
centreline (axis) of the torus, and $Z$ is the vertical distance from the equatorial midplane.
Expand Down
3 changes: 0 additions & 3 deletions documentation/source/io/output-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ most of the same data as `OUT.DAT` but in a different format and has been design
"machine-readable" by some of the [utility programs](utilities.md) for
post-processing and graphical output.

An additional diagnostic output text file `VFILE.DAT` is generated if the `verbose` flag is set
to 1 in the input file.

(If there is already a file with any of the above filenames it will be overwritten.)

Utilities generate additional output files.
4 changes: 2 additions & 2 deletions documentation/source/io/python-lib-guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Library for `IN.DAT` Files

> `process/core/io/in_dat.py`
> `process/core/io/in_dat`

A set of Python classes to read, modify and write an `IN.DAT` file.

Expand Down Expand Up @@ -64,7 +64,7 @@ i.write_in_dat(output_filename="new_IN.DAT")

## Library for `MFILE.DAT` Files

> `process/core/io/mfile.py`
> `process/core/io/mfile`


A set of Python classes to read and extract data from the `MFILE.DAT`.
Expand Down
Loading