Skip to content

Commit 9df1e7f

Browse files
committed
Add RotatedCopula
1 parent 95b61f4 commit 9df1e7f

36 files changed

+1058
-292
lines changed

.ci_support/run_docker_linux.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
set -xe
4+
5+
cd /tmp
6+
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/.local \
7+
-DCMAKE_UNITY_BUILD=ON \
8+
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Wshadow -Wsuggest-override -Werror -D_GLIBCXX_ASSERTIONS --coverage" \
9+
-DSWIG_COMPILE_FLAGS="-O1 -Wno-unused-parameter" \
10+
-DUSE_SPHINX=ON -DSPHINX_FLAGS="-W -T -j4" \
11+
-B build /io
12+
cd build
13+
make install
14+
make tests
15+
ctest --output-on-failure --timeout 100 ${MAKEFLAGS}
16+
17+
# coverage
18+
gcov `find lib/src/ -name "*.gcno"`
19+
lcov --capture --directory . --output-file coverage.info --include "*.cxx"
20+
genhtml --output-directory coverage coverage.info
21+
cp -v coverage.info coverage
22+
23+
UID_GID=$1
24+
if test -n "${UID_GID}"
25+
then
26+
sudo chown -R ${UID_GID} ~/.local/share/doc/*/html
27+
sudo cp -pr ~/.local/share/doc/*/html /io
28+
fi

.ci_support/run_docker_mingw.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
set -xe
4+
5+
cd /tmp
6+
mkdir build && cd build
7+
8+
PREFIX=${PWD}/install
9+
CXXFLAGS="-Wall -Wextra -D_GLIBCXX_ASSERTIONS" ${ARCH}-w64-mingw32-cmake \
10+
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
11+
-DCMAKE_UNITY_BUILD=ON \
12+
-DPython_INCLUDE_DIR=${MINGW_PREFIX}/include/python${PYMAJMIN} \
13+
-DPython_LIBRARY=${MINGW_PREFIX}/lib/libpython${PYMAJMIN}.dll.a \
14+
-DPython_EXECUTABLE=/usr/bin/${ARCH}-w64-mingw32-python${PYMAJMIN}-bin \
15+
/io
16+
make install
17+
${ARCH}-w64-mingw32-strip --strip-unneeded ${PREFIX}/bin/*.dll ${PREFIX}/Lib/site-packages/*/*.pyd
18+
echo lib/test ${PREFIX}/Lib/site-packages/* | xargs -n 1 cp ${PREFIX}/bin/*.dll
19+
OPENTURNS_NUM_THREADS=2 ctest -R pyinstallcheck --output-on-failure --timeout 1000 --schedule-random ${MAKEFLAGS}
20+
make tests
21+
OPENTURNS_NUM_THREADS=2 ctest -R cppcheck --output-on-failure --timeout 1000 --schedule-random ${MAKEFLAGS}

.github/workflows/build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
jobs:
7+
linux:
8+
runs-on: ubuntu-latest
9+
env:
10+
MAKEFLAGS: -j4
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Build
14+
run: ./utils/build_locally.sh linux
15+
- name: Upload
16+
if: ${{ github.ref == 'refs/heads/master' }}
17+
run: |
18+
git clone --depth 1 https://${{ secrets.GH_TOKEN }}@github.com/openturns/openturns.github.io.git /tmp/io
19+
mkdir -p /tmp/io/otvine/master
20+
cp -r html/* /tmp/io/otvine/master
21+
cd /tmp/io
22+
touch .nojekyll
23+
git config user.email "support@gh.com"
24+
git config user.name "GitHub Actions"
25+
git add -A .
26+
git commit -a -m "GitHub Actions build ${GITHUB_REPOSITORY} ${GITHUB_RUN_ID}" || exit 0
27+
git push --quiet origin master > /dev/null 2>&1
28+
29+
mingw:
30+
runs-on: ubuntu-latest
31+
env:
32+
MAKEFLAGS: -j4
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Build
36+
run: ./utils/build_locally.sh mingw

.github/workflows/lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Lint source code
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Install
14+
run: |
15+
sudo apt-get install python3-pip
16+
pip3 install flake8
17+
- name: Run linter
18+
run: ./utils/lint.sh
19+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build*/
2+
*~

CMakeLists.txt

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
cmake_minimum_required (VERSION 3.13)
1+
cmake_minimum_required (VERSION 3.18)
22

33
option (BUILD_PYTHON "Build the python module for the library" ON)
44
option (USE_SPHINX "Use sphinx for documentation" OFF)
55
option (BUILD_SHARED_LIBS "Build shared libraries" ON)
66

77
# By default, build in Release mode. Must appear before project() command
8-
set( CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
8+
set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
99

1010
project (otvine)
1111

@@ -14,25 +14,11 @@ string (TOLOWER ${CMAKE_PROJECT_NAME} PACKAGE_NAME)
1414
# set module dir to find custom scripts
1515
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
1616

17-
if (POLICY CMP0042)
18-
# MACOSX_RPATH is enabled by default
19-
cmake_policy(SET CMP0042 NEW)
20-
endif()
21-
if (POLICY CMP0078)
22-
# UseSWIG generates standard target names
23-
cmake_policy(SET CMP0078 NEW)
24-
endif()
25-
if (POLICY CMP0086)
26-
# UseSWIG honors SWIG_MODULE_NAME via -module flag
27-
cmake_policy(SET CMP0086 NEW)
28-
endif()
29-
3017
find_package (OpenTURNS CONFIG REQUIRED)
3118
message (STATUS "Found OpenTURNS: ${OPENTURNS_ROOT_DIR} (found version \"${OPENTURNS_VERSION_STRING}\")")
3219

33-
find_package (vinecopulib CONFIG REQUIRED)
34-
35-
find_package(Eigen3 CONFIG REQUIRED)
20+
find_package (vinecopulib 0.7.1 CONFIG REQUIRED)
21+
message (STATUS "Found vinecopulib: ${vinecopulib_DIR} (found version \"${vinecopulib_VERSION}\")")
3622

3723
if (NOT BUILD_SHARED_LIBS)
3824
list ( APPEND OTVINE_DEFINITIONS "-DOTVINE_STATIC" )
@@ -54,21 +40,20 @@ set (OTVINE_CONFIG_CMAKE_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/otvine)
5440
set (OTVINE_DOC_PATH ${CMAKE_INSTALL_DOCDIR})
5541

5642
if (BUILD_PYTHON)
57-
find_package (SWIG 3)
43+
find_package (SWIG 4)
5844
include (${SWIG_USE_FILE})
5945

60-
if (CMAKE_VERSION VERSION_LESS 3.28)
61-
find_package (Python 3.6 COMPONENTS Interpreter Development)
46+
option (USE_PYTHON_SABI "Use Python stable ABI" OFF)
47+
if (USE_PYTHON_SABI AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.26)
48+
find_package (Python 3.6 COMPONENTS Interpreter Development.SABIModule)
49+
add_library (Python::Module ALIAS Python::SABIModule)
6250
else ()
63-
find_package (Python 3.6 COMPONENTS Interpreter Development.Module Development.SABIModule)
51+
find_package (Python 3.6 COMPONENTS Interpreter Development.Module)
6452
endif ()
6553

6654
if (Python_FOUND)
6755
include (FindPythonModule)
6856
find_python_module (matplotlib)
69-
if (NOT TARGET Python::Module)
70-
include (TargetLinkLibrariesWithDynamicLookup)
71-
endif ()
7257

7358
if (USE_SPHINX)
7459
find_program (SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx Documentation Builder (sphinx-doc.org)")

README.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
.. image:: https://github.com/openturns/otvine/actions/workflows/build.yml/badge.svg?branch=master
22
:target: https://github.com/openturns/otvine/actions/workflows/build.yml
33

4-
otvine Module
5-
=================
4+
OTVine module
5+
=============
66

7-
otvine is a module for OpenTURNS
7+
otvine is a module to expose Vine copulas to OpenTURNS
88

9-
More information can found at http://www.openturns.org
9+
More resources on Vine copulas
10+
https://www.math.cit.tum.de/math/forschung/gruppen/statistics/vine-copula-models/
11+
12+
More info on vinecopulib C++ library
13+
https://vinecopulib.github.io/vinecopulib/
1014

15+
More information can found at http://www.openturns.org
1116

1217
Installation
1318
============

cmake/FindPythonModule.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# MODULE_VERSION_STRING - module version, if available through __version__
1111
#
1212
#=============================================================================
13-
# Copyright 2005-2024 Airbus-EDF-IMACS-ONERA-Phimeca
13+
# Copyright 2005-2026 Airbus-EDF-IMACS-ONERA-Phimeca
1414
#
1515
# Distributed under the OSI-approved BSD License (the "License");
1616
# see accompanying file Copyright.txt for details.

cmake/TargetLinkLibrariesWithDynamicLookup.cmake

Lines changed: 0 additions & 100 deletions
This file was deleted.

cmake/escape_backslash.cmake

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)