-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from tataratat/lets-inherit
dynamic spline core
- Loading branch information
Showing
128 changed files
with
9,924 additions
and
7,426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,18 @@ | ||
### First Step | ||
- Assign Labels : Type of PR (Bug/Feature), Scope (tiny, small,... huge) | ||
- Request a reviewer or assign tasks | ||
- Then start to fill the following form: | ||
# Overview | ||
Description | ||
|
||
# Addressed issues | ||
* the list | ||
* of issues | ||
* e.g. #200 | ||
## Addressed issues | ||
* Issues addressed | ||
|
||
# Description | ||
A more detailed | ||
description of your | ||
changes goes here | ||
## Showcase | ||
A short / one-liner example to highlight the (new) feature | ||
``` | ||
import splinepy | ||
## Subsection | ||
more details | ||
|
||
### Subsubsection 2 | ||
more and more details | ||
|
||
## New Feature Showcase | ||
If applicable, a short / one-liner example to highlight the new feature | ||
|
||
|
||
# Check list | ||
### Test documentation | ||
* [ ] Build `--minimal` | ||
* [ ] Build | ||
* [ ] Executed Tests | ||
* [ ] Executed Examples | ||
|
||
### Documentation of changes and theory | ||
* [ ] I have updated the relevant documentations, as far as necessary. | ||
|
||
### Style guide compliance | ||
* [ ] Edited `C++` files formatted with clang-format (`14.x.x`+) | ||
* [ ] Edited Python files formatted to style guide from PEP8 | ||
new, feature = splinepy.tataratat() | ||
``` | ||
|
||
## Checklists | ||
* [ ] Documentations are up-to-date. | ||
* [ ] Added example(s) | ||
* [ ] Added test(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: Builds and runs tests | ||
|
||
on: | ||
pull_request | ||
push | ||
|
||
permissions: | ||
contents: read | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Builds and runs tests | ||
|
||
on: | ||
pull_request | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build_and_tests: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: install dependencies | ||
run: pip install numpy pytest | ||
|
||
- name: build splinepy linux | ||
if: matrix.os == 'ubuntu-latest' | ||
run: CC=gcc-10 CXX=g++-10 python3 setup.py install | ||
|
||
- name: build splinepy macos | ||
if: matrix.os == 'macos-latest' | ||
run: python3 setup.py install | ||
|
||
- name: test | ||
run: pytest tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") | ||
check_required_components("@PROJECT_NAME@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,98 @@ | ||
# build fitting first - currently very independent | ||
add_subdirectory(fitting) | ||
|
||
|
||
## create splinepy target - enables cpp standalone use | ||
# define srcs | ||
set(SPLINEPY_SRCS | ||
${PROJECT_SOURCE_DIR}/cpp/splinepy/splines/create_bezier.cpp | ||
${PROJECT_SOURCE_DIR}/cpp/splinepy/splines/create_rational_bezier.cpp | ||
${PROJECT_SOURCE_DIR}/cpp/splinepy/splines/create_bspline.cpp | ||
${PROJECT_SOURCE_DIR}/cpp/splinepy/splines/create_nurbs.cpp | ||
) | ||
|
||
|
||
# target | ||
if(SPLINEPY_BUILD_SHARED) | ||
add_library(splinepy SHARED ${SPLINEPY_SRCS}) | ||
else() | ||
add_library(splinepy STATIC ${SPLINEPY_SRCS}) | ||
endif(SPLINEPY_BUILD_SHARED) | ||
# alias for convenience | ||
add_library(splinepy::splinepy ALIAS splinepy) | ||
|
||
|
||
# include | ||
target_include_directories(splinepy | ||
PUBLIC | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/cpp> | ||
$<INSTALL_INTERFACE:${incl_dest}>) | ||
|
||
|
||
# link | ||
target_link_libraries(splinepy | ||
PUBLIC | ||
fitting | ||
bezman | ||
napf | ||
SplineLib::splines | ||
SplineLib::input_output) | ||
|
||
|
||
# flags | ||
target_compile_options(splinepy | ||
PRIVATE | ||
${SPLINEPY_FLAGS} | ||
${SPLINEPY_OPTIMIZATION_FLAGS}) | ||
|
||
|
||
# defs | ||
target_compile_definitions(splinepy | ||
PRIVATE | ||
${SPLINEPY_DEFS}) | ||
|
||
# features | ||
target_compile_features(splinepy | ||
PUBLIC | ||
cxx_std_17) | ||
|
||
# python? | ||
if(SPLINEPY_COMPILE_PYTHON) | ||
add_subdirectory(py) | ||
else() | ||
# make Py<spline-class> available | ||
add_library(splinepy INTERFACE) | ||
add_library(splinepy::splinepy ALIAS splinepy) | ||
|
||
# include | ||
target_include_directories(splinepy | ||
INTERFACE | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/cpp>) | ||
#$<INSTALL_INTERFACE:${incl_dest}> | ||
|
||
# link | ||
target_link_libraries(splinepy | ||
INTERFACE | ||
pybind11::headers | ||
fitting | ||
bezman | ||
napf | ||
SplineLib::splines | ||
SplineLib::input_output) | ||
endif() | ||
|
||
|
||
# cmake config files | ||
include(CMakePackageConfigHelpers) | ||
write_basic_package_version_file( | ||
"${version_config}" COMPATIBILITY SameMajorVersion | ||
) | ||
configure_package_config_file( | ||
"${PROJECT_SOURCE_DIR}/cmake/config.cmake.in" | ||
"${project_config}" | ||
INSTALL_DESTINATION "${cfg_dest}" | ||
) | ||
|
||
|
||
# install | ||
install( | ||
TARGETS splinepy | ||
EXPORT "${TARGETS_EXPORT_NAME}" | ||
LIBRARY DESTINATION ${lib_dest} | ||
ARCHIVE DESTINATION ${lib_dest} | ||
INCLUDES DESTINATION "${incl_dest}" | ||
) | ||
install( | ||
FILES "${project_config}" "${version_config}" | ||
DESTINATION "${cfg_dest}" | ||
) | ||
install( | ||
EXPORT "${TARGETS_EXPORT_NAME}" | ||
NAMESPACE "${namespace}" | ||
DESTINATION "${cfg_dest}" | ||
) | ||
# .hpp files - keep tree | ||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/cpp/splinepy" | ||
DESTINATION ${incl_dest} # target directory | ||
FILES_MATCHING PATTERN "*.hpp" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
set(SRCS_FITTING fitting.cpp) | ||
|
||
add_library(fitting OBJECT ${SRCS_FITTING}) | ||
if(SPLINEPY_BUILD_SHARED) | ||
add_library(fitting SHARED ${SRCS_FITTING}) | ||
else() | ||
add_library(fitting STATIC ${SRCS_FITTING}) | ||
endif() | ||
target_include_directories(fitting PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
# 11 is enough, but 17 allows nested namespace.. | ||
target_compile_features(fitting PUBLIC cxx_std_17) | ||
|
||
target_compile_options(fitting PRIVATE ${SPLINEPY_FLAGS}) | ||
if(CMAKE_BUILD_TYPE MATCHES Release) | ||
target_compile_options(fitting PRIVATE ${SPLINEPY_OPTIMIZAION_FLAGS}) | ||
endif() | ||
|
||
install( | ||
TARGETS fitting | ||
EXPORT ${TARGETS_EXPORT_NAME} | ||
LIBRARY DESTINATION ${lib_dest} | ||
LIBRARY DESTINATION ${lib_dest} | ||
INCLUDES DESTINATION ${incl_dest} | ||
) |
Oops, something went wrong.