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
49 changes: 49 additions & 0 deletions .github/workflows/spack-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,52 @@ jobs:
run: |
spack env activate ./env
python -c "import pulse"

py-ukb-atlas:
needs: style-check
runs-on: ubuntu-latest
container: ubuntu:24.04
strategy:
fail-fast: false
matrix:
version: ["main", "1.2.3"]
spec: [""]

steps:
- uses: actions/checkout@v6
with:
path: spack_repos
- uses: ./spack_repos/.github/actions/test-package
with:
spec: py-ukb-atlas@${{ matrix.version }} ${{ matrix.spec }}

- name: Import test
shell: spack-bash {0}
run: |
spack env activate ./env
python -c "import ukb"


py-fenicsx-ldrb:
needs: style-check
runs-on: ubuntu-latest
container: ubuntu:24.04
strategy:
fail-fast: false
matrix:
version: ["main", "0.1.17"]
spec: ["^py-fenics-dolfinx%c,cxx=gcc@13.3.0"]

steps:
- uses: actions/checkout@v6
with:
path: spack_repos
- uses: ./spack_repos/.github/actions/test-package
with:
spec: py-fenicsx-ldrb@${{ matrix.version }} ${{ matrix.spec }}

- name: Import test
shell: spack-bash {0}
run: |
spack env activate ./env
python -c "import ldrb"
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


class PyCardiacGeometriesCore(PythonPackage):
"""General ODE translator"""
"""Core utilities for cardiac geometries, including mesh generation and IO."""

homepage = "https://computationalphysiology.github.io/cardiac-geometries-core"
git = "https://github.com/ComputationalPhysiology/cardiac-geometries-core.git"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
# next to all the things you'll want to change. Once you've handled
# them, you can save this file and test your package like this:
#
# spack install py-cardiac-geometries-core
# spack install py-cardiac-geometriesx
#
# You can edit this file again by typing:
#
# spack edit py-cardiac-geometries-core
# spack edit py-cardiac-geometriesx
#
# See the Spack documentation for more information on packaging.
# ----------------------------------------------------------------------------
Expand All @@ -25,7 +25,7 @@


class PyCardiacGeometriesx(PythonPackage):
"""General ODE translator"""
"""Cardiac geometries for FEniCS."""

homepage = "https://computationalphysiology.github.io/cardiac-geometriesx"
git = "https://github.com/ComputationalPhysiology/cardiac-geometriesx.git"
Expand All @@ -46,6 +46,9 @@ class PyCardiacGeometriesx(PythonPackage):
depends_on("python@3.10:", type=("build", "run"))
depends_on("py-setuptools@61.2:", type="build")

variant("ukb", default=True, description="Add ukb-atla")
variant("ldrb", default=True, description="Add fenicsx-ldrb")

# Core dependencies
depends_on("py-fenics-dolfinx+petsc4py", type=("build", "run"))
depends_on("py-rich-click", type=("build", "run"))
Expand All @@ -55,3 +58,9 @@ class PyCardiacGeometriesx(PythonPackage):
depends_on("py-io4dolfinx+adios2+xdmf", type=("build", "run"), when="@main:")
depends_on("py-adios4dolfinx", type=("build", "run"), when="@:0.12")
depends_on("py-scifem", type=("build", "run"))

with when("+ukb"):
depends_on("py-ukb-atlas", type=("build", "run"))

with when("+ldrb"):
depends_on("py-fenicsx-ldrb", type=("build", "run"))
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ class PyFenicsxBeat(PythonPackage):
version("main", branch="main")
version("0.2.4", sha256="ddba1ee2a4ded52a846b1ee11b1bd6e7d97522608dd6206436ae0fd58b12b17b")

variant(
"cardiac-geometries", default=True, description="Add cardiac geometries as a dependency"
)

depends_on("python@3.10:", type=("build", "run"))

depends_on("py-setuptools@42:", type="build")

depends_on("py-fenics-dolfinx@0.10:+petsc4py", when="@0.2:", type=("build", "run"))
depends_on("py-fenics-dolfinx@main+petsc4py", when="@main", type=("build", "run"))
depends_on("py-fenics-dolfinx+petsc4py", type=("build", "run"))
depends_on("py-fenics-basix", type=("build", "run"))
depends_on("py-fenics-ufl", type=("build", "run"))
depends_on("py-mpi4py", type=("build", "run"))
Expand All @@ -37,3 +40,6 @@ class PyFenicsxBeat(PythonPackage):
depends_on("py-rich", type=("build", "run"))
depends_on("py-pint", type=("build", "run"))
depends_on("py-scipy", type=("build", "run"))

with when("+cardiac-geometries"):
depends_on("py-cardiac-geometriesx", type=("build", "run"))
38 changes: 38 additions & 0 deletions spack_repo/scientificcomputing/packages/py_fenicsx_ldrb/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack_repo.builtin.build_systems.python import PythonPackage

from spack.package import *


class PyFenicsxLdrb(PythonPackage):
"""Library to run cardiac EP simulations in FEniCSx"""

homepage = "https://finsberg.github.io/fenicsx-ldrb/"
url = "https://github.com/finsberg/fenicsx-ldrb/archive/refs/tags/v0.1.17.tar.gz"
git = "https://github.com/finsberg/fenicsx-ldrb.git"

maintainers("finsberg")

license("MIT", checked_by="finsberg")

version("main", branch="main")
version("0.1.17", sha256="19ce4660b9711d2efb2f9109d0bc6380eb9f2359a43f8f85f4207ee63f79f30c")

depends_on("python@3.10:", type=("build", "run"))

depends_on("py-setuptools@42:", type="build")

depends_on("py-io4dolfinx+adios2+xdmf", type=("build", "run"), when="@0.2:,main")
depends_on("py-adios4dolfinx", type=("build", "run"), when="@:0.1")

depends_on("py-fenics-dolfinx+petsc4py", type=("build", "run"))
depends_on("py-fenics-basix", type=("build", "run"))
depends_on("py-fenics-ufl", type=("build", "run"))
depends_on("py-mpi4py", type=("build", "run"))
depends_on("petsc+mumps", type=("build", "run"))
depends_on("py-numpy", type=("build", "run"))
depends_on("py-numba", type=("build", "run"))
depends_on("py-scipy", type=("build", "run"))
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ class PyFenicsxPulse(PythonPackage):
version("main", branch="main")
version("0.6.0", sha256="fddfb2fa554e6537b8205a1a7806549fbbd5b55cb913338387f54f27bef87818")

variant(
"cardiac-geometries", default=True, description="Add cardiac geometries as a dependency"
)
variant("circulation", default=True, description="Add circulation models as a dependency")

depends_on("python@3.10:", type=("build", "run"))

depends_on("py-setuptools@42:", type="build")
Expand All @@ -37,3 +42,9 @@ class PyFenicsxPulse(PythonPackage):
depends_on("py-pint", type=("build", "run"))
depends_on("py-scipy", type=("build", "run"))
depends_on("py-rich-argparse", type=("build", "run"))

with when("+cardiac-geometries"):
depends_on("py-cardiac-geometriesx", type=("build", "run"))

with when("+circulation"):
depends_on("py-circulation", type=("build", "run"))
63 changes: 63 additions & 0 deletions spack_repo/scientificcomputing/packages/py_ukb_atlas/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

# ----------------------------------------------------------------------------
# If you submit this package back to Spack as a pull request,
# please first remove this boilerplate and all FIXME comments.
#
# This is a template package file for Spack. We've put "FIXME"
# next to all the things you'll want to change. Once you've handled
# them, you can save this file and test your package like this:
#
# spack install py-ukb-atlas
#
# You can edit this file again by typing:
#
# spack edit py-ukb-atlas
#
# See the Spack documentation for more information on packaging.
# ----------------------------------------------------------------------------

from spack_repo.builtin.build_systems.python import PythonPackage

from spack.package import *


class PyUkbAtlas(PythonPackage):
"""Biventricular atlas of the heart based on the UK Biobank dataset."""

homepage = "https://computationalphysiology.github.io/ukb-atlas"
git = "https://github.com/ComputationalPhysiology/ukb-atlas.git"
url = "https://github.com/ComputationalPhysiology/ukb-atlas/archive/refs/tags/v0.12.0.tar.gz"

# notify when the package is updated.
maintainers("finsberg")

# FIXME: Add the SPDX identifier of the project's license below.
# See https://spdx.org/licenses/ for a list. Upon manually verifying
# the license, set checked_by to your Github username.
license("MIT", checked_by="finsberg")

version("main", branch="main")
version("1.2.3", sha256="65bed1747a9e47f59300d39336af2282bb6fe5a6dc6dd7a7038dd6ba06af7333")

# Python version and Build backend
depends_on("python@3.10:", type=("build", "run"))
depends_on("py-setuptools@61.2:", type="build")

# Core dependencies
depends_on("py-scipy", type=("build", "run"))
depends_on("py-meshio@2.3.5:", type=("build", "run"))
depends_on("py-numpy", type=("build", "run"))
depends_on("py-h5py+mpi", type=("build", "run"))
depends_on("py-pyvista", type=("build", "run"))
depends_on("py-gmsh@:4.13.1", type=("build", "run"))
depends_on("gmsh@:4.13.1", type=("build", "run"))
# OpenGL dependency for gmsh
depends_on("mesa-glu", type=("build", "run"))
# X11 library
depends_on("libxcursor", type=("build", "run"))
depends_on("libxft", type=("build", "run"))
depends_on("libxrender", type=("build", "run"))
depends_on("libxinerama", type=("build", "run"))
Loading