Skip to content
Open
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: 5 additions & 15 deletions .github/workflows/process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
- name: Install PROCESS
# Editable install to match default install
run: |
pip install -e '.[test, examples]'
pip install -r requirements_dev.txt
pip install -e '.[test]'
- name: Run unit tests
run: |
pytest --cov=process tests/unit -v \
Expand All @@ -45,7 +44,6 @@ jobs:
# Editable install to match default install
run: |
pip install -e '.[test]'
pip install -r requirements_dev.txt
- name: Install poppler
run: |
sudo apt update
Expand All @@ -64,7 +62,6 @@ jobs:
# Editable install to match default install
run: |
pip install -e '.[test, examples]'
pip install -r requirements_dev.txt
- name: Install poppler
run: |
sudo apt update
Expand Down Expand Up @@ -92,7 +89,6 @@ jobs:
# Editable install to match default install
run: |
pip install -e '.[test]'
pip install -r requirements_dev.txt
- name: Allow git commands to be run
run: git config --global --add safe.directory '*'
- name: Run regression tests
Expand All @@ -107,9 +103,7 @@ jobs:
with:
python-version: '3.10'
- name: Install PROCESS
run: pip install -e .
- name: Install dev dependencies
run: pip install -r requirements_dev.txt
run: pip install -e '.[lint, docs, test]'
- name: Run regression input files
run: python tracking/run_tracking_inputs.py run tests/regression/input_files
- name: Move other files
Expand All @@ -133,7 +127,7 @@ jobs:
with:
python-version: '3.10'
- name: Install dev dependencies
run: pip install -r requirements_dev.txt
run: pip install '.[lint]'
- name: Run pre-commit
run: pre-commit run --all-files

Expand All @@ -152,9 +146,7 @@ jobs:
with:
python-version: '3.10'
- name: Install PROCESS
run: pip install -e .
- name: Install dev dependencies
run: pip install -r requirements_dev.txt
run: pip install -e '.[test, docs, lint]'
- name: Setup SSH identity
uses: webfactory/[email protected]
with:
Expand Down Expand Up @@ -205,9 +197,7 @@ jobs:
with:
python-version: '3.10'
- name: Install PROCESS
run: pip install -e .
- name: Install dev dependencies
run: pip install -r requirements_dev.txt
run: pip install -e '.[test, lint, docs]'
- run: python scripts/vardes.py
- run: git config --global --add safe.directory '*'
- name: Download STF_TF.json files
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ env-fork
!tests/integration/data/large_tokamak_SIG_TF.json
*.html
!documentation/**/*.html
process/_version.py
2 changes: 1 addition & 1 deletion documentation/development/pre-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pre-commit -h
If pre-commit is not installed, then it can be installed by running:

```bash
pip install -r requirements_dev.txt
pip install '.[lint]'
```

in your environment, which will install all development dependencies including pre-commit.
Expand Down
2 changes: 1 addition & 1 deletion documentation/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ For a guide on contributing code to PROCESS, see `CONTRIBUTING.md`.
Running the entire test suite can be time consuming, as by default it runs on a single core.
`pytest-xdist` allows `pytest` tests to be distributed across multiple cores to speed up testing.

`pytest-xdist` should be installed already (included in `requirements.txt`), but if not it can be installed manually with:
`pytest-xdist` should be installed already (included in `test` extras; `pip install ".[test]"`), but if not it can be installed manually with:

```bash
pip install pytest-xdist
Expand Down
2 changes: 1 addition & 1 deletion process/data_structure/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from . import (
from process.data_structure import (
blanket_library,
build_variables,
buildings_variables,
Expand Down
220 changes: 220 additions & 0 deletions pyproject.toml
Copy link
Collaborator

@timothy-nunn timothy-nunn Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some new issues should be created from this:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I recommend https://github.com/Fusion-Power-Plant-Framework/fppf-actions or modifications to it to unite our CI

Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"
fallback-version = "0.0.0"

[tool.hatch.build.hooks.vcs]
version-file = "process/_version.py"

[project]
name = "process"
authors = [{ name = "UKAEA" }]
description = "Power Reactor Optimisation Code for Environmental and Safety Studies"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
dynamic = ["version"]
dependencies = [
"numpy>=1.23",
"scipy>=1.10",
"cvxpy~=1.7.3",
"osqp>=1.0",
"pandas>=2.0",
"numba>=0.57",
"PyVMCON>=2.4.0,<2.5.0",
"CoolProp>=6.4",
"matplotlib>=2.1.1",
"seaborn>=0.12.2",
"tabulate",
]
keywords = ['fusion', 'optimisation']
classifiers = [
"Programming Language :: Python",
"Development Status :: 4 - Beta",
"Natural Language :: English",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Physics",
]

[project.urls]
Homepage = "https://www.ukaea.org/service/process/"
Source = "https://github.com/ukaea/process"
Documentation = "https://ukaea.github.io/PROCESS"
Issues = "https://github.com/ukaea/process/issues"

[project.optional-dependencies]
test = [
"pytest>=5.4.1",
"requests>=2.30",
"testbook>=0.4",
"pytest-cov>=3.0.0",
"pytest-xdist>=2.5.0"
]
examples = ["jupyter==1.0.0"]
plotly = ["plotly>=5.15.0,<6"]
docs = [
"mkdocs>=1.1",
"mkdocs-material>=4.6.3",
"mkdocs-git-revision-date-localized-plugin >= 1.2",
"mkdocs-glightbox >= 0.3.4",
"pymdown-extensions>=6.3",
"bokeh>=3.4.0,<4",
"mkdocstrings==0.18.0",
"Jinja2>=3.0",
"mkdocs-jupyter>=0.24",
]
lint = ["pre-commit>=2.16.0", "ruff==0.9.3", "ty"]
all = ["process[test,docs,lint,examples,plotly]"]

[project.scripts]
process = "process.main:main"

[tool.hatch.build.targets.wheel]
artifacts = [
"process/data/lz_non_corona_14_elements/*.dat",
"process/io/*.png"
]

[tool.hatch.envs.default]
features = ["dev", "test", "docs", "lint"]

[tool.hatch.envs.test]
features = ["test"]
[[tool.hatch.envs.test.matrix]]
python = ["3.10", "3.11", "3.12", "3.13"]
[tool.hatch.envs.test.scripts]
tests = "pytest {args:tests}"
tests-cov = "pytest --cov process --cov-report html:htmlcov --cov-report xml {args:tests}"
tests-cov-private = "pytest --private --cov process --cov-report html:htmlcov --cov-report xml {args:tests}"

[tool.hatch.envs.docs]
features = ["docs"]
[tool.hatch.envs.docs.scripts]
build = "mkdocs build"
serve = "mkdocs serve"
deploy = "mkdocs gh-deploy"

[tool.hatch.envs.lint]
detached = true # Don't inherit from default (does not download project dependencies)
dependencies = ["pre-commit", "ruff", "ty"]

[tool.hatch.envs.lint.scripts]
fmt = ["pre-commit run --all-files --hook-stage manual"]

[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
"omit" = ["process/_version.py"]

[tool.pytest.ini_options]
addopts = "--strict-markers -r fEX"

[tool.ty.terminal]
output-format = "concise"

[tool.ruff]
target-version = "py310"
line-length = 88
output-format = "concise"
extend-exclude = ["env", ".env"]

[tool.ruff.format]
preview = true

[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**" = ["ARG"]

[tool.ruff.lint.isort]
known-first-party = ["process"]

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.flake8-copyright]
notice-rgx = "(?i)# SPDX-FileCopyrightText:\\s\\d{4}(-(\\d{4}|present))*"

[tool.ruff.lint.mccabe]
max-complexity = 12

[tool.ruff.lint.pylint]
# These should be made stricter
max-args = 17
max-locals = 17

[tool.ruff.lint]
preview = false
extend-select = [
"A",
"ARG",
"ASYNC",
"B",
"BLE",
"C4",
"COM",
"DTZ",
"EXE",
"F",
"FA",
"FLY",
"FURB",
"G",
"I",
"ICN",
"INT",
"ISC",
"LOG",
"N",
"NPY",
"PD",
"PERF",
"PGH",
"PIE",
"PYI",
"Q",
"RET",
"RSE",
"RUF",
"SIM",
"SLF",
"SLOT",
"T10",
"TID",
"UP",
"W",
"YTT",
]
ignore = ["COM812", "FBT", "G004", "PD901"]

[tool.ruff.lint.pep8-naming]
ignore-names = [
"*PROCESS*",
"*Bt*",
"*Bp*",
"*keV*",
"*MPa*",
"*H*",
"*T*",
"*D*",
"*He*",
"*Be*",
"C",
"N",
"O",
"Ne",
"Si",
"Ar",
"Fe",
"Ni",
"Kr",
"Xe",
"W",
]
15 changes: 0 additions & 15 deletions requirements_dev.txt

This file was deleted.

Loading
Loading