Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3 - Failsafe Polyhedral Gravity Modeling & Polyhedron Class #36

Merged
merged 54 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6620645
update version, add python 3.12.x to wheel-check from testpypi
schuhmaj Apr 15, 2024
82b66dd
write the current code style to a clang format file
schuhmaj Apr 15, 2024
f6f7e33
move ray generation into the detail method
schuhmaj Apr 15, 2024
8389f55
Implement normals orientation check in MeshChecking
schuhmaj Apr 15, 2024
af9ae9f
update GitHub actions
schuhmaj Apr 15, 2024
7547dd3
improve syntax of GitHub action
schuhmaj Apr 15, 2024
0dd39d1
fix windows test workflow
schuhmaj Apr 15, 2024
26c1dec
add new check parameter to the C++ implementation
schuhmaj Apr 15, 2024
f424980
fix Windows Test CI
schuhmaj Apr 15, 2024
54300a4
disable windows test
schuhmaj Apr 15, 2024
c3fb332
dissolve model & calculation distinction - merge the components
schuhmaj Apr 15, 2024
4173c27
refactor the Polyhedron Class
schuhmaj Apr 16, 2024
6522ca7
move polyhedron related enums into Polyhedron.h
schuhmaj Apr 16, 2024
35a56d2
adapt test cases
schuhmaj Apr 16, 2024
5287673
small note
schuhmaj Apr 16, 2024
e1a2276
new Python interface - part 1
schuhmaj Apr 16, 2024
3bb7843
new Python interface - part 2
schuhmaj Apr 16, 2024
27f83ed
finalize the tests for the new Python interface
schuhmaj Apr 16, 2024
ebf5c8a
fix missing init
schuhmaj Apr 16, 2024
1738c16
fix missing include
schuhmaj Apr 16, 2024
125bdac
make it possible to build the docs from source locally without CMake
schuhmaj Apr 17, 2024
f7cb461
update documentation, make the Python docs autogenerated,
schuhmaj Apr 17, 2024
7a94a6d
update gitignore
schuhmaj Apr 17, 2024
7e2fb55
update examples and documentation
schuhmaj Apr 17, 2024
8bd1a4a
update jupyter notebook and everything else
schuhmaj Apr 17, 2024
e19d7ef
add new test case for Polyhedron Normal Orientation Detection
schuhmaj Apr 18, 2024
7886dc6
faster by 10x new checkPlaneUnitNormalOrientation routine using vecto…
schuhmaj Apr 18, 2024
0554f40
update setup.py
schuhmaj Apr 18, 2024
f2cadb8
last fixes - release ready
schuhmaj Apr 18, 2024
7e0f3f4
remove repository url
schuhmaj Apr 18, 2024
2d05f02
fix spelling
schuhmaj Apr 18, 2024
5b9f1e5
rc3
schuhmaj Apr 18, 2024
15083a5
fix setup.py
schuhmaj Apr 18, 2024
871a1cc
update cibuildhweel to fix Windows issue
schuhmaj Apr 18, 2024
c8f4164
update cibuildhweel to fix Windows issue
schuhmaj Apr 18, 2024
d333d31
version 3.0 - remove release candidate status
schuhmaj Apr 18, 2024
9519839
arm images in the pipeline [skip ci]
schuhmaj Apr 19, 2024
1b7b84d
retry with different compiler - macOS arm [skip ci]
schuhmaj Apr 19, 2024
a0647d6
remove "install check" [skip ci]
schuhmaj Apr 19, 2024
927b203
include arm64 for macOS in PyPi pipeline
schuhmaj Apr 19, 2024
de56197
update runtime measurements and add a plot
schuhmaj Apr 21, 2024
7976605
removed Windows Test
schuhmaj Apr 21, 2024
c3d9745
Update README.md
schuhmaj Apr 21, 2024
5cf516f
Update README.md
schuhmaj Apr 21, 2024
1ec4eff
Update README.md
schuhmaj Apr 21, 2024
1aadac8
Apply suggestions from code review
schuhmaj Apr 21, 2024
876b7df
add example for mesh files
schuhmaj Apr 21, 2024
a0c1363
Update README.md
schuhmaj Apr 21, 2024
e9c32f4
Apply suggestions from code review
schuhmaj Apr 21, 2024
d212ab0
spelling
schuhmaj Apr 21, 2024
0d4ab9a
remove -1 acc multiplication
schuhmaj Apr 21, 2024
1a297bd
fix inconsistent indentation
schuhmaj Apr 21, 2024
8f7f1f2
fix legacy reference
schuhmaj Apr 21, 2024
bc7c21f
remove wrong comments
schuhmaj Apr 21, 2024
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
66 changes: 66 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Always
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CompactNamespaces: false
ContinuationIndentWidth: 8
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
54 changes: 24 additions & 30 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,41 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build & Test on Linux
build-and-test-linux:
runs-on: ubuntu-latest

# Build the C++ library & test that it is working using GoogleTest
build-and-test-cpp:
name: C/C++ Library on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
- name: Build
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
- name: Test
cmake --build . --config Release
- name: Test (Linux & macOS)
run: cd build/test && ./polyhedralGravity_test
if: matrix.os != 'windows-latest'

# Install the python interface by building from source and run pytest
pytest-linux:
runs-on: ubuntu-latest
# Install the python interface & test that it is working using pytest
build-and-test-python:
name: Python Interface on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Install Ninja Build
run: |
sudo apt-get install ninja-build -y
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
- name: Install Conda environment from environment.yml
uses: mamba-org/provision-with-micromamba@main
with:
Expand All @@ -44,22 +57,3 @@ jobs:
pip install . -vv --no-build-isolation
pytest -n 3


# Builds the polyhedral gravity python interface the interface
# No testing on Windows since it takes too long
# Enables the long paths feature on Windows (newer thrust versions require this)
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
- name: Build
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
git config --system core.longpaths true
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_POLYHEDRAL_PYTHON_INTERFACE=ON ..
cmake --build . --config Release


3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
- name: Install polyhedral-gravity from recent source for sphinx.ext.autodoc
shell: bash -l {0}
run: pip install . -vv --no-build-isolation
- id: deployment
uses: sphinx-notes/pages@v3
with:
Expand Down
60 changes: 20 additions & 40 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ jobs:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
############################# LINUX WHEELS #############################
# In case of Linux we need to install compiler and build tools before building the wheels
# We further only build the manylinux wheels, but not the musllinux wheels
- name: Build wheels (Linux)
uses: pypa/cibuildwheel@v2.15.0
uses: pypa/cibuildwheel@v2.17.0
env:
CIBW_BEFORE_BUILD: yum makecache && yum install -y gcc-c++ cmake && pip install ninja
CIBW_BUILD: "*manylinux*"
Expand All @@ -34,23 +35,36 @@ jobs:
package-dir: .
output-dir: dist
if: matrix.os == 'ubuntu-latest'
############################# MACOS WHEELS #############################
# Building on macOS requires an installation of gcc since the default clang compiler
# lacks certain features required for building the package
- name: Build wheels (macOS)
uses: pypa/[email protected]
- name: Build wheels (macOS ARM)
uses: pypa/[email protected]
env:
CIBW_BEFORE_BUILD: brew install ninja
CIBW_ARCHS_MACOS: "arm64"
CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"'
with:
package-dir: .
output-dir: dist
if: matrix.os == 'macos-latest'
- name: Build wheels (macOS x86_64)
uses: pypa/[email protected]
env:
CIBW_BEFORE_BUILD: brew install ninja gcc@12
CIBW_ENVIRONMENT: "CC=gcc-12 CXX=g++-12"
CIBW_ARCHS_MACOS: "x86_64"
CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"'
with:
package-dir: .
output-dir: dist
if: matrix.os == 'macos-latest'
############################# WINDOWS WHEELS #############################
# Set up the Visual Studio environment on Windows (required, so that CMake finds the compiler)
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
- name: Build wheels (Windows)
uses: pypa/cibuildwheel@v2.15.0
uses: pypa/cibuildwheel@v2.17.0
env:
CIBW_BEFORE_BUILD: choco install -y ninja cmake
CIBW_ARCHS_WINDOWS: "auto64"
Expand Down Expand Up @@ -94,44 +108,10 @@ jobs:
with:
repository-url: https://test.pypi.org/legacy/

# 3. Check if the package can be installed from testpypi
# Notice, that this is more of an installation test since the
# import check has already been done in the build_wheels job
check_testpypi:
needs: [upload_testpypi]
name: Test import on ${{ matrix.os }} with ${{ matrix.py }}
runs-on: ${{ matrix.os }}
if: always()
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
py:
[
3.7.x,
3.8.x,
3.9.x,
3.10.x,
3.11.x,
pypy3.7,
pypy3.8,
pypy3.9,
pypy3.10,
]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- name: Install package from testpypi
run: pip install --index-url https://test.pypi.org/simple/ polyhedral-gravity
- name: Check import
run: python -c "import polyhedral_gravity"

# 4. Upload the wheels to the actually Python Package Index
# 3. Upload the wheels to the actually Python Package Index
# using trusted publishing
schuhmaj marked this conversation as resolved.
Show resolved Hide resolved
upload_pypi:
needs: [build_wheels, make_sdist, check_testpypi]
needs: [build_wheels, make_sdist, upload_testpypi]
environment:
name: pypi
url: https://pypi.org/p/polyhedral-gravity
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
cmake-build-*
build
polyhedral_gravity.egg-info
dist
dist
docs/Doxyfile
Loading
Loading