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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package
name: Tests for Aragog

on:
push:
Expand All @@ -17,32 +17,41 @@ on:
- ready_for_review
workflow_dispatch:

permissions:
actions: write
contents: write

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12","3.13"]
python-version: ["3.11", "3.12","3.13"]
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install flake8 pytest pytest-cov pytest-dependency
if [ -f pyproject.toml ]; then pip install .; fi

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest
run: |
pytest
run: pytest --cov-report term --cov-report markdown-append:$GITHUB_STEP_SUMMARY --cov=aragog tests/
4 changes: 2 additions & 2 deletions aragog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

from __future__ import annotations

__version__: str = "25.10.27"
__version__: str = "26.01.06"

import importlib.resources
import logging
import os
from importlib.abc import Traversable
from importlib.resources.abc import Traversable

CFG_DATA: Traversable = importlib.resources.files(f"{__package__}.cfg")

Expand Down
2 changes: 1 addition & 1 deletion aragog/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def rheological_front(self) -> float:
rf = self.evaluator.mesh.basic.radii[idx]

# Return dimensionless rheological front
return (self.evaluator.mesh.basic.radii[-1] - rf) / self.evaluator.mesh.basic.radii[-1]
return ((self.evaluator.mesh.basic.radii[-1] - rf) / self.evaluator.mesh.basic.radii[-1]).item()

@property
def melt_fraction_global(self) -> float:
Expand Down
29 changes: 22 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
[tool.poetry]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[project]
name = "fwl-aragog"
version = "25.10.27"
version = "26.01.06"
authors = [
{name="Dan J. Bower", email="dbower@ethz.ch"},
{name="Mariana Sastre", email="m.c.villamil.sastre@rug.nl"},
{name="Laurent Soucasse", email="l.soucasse@esciencecenter.nl"},
{name="Tim Lichtenberg", email="tim.lichtenberg@rug.nl"},
{name="Harrison Nicholls", email="harrison.nicholls@physics.ox.ac.uk"},
{name="Hanno Spreeuw", email="h.spreeuw@esciencecenter.nl"},
{name="Robb Calder", email="rdc49@cam.ac.uk"},
]
description = "1-D interior dynamics of rocky mantles that are solid, liquid, or mixed phase"
authors = ["Dan J Bower <djbower@users.noreply.github.com>"]
license = "GPL-3.0-or-later"
readme = "README.md"


[tool.poetry]
packages = [
{ include = "aragog" },
{ include = "notebooks", to = "aragog" },
Expand All @@ -29,7 +44,10 @@ osfclient = "^0.0.5"
zenodo_get = ">=1.6.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.4.4"
pytest = ">=8.1"
pytest-cov = ">=1.0.0"
pytest-dependency = ">=1.0.0"


[tool.poetry.extras]
docs = [
Expand All @@ -42,6 +60,3 @@ docs = [
[tool.poetry.scripts]
aragog = "aragog.cli:cli"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import importlib.resources
from contextlib import AbstractContextManager
from importlib.abc import Traversable
from importlib.resources.abc import Traversable
from pathlib import Path

import pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/test_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

def test_version():
"""Test version."""
assert __version__ == "25.10.27"
assert __version__ == "26.01.06"


def test_liquid_constant_properties(helper):
Expand Down