Skip to content

Commit e2963f3

Browse files
committed
Merge branch 'update-v1' of https://github.com/GazzolaLab/PyElastica into update-v1
2 parents 7eff0fa + 75c6adc commit e2963f3

73 files changed

Lines changed: 9355 additions & 9 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/elasticapp.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: elasticapp (Elastica++ based backend) tests
2+
3+
# trigger run only on changes to the backend folder.
4+
on:
5+
push:
6+
paths:
7+
- backend/**
8+
pull_request:
9+
paths:
10+
- backend/**
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
python-version: ["3.11"] #, "3.12"]
18+
os: [ubuntu-latest] # , macos-latest]
19+
include:
20+
- os: ubuntu-latest
21+
path: ~/.cache/pip
22+
defaults:
23+
run:
24+
shell: bash
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v5
30+
with:
31+
uv-version: latest
32+
- name: Compile OpenMP
33+
env:
34+
OMP_NUM_THREADS: 2
35+
run: |
36+
sudo apt-get update; sudo apt-get install -y libomp5 libomp-dev
37+
- name: Set up Python ${{ matrix.python-version }}
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
- name: Set up cache
42+
uses: actions/cache@v5
43+
with:
44+
path: ${{ matrix.path }}
45+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('uv.lock') }}
46+
restore-keys: |
47+
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('uv.lock') }}
48+
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
49+
50+
- name: Install PyElastica and dependencies
51+
run: |
52+
make install-dev-deps PYTHON_VERSION=${{ matrix.python-version }}
53+
uv cache prune --ci
54+
55+
- name: Run elasticapp tests
56+
run: |
57+
source .venv/bin/activate
58+
cd backend
59+
make clean-build
60+
make test
61+
# pytest backend/tests/py

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: python -c "import sys; print(sys.version)"
4545
# Set up cache
4646
- name: Set up cache
47-
uses: actions/cache@v4
47+
uses: actions/cache@v5
4848
with:
4949
path: ${{ matrix.path }}
5050
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('uv.lock') }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ sample_prog.py
219219

220220
# txt files
221221
*.txt
222+
!CMakelists.txt
222223

223224
# movie or video file formats
224225
*.mp4
@@ -241,3 +242,6 @@ outcmaes/*
241242

242243
# csv files
243244
*.csv
245+
246+
# ./backend dependencies
247+
deps

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pre-commit-install:
3434
.PHONY: black
3535
black:
3636
uv run black --version
37-
uv run black --config pyproject.toml elastica tests examples
37+
uv run black --config pyproject.toml elastica tests examples backend
3838

3939
.PHONY: black-check
4040
black-check:
@@ -54,7 +54,7 @@ autoflake-check:
5454
.PHONY: autoflake-format
5555
autoflake-format:
5656
uv run autoflake --version
57-
uv run autoflake --in-place $(AUTOFLAKE_ARGS) elastica tests examples
57+
uv run autoflake --in-place $(AUTOFLAKE_ARGS) elastica tests examples backend
5858

5959
.PHONY: format-codestyle
6060
format-codestyle: black autoflake-format
@@ -71,15 +71,15 @@ mypy:
7171

7272
.PHONY: test
7373
test:
74-
uv run pytest -c pyproject.toml
74+
uv run pytest -c pyproject.toml tests
7575

7676
.PHONY: test_coverage
7777
test_coverage:
78-
NUMBA_DISABLE_JIT=1 uv run pytest --cov=elastica -c pyproject.toml
78+
NUMBA_DISABLE_JIT=1 uv run pytest --cov=elastica -c pyproject.toml tests
7979

8080
.PHONY: test_coverage_xml
8181
test_coverage_xml:
82-
NUMBA_DISABLE_JIT=1 uv run pytest --cov=elastica --cov-report=xml -c pyproject.toml
82+
NUMBA_DISABLE_JIT=1 uv run pytest --cov=elastica --cov-report=xml -c pyproject.toml tests
8383

8484
.PHONY: check-codestyle
8585
check-codestyle: black-check flake8 autoflake-check

backend/.clang-format

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
# We'll use defaults from the Google style.
3+
# See http://clang.llvm.org/docs/ClangFormat.html for help.
4+
Language: Cpp
5+
BasedOnStyle: Google
6+
AllowShortIfStatementsOnASingleLine: false
7+
AllowShortLoopsOnASingleLine: false
8+
PointerAlignment: Left
9+
DerivePointerAlignment: false
10+
FixNamespaceComments: true
11+
IncludeCategories:
12+
- Regex: "^<.*"
13+
Priority: 1
14+
- Regex: ".*"
15+
Priority: 2
16+
NamespaceIndentation: All
17+
SortIncludes: false

backend/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CMakeLists.txt.user
2+
CMakeCache.txt
3+
CMakeFiles
4+
CMakeScripts
5+
Testing
6+
Makefile
7+
cmake_install.cmake
8+
install_manifest.txt
9+
compile_commands.json
10+
CTestTestfile.cmake
11+
_deps
12+

0 commit comments

Comments
 (0)