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
2 changes: 1 addition & 1 deletion .binder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ RUN chown -R 1000 ${HOME}
RUN chown -R 1000 ${HOME}/.*
USER jovyan
WORKDIR ${HOME}
RUN pip install -e .[fourc,dev]
RUN pip install -e .[dev]
2 changes: 1 addition & 1 deletion .github/actions/code_check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
shell: bash
run: |
cd ${GITHUB_WORKSPACE}
pip install -e .[dev,fourc]
pip install -e .[dev]
pre-commit install --install-hooks
if [ "${GITHUB_REF}" = "refs/heads/main" ]; then
SKIP=no-commit-to-branch pre-commit run --all-files
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/install_beamme/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
install-command:
description: Command to install BeamMe with pip
required: false
default: ".[cubitpy,dev,fourc]"
default: ".[dev]"
runs:
using: composite
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup_python_environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
python-version:
description: "Python version to use"
required: false
default: "3.13"
default: "3.14"

env_type:
description: "Environment type: `conda`, `venv` or `system`" # on Windows `bash -l {0}` shell is required for conda environments
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/source_distribution_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- name: Setup python environment
uses: ./.github/actions/setup_python_environment
with:
python-version: "3.13"
python-version: "3.14"
env_type: venv

- name: Install build tool
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/wheel_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:

- name: Install wheel under test
shell: bash
run: pip install "$(echo wheelhouse/*cp${PYTAG}*.whl)[cubitpy,dev,fourc]"
run: pip install "$(echo wheelhouse/*cp${PYTAG}*.whl)[dev]"

- name: Run test suite and upload results on failure
uses: ./.github/actions/run_tests
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/build_sdist_build_test_wheels_PR_and_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: ./.github/actions/source_distribution_build

build-test-wheels:
name: build-test-wheel python 3.13 on ${{ matrix.os }}
name: build-test-wheel python 3.14 on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -34,10 +34,21 @@ jobs:
- name: Build wheels
uses: ./.github/actions/wheel_build
with:
python-version: "3.13"
wheel-name: wheels-${{ matrix.os }}-py3.13
python-version: "3.14"
wheel-name: wheels-${{ matrix.os }}-py3.14
- name: Test wheels
uses: ./.github/actions/wheel_test
with:
python-version: "3.13"
wheel-name: wheels-${{ matrix.os }}-py3.13
python-version: "3.14"
wheel-name: wheels-${{ matrix.os }}-py3.14

all-build-wheels-pass:
name: All build wheels passed
runs-on: ubuntu-latest
needs: [build-src-dist, build-test-wheels]
if: always()
steps:
- name: Check build wheels result
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]

steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install dependencies
run: |
cd ${GITHUB_WORKSPACE}
pip install -e .[dev,fourc]
pip install -e .[dev]
- name: Build API documentation
run: |
pdoc --math --docformat google --output-dir api-documentation src/beamme/
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
os-version: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.13"]
python-version: ["3.11", "3.14"]
runs-on: ${{ matrix.os-version }}
steps:
- name: Checkout PR code
Expand All @@ -32,15 +32,25 @@ jobs:
- name: Install BeamMe
uses: ./.github/actions/install_beamme
with:
# Test coverage and editable install with Python 3.10, otherwise we use a
# Test coverage and editable install with Python 3.11, otherwise we use a
# non-editable installation and turn off coverage, because the coverage
# only works in editable mode.
install-command: >-
${{ matrix.python-version == '3.10' && '-e .[cubitpy,dev,fourc]' || '.[cubitpy,dev,fourc]'}}
${{ matrix.python-version == '3.11' && '-e .[dev]' || '.[dev]'}}
- name: Run the test suite and upload results on failure
uses: ./.github/actions/run_tests
with:
# The single space in the empty string is required, otherwise GitHub
# evaluates the if clause wrong.
additional-pytest-flags: >-
${{ matrix.python-version == '3.10' && ' ' || '--no-cov' }}
additional-pytest-flags: "${{ matrix.python-version == '3.11' && ' ' || '--no-cov' }}"

all-tests-pass:
Comment thread
isteinbrecher marked this conversation as resolved.
name: All tests passed
runs-on: ubuntu-latest
needs: [beamme-testing-from-source-code]
if: always()
steps:
- name: Check test matrix result
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
2 changes: 1 addition & 1 deletion .github/workflows/testing_protected.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Install BeamMe
uses: ./.github/actions/install_beamme
with:
install-command: "-e .[cubitpy,dev,fourc]"
install-command: "-e .[dev]"
- name: Setup cubit
id: cubit
uses: ./.github/actions/cubit_setup
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup python environment
uses: ./.github/actions/setup_python_environment
with:
python-version: '3.13'
python-version: '3.14'
- name: Install dependencies
run: |
pip install -r website/requirements.txt
Expand Down
24 changes: 12 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
args: ['-maxkb=1000']
args: ['--maxkb=1000']
name: Check for added large files
- id: check-ast
name: Check Python files for parse errors
Expand Down Expand Up @@ -37,24 +37,24 @@ repos:
- id: trailing-whitespace
name: Check for trailing whitespaces
- repo: https://github.com/PyCQA/bandit
rev: 1.8.0
rev: 1.9.4
hooks:
- id: bandit
name: Run bandit (security linter for python)
args: ["--configfile", "pyproject.toml", "--exclude", "tests/*"]
additional_dependencies: ["bandit[toml]"]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.5
rev: v22.1.5
hooks:
- id: clang-format
name: Run clang-format (C/C++ formatter)
types_or: [c, c++]
- repo: https://github.com/PyCQA/docformatter
rev: "eb1df347edd128b30cd3368dddc3aa65edcfac38" # change back to version once bug is fixed in latest version to be compatible with pre-commit
rev: v1.7.8
hooks:
- id: docformatter
name: Run docformatter (formatter for docstrings)
args: ["--in-place", "--config=./pyproject.toml", "-r", "src/beamme/", "tests/"]
args: ["--in-place", "--black", "--config=./pyproject.toml", "-r", "src/beamme/", "tests/"]
- repo: https://github.com/econchick/interrogate
rev: 1.7.0
hooks:
Expand All @@ -63,19 +63,19 @@ repos:
args: [--fail-under=100, --ignore-init-module, --style=google, -vv]
exclude: ^website/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v2.1.0
hooks:
- id: mypy
name: Run mypy (static type checker for python)
args: ["--install-types", "--non-interactive", "--ignore-missing-imports", "--follow-imports=silent"]
exclude: "^website/"
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
rev: 0.9.1
hooks:
- id: nbstripout
name: Run nbstripout (strip output from Jupyter notebooks)
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
rev: v1.5.6
hooks:
- id: insert-license
name: Insert license header (//)
Expand All @@ -102,15 +102,15 @@ repos:
- id: removestar
name: Run removestar (remove wildcard imports)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.15.20
hooks:
- id: ruff # linter
name: Run ruff (linter for Python)
args: ["--fix", "--select", "I,TID252,F401"] # "I => sort imports, TID252 => ban relative imports, F401 => unused imports"
- id: ruff-format # formatter
name: Run ruff (formatter for Python)
- repo: https://github.com/crate-ci/typos
rev: v1.28.4
rev: v1.48.0
hooks:
- id: typos
name: Run typo checker
Expand All @@ -122,7 +122,7 @@ repos:
name: Run xml-formatter
args: [--indent, "2", --indent-char, " ", --selfclose, --overwrite, --eof-newline]
- repo: https://github.com/google/yamlfmt
rev: v0.14.0
rev: v0.21.0
hooks:
- id: yamlfmt
name: Run yamlfmt
Expand Down
5 changes: 4 additions & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# exlude the following words from the typos pre-commit hook
# exclude the following words from the typos pre-commit hook

[default.extend-words]
DISCRET = "DISCRET" # in 4C yaml input files

[default.extend-identifiers]
_NDArray = "_NDArray"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ interaction, <https://athene-forschung.unibw.de/143755>, (2022)</span>

### Python environment

BeamMe is tested with, and supports Python versions 3.10-3.13. It is recommended to use a virtual Python environment such as [Conda](https://anaconda.org/anaconda/conda)/[Miniforge](https://conda-forge.org/download/) or [venv](https://docs.python.org/3/library/venv.html).
BeamMe is tested with, and supports Python versions 3.11-3.14. It is recommended to use a virtual Python environment such as [Conda](https://anaconda.org/anaconda/conda)/[Miniforge](https://conda-forge.org/download/) or [venv](https://docs.python.org/3/library/venv.html).
- A [Conda](https://anaconda.org/anaconda/conda)/[Miniforge](https://conda-forge.org/download/) environment can be created and loaded with
```bash
# Create the environment (this only has to be done once)
conda create -n beamme python=3.13
conda create -n beamme python=3.14
# Activate the environment
conda activate beamme
```
Expand All @@ -243,7 +243,7 @@ You can quickly install BeamMe into your current environment using pip:
pip install beamme
```

Optional dependencies (for development and extra features) can be installed with: `pip install "beamme[cubitpy,dev,fourc]"`
Optional dependencies (for development and extra features) can be installed with: `pip install "beamme[dev]"`
> **Note:** On Zsh, you may need to quote the brackets as shown to avoid shell expansion.

### Install BeamMe from GitHub (most recent version)
Expand Down Expand Up @@ -315,9 +315,9 @@ make -j4

## Developing BeamMe

If you want to actively develop BeamMe or run the test suite, you must install BeamMe in _editable_ (`-e`) mode and with our optional developer dependencies (`[dev,fourc]`) like
If you want to actively develop BeamMe or run the test suite, you must install BeamMe in _editable_ (`-e`) mode and with our optional developer dependencies (`[dev]`) like
```bash
pip install -e ".[dev,fourc]" # Quotation marks are required for some shells
pip install -e ".[dev]" # Quotation marks are required for some shells
```
You can now run the BeamMe test suite to check that everything worked as expected
```bash
Expand Down
2 changes: 1 addition & 1 deletion examples/example_1_finite_rotations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
"\n",
"rotation = Rotation([1, 2, 3], np.pi / 6.0)\n",
"lambda_sr = smallest_rotation(rotation, [1, 0.5, 0])\n",
"print(f\"First basis vector of lambda_sr: {lambda_sr * [1,0,0]}\")"
"print(f\"First basis vector of lambda_sr: {lambda_sr * [1, 0, 0]}\")"
]
},
{
Expand Down
5 changes: 1 addition & 4 deletions examples/utils/example_1_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def print_rotation_matrix(name, rotation):

def add_cube_plot(plotter, row, col, rotation, text, *, plot_outlines=True):
"""Add a cube to the plotter."""

plotter.subplot(row, col)

# Define and optionally plot the original cube
Expand Down Expand Up @@ -114,15 +113,13 @@ def __init__(self, *args, **kwargs):

def __enter__(self):
"""Return the plotter with the given arguments."""

self.plotter = pv.Plotter(*self.args, **self.kwargs)
return self.plotter

def __exit__(self, exc_type, exc_value, traceback):
"""When exiting the with statement, call this function.

We show the plotter (except during testing and we reset the
console print out).
We show the plotter (except during testing and we reset the console print out).
"""
if not is_testing():
self.plotter.show()
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "BeamMe"
description = "BeamMe: A general purpose 3D beam finite element input generator"
requires-python = ">=3.11"
authors = [{name = "BeamMe Authors"}]
maintainers = [
{name = "Ivo Steinbrecher", email = "ivo.steinbrecher@unibw.de"},
Expand Down Expand Up @@ -41,6 +42,8 @@ cubitpy = [
]
fourc = ["fourcipp"]
dev = [
"beamme[cubitpy]",
Comment thread
davidrudlstorfer marked this conversation as resolved.
"beamme[fourc]",
"coverage",
"genbadge[coverage]",
"pdoc",
Expand Down
3 changes: 1 addition & 2 deletions src/beamme/abaqus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""This module defines classes and functions to create an Abaqus beam input
file."""
"""This module defines classes and functions to create an Abaqus beam input file."""
6 changes: 3 additions & 3 deletions src/beamme/abaqus/beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@


def generate_abaqus_beam(beam_type: str):
"""Return a class representing a beam in Abaqus. This class can be used in
the standard mesh generation functions.
"""Return a class representing a beam in Abaqus.

This class can be used in the standard mesh generation functions.

Args:
beam_type: Abaqus identifier for this beam element. For more details,
Expand All @@ -37,7 +38,6 @@ def generate_abaqus_beam(beam_type: str):
A class representing the Abaqus beam element. The class inherits from
the BeamX class, depending on the number of nodes.
"""

if not beam_type[0].lower() == "b":
raise TypeError("Could not identify the given Abaqus beam element")

Expand Down
Loading
Loading