Skip to content
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
133 changes: 133 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Configuration for Release Drafter
# https://github.com/release-drafter/release-drafter
#
# Automatically drafts GitHub release notes from merged PRs.
# PRs are categorized by their labels into changelog sections.

name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

# Determine the next version bump from PR labels
version-resolver:
major:
labels:
- 'breaking'
minor:
labels:
- 'enhancement'
- 'feature'
- 'physics'
patch:
labels:
- 'bug'
- 'fix'
- 'performance'
- 'documentation'
- 'devops'
- 'dependencies'
default: patch

# Map PR labels to changelog sections
categories:
- title: '🔬 Physics & Solvers'
labels:
- 'physics'
- 'solver'
- title: '🚀 New Features'
labels:
- 'feature'
- 'enhancement'
- title: '⚡ Performance'
labels:
- 'performance'
- 'gpu'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- 'fix'
- title: '📖 Documentation'
labels:
- 'documentation'
- title: '🔧 DevOps & CI'
labels:
- 'devops'
- 'ci'
- title: '📦 Dependencies'
labels:
- 'dependencies'
- title: '⚠️ Breaking Changes'
labels:
- 'breaking'
- title: '🧹 Maintenance'
labels:
- 'maintenance'
- 'refactor'

# Exclude PRs with these labels from release notes
exclude-labels:
- 'skip-changelog'

# Template for the release body
template: |
## What's Changed

$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

# Auto-label PRs based on file paths
autolabeler:
- label: 'physics'
files:
- 'src/props/**'
title:
- '/tortuosity/i'
- '/diffusiv/i'
- '/solver/i'
- '/HYPRE/i'
- '/MLMG/i'
- label: 'io'
files:
- 'src/io/**'
title:
- '/reader/i'
- '/TIFF/i'
- '/HDF5/i'
- label: 'documentation'
files:
- 'docs/**'
- '*.md'
- 'Doxyfile'
title:
- '/docs/i'
- '/documentation/i'
- label: 'devops'
files:
- '.github/**'
- 'containers/**'
- 'pyproject.toml'
- 'CMakeLists.txt'
title:
- '/CI/i'
- '/workflow/i'
- '/wheel/i'
- '/PyPI/i'
- label: 'gpu'
files:
- 'src/props/*GPU*'
- 'src/props/*CUDA*'
title:
- '/CUDA/i'
- '/GPU/i'
- '/NVCC/i'
- label: 'python'
files:
- 'python/**'
title:
- '/python/i'
- '/pybind/i'
- '/binding/i'
- label: 'tests'
files:
- 'tests/**'
- 'python/tests/**'
24 changes: 19 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# .github/workflows/docs.yml
name: Deploy Doxygen Documentation
name: Deploy Documentation

on:
push:
branches: [master]
paths:
- 'src/**'
- 'python/**'
- 'Doxyfile'
- 'docs/**'
- '.github/workflows/docs.yml'
Expand All @@ -24,7 +25,7 @@ concurrency:

jobs:
build-docs:
name: Build Doxygen Documentation
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -35,15 +36,28 @@ jobs:
sudo apt-get update
sudo apt-get install -y doxygen graphviz
echo "Doxygen version: $(doxygen --version)"
echo "Dot version: $(dot -V 2>&1)"

- name: Generate documentation
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Sphinx and dependencies
run: pip install -r docs/requirements.txt

- name: Generate Doxygen XML and HTML
run: doxygen Doxyfile

- name: Build Sphinx documentation
run: sphinx-build -b html docs/ docs/_build/html

- name: Copy Doxygen HTML into Sphinx output
run: cp -r docs/doxygen/html docs/_build/html/doxygen

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/doxygen/html
path: docs/_build/html

deploy:
name: Deploy to GitHub Pages
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pypi-wheels-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive # Fetches Catch2, nlohmann/json, or pybind11 if needed
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pypi-wheels-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .github/workflows/release-drafter.yml
name: Release Drafter

on:
push:
branches:
- master
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: read
pull-requests: write

jobs:
update-release-draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Apptainer
uses: eWaterCycle/setup-apptainer@v2
Expand Down Expand Up @@ -121,10 +123,14 @@ jobs:
sudo apptainer build "$SIF_FILENAME" Singularity.final.def
echo "SIF_FILENAME=$SIF_FILENAME" >> $GITHUB_ENV

- name: Create GitHub Release and Upload SIF
- name: Upload SIF to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.SIF_FILENAME }}
# Release notes are pre-populated by Release Drafter.
# Only fall back to auto-generated notes if the body is empty
# (e.g. tag was pushed without a prior draft).
generate_release_notes: true
append_body: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 30 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,37 @@

cmake_minimum_required(VERSION 3.18)

# ---------------------------------------------------------------------------
# Derive project version from the latest Git tag (e.g. v4.0.1 → 4.0.1).
# Falls back to 0.0.0 when building outside a Git repository or when no
# tag is reachable (e.g. shallow clone without --tags).
# ---------------------------------------------------------------------------
set(OPENIMPALA_FALLBACK_VERSION "4.0.1")

find_package(Git QUIET)
if(GIT_FOUND)
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --tags --match "v[0-9]*" --abbrev=0
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE _git_tag
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
RESULT_VARIABLE _git_result
)
if(_git_result EQUAL 0 AND _git_tag MATCHES "^v([0-9]+\\.[0-9]+\\.[0-9]+)")
set(_detected_version "${CMAKE_MATCH_1}")
endif()
endif()

if(NOT _detected_version)
set(_detected_version "${OPENIMPALA_FALLBACK_VERSION}")
message(STATUS "Git tag not found — using fallback version ${_detected_version}")
else()
message(STATUS "Version from Git tag: ${_detected_version}")
endif()

project(OpenImpala
VERSION 0.1.0
VERSION ${_detected_version}
LANGUAGES C CXX Fortran
DESCRIPTION "Image-based simulation of transport properties in porous media"
)
Expand Down
3 changes: 2 additions & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ FULL_SIDEBAR = NO
GENERATE_LATEX = NO
GENERATE_RTF = NO
GENERATE_MAN = NO
GENERATE_XML = NO
GENERATE_XML = YES
XML_OUTPUT = xml

#---------------------------------------------------------------------------
# Graphs (requires Graphviz dot)
Expand Down
75 changes: 75 additions & 0 deletions docs/api/cpp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# C++ API Reference

The C++ API reference is generated from Doxygen comments in the source code
using [Breathe](https://breathe.readthedocs.io/).

## Namespace

All OpenImpala classes live in the `OpenImpala` namespace.

## Key classes

### I/O Readers

```{eval-rst}
.. doxygenclass:: OpenImpala::TiffReader
:members:
:outline:

.. doxygenclass:: OpenImpala::HDF5Reader
:members:
:outline:

.. doxygenclass:: OpenImpala::RawReader
:members:
:outline:
```

### Transport Solvers

```{eval-rst}
.. doxygenclass:: OpenImpala::TortuosityHypre
:members:
:outline:

.. doxygenclass:: OpenImpala::TortuosityMLMG
:members:
:outline:

.. doxygenclass:: OpenImpala::EffectiveDiffusivityHypre
:members:
:outline:
```

### Utilities

```{eval-rst}
.. doxygenclass:: OpenImpala::VolumeFraction
:members:
:outline:

.. doxygenclass:: OpenImpala::PercolationCheck
:members:
:outline:

.. doxygenclass:: OpenImpala::TortuositySolverBase
:members:
:outline:

.. doxygenclass:: OpenImpala::HypreStructSolver
:members:
:outline:
```

### Configuration

```{eval-rst}
.. doxygenstruct:: OpenImpala::PhysicsConfig
:members:
:outline:
```

## Full Doxygen output

For the complete class hierarchy, include dependency graphs, and file-level
documentation, see the [Doxygen pages](../doxygen/html/index.html).
Loading