Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaudin47 authored Sep 27, 2023
2 parents 4b4a7f8 + 31fc1f6 commit dbbf2f8
Show file tree
Hide file tree
Showing 73 changed files with 2,137 additions and 333 deletions.
2 changes: 1 addition & 1 deletion .circleci/run_docker_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cmake -DCMAKE_INSTALL_PREFIX=~/.local \
make install
if test -n "${uid}" -a -n "${gid}"
then
cp -r ~/.local/share/openturns/doc/html .
cp -r ~/.local/share/doc/openturns/html .
zip -r openturns-doc.zip html/*
sudo chown ${uid}:${gid} openturns-doc.zip && sudo cp openturns-doc.zip ${source_dir}
fi
Expand Down
2 changes: 1 addition & 1 deletion .circleci/upload_github_io.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ then
CIRCLE_BRANCH="${CIRCLE_TAG:1}"
fi
mkdir -p openturns.github.io/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}
cp -r ~/.local/share/${CIRCLE_PROJECT_REPONAME}/doc/html/* openturns.github.io/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}
cp -r ~/.local/share/doc/${CIRCLE_PROJECT_REPONAME}/html/* openturns.github.io/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}
cd openturns.github.io
touch .nojekyll
git config user.email "sayhi@circleci.com"
Expand Down
68 changes: 68 additions & 0 deletions .github/ISSUE_TEMPLATE/0_bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Bug Report
description: Create a bug report.
labels:
- bug
body:
- type: textarea
id: what
attributes:
label: What happened?
description: What should have happened instead? Please provide as many details as possible.
validations:
required: true
- type: textarea
id: info
attributes:
label: How to reproduce the issue?
description: Please add the minimal code that helps replicating the issue.
render: shell
validations:
required: true
- type: textarea
id: version
attributes:
label: Version
description: |
Please tell us the version you are using.
```python
import openturns as ot
print(ot.__version__)
```
validations:
required: true
- type: dropdown
id: oscheck
attributes:
label: Operating System
description: Please provide the operating system running.
options:
- unknown
- Windows
- Linux
- MacOS
- all
- other
validations:
required: true
- type: dropdown
id: sourcecheck
attributes:
label: Installation media
description: Please provide the installation media.
options:
- unknown
- pip
- conda
- Windows NSIS installer
- Debian package
- RPM package
- from source
- other
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional Context
description: Include any additional information that you think would be valuable.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/1_feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Feature Request
description: Create a feature request.
labels:
- enhancement
body:
- type: textarea
id: idea
attributes:
label: What is the idea?
description: Describe what the feature is and the desired state.
validations:
required: true
- type: textarea
id: why
attributes:
label: Why is this needed?
description: Who would benefit from this feature? Why would this add value to them? What problem does this solve?
- type: textarea
id: context
attributes:
label: Additional Context
description: Include any additional information that you think would be valuable.
21 changes: 8 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "" Release Debug RelWithDebInfo MinSizeRel)
set (CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})

project (OpenTURNS)
project (openturns)

option (USE_BISON "Looks for Bison if true and then build parser" ON)
option (USE_FLEX "Looks for Flex if true and then build lexer" ON)
Expand Down Expand Up @@ -107,7 +107,7 @@ set (OPENTURNS_INCLUDE_PATH ${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "The director
set (OPENTURNS_CONFIG_CMAKE_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/openturns CACHE PATH "The directory where the CMake files are installed")
set (OPENTURNS_SYSCONFIG_PATH ${CMAKE_INSTALL_SYSCONFDIR} CACHE PATH "The directory where the configuration file is installed")
set (OPENTURNS_DATA_PATH ${CMAKE_INSTALL_DATAROOTDIR} CACHE PATH "The directory where the common files are installed")
set (OPENTURNS_DOC_PATH ${CMAKE_INSTALL_DATAROOTDIR}/openturns/doc CACHE PATH "The directory where the license files are installed")
set (OPENTURNS_DOC_PATH ${CMAKE_INSTALL_DOCDIR} CACHE PATH "The directory where the license files are installed")

if (WIN32)
set (DEFAULT_TMP TEMP)
Expand Down Expand Up @@ -408,12 +408,7 @@ if (USE_OPENMP)
find_package (OpenMP)
if (OPENMP_FOUND)
set (OPENTURNS_HAVE_OPENMP TRUE)
if (TARGET OpenMP::OpenMP_CXX)
list (APPEND OPENTURNS_PRIVATE_LIBRARIES OpenMP::OpenMP_CXX)
else ()
set (CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
set (CMAKE_SHARED_LINKER_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")
endif ()
list (APPEND OPENTURNS_PRIVATE_LIBRARIES OpenMP::OpenMP_CXX)
endif ()
endif ()

Expand All @@ -426,10 +421,10 @@ endif ()

if (CMAKE_VERSION VERSION_LESS 3.20)
include (TestBigEndian)
test_big_endian (__BIG_ENDIAN__)
test_big_endian (DSFMT_BIG_ENDIAN)
else ()
if ("${CMAKE_CXX_BYTE_ORDER}" STREQUAL "BIG_ENDIAN")
set (__BIG_ENDIAN__ 1)
if (CMAKE_CXX_BYTE_ORDER STREQUAL "BIG_ENDIAN")
set (DSFMT_BIG_ENDIAN 1)
endif ()
endif ()

Expand Down Expand Up @@ -604,9 +599,9 @@ if (BUILD_PYTHON)
endif ()

if (CMAKE_VERSION VERSION_LESS 3.24)
find_package (Python 3.5 COMPONENTS Interpreter Development)
find_package (Python 3.6 COMPONENTS Interpreter Development)
else ()
find_package (Python 3.5 COMPONENTS Interpreter Development.Module)
find_package (Python 3.6 COMPONENTS Interpreter Development.Module)
endif ()

if (NOT TARGET Python::Module)
Expand Down
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* Removed deprecated EllipticalDistribution::getInverseCorrelation method
* Removed deprecated Basis::getDimension method
* Removed deprecated HSICStat ctors relying on weight matrix
* Deprecated Pagmo.setGenerationNumber for setMaximumIterationNumber

=== Documentation ===

Expand Down
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove Pagmo.setGenerationNumber
2 changes: 1 addition & 1 deletion distro/debian/not-installed
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
usr/lib/python*/*-packages/openturns/*/*.pyc
usr/lib/python*/*-packages/openturns/usecases/*/*.pyc
usr/share/gdb/auto-load/usr/lib/*/libOT.so*gdb.py
usr/share/openturns/doc/COPYING*
usr/share/doc/openturns/COPYING*
2 changes: 1 addition & 1 deletion distro/rpm/openturns.spec
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ make

%install
make install DESTDIR=%{buildroot}
rm -r %{buildroot}%{_datadir}/%{name}/doc
rm -r %{buildroot}%{_datadir}/doc/%{name}

%check
LD_LIBRARY_PATH=%{buildroot}%{_libdir} OPENTURNS_NUM_THREADS=1 ctest --output-on-failure %{?_smp_mflags} -E "cppcheck|ChaosSobol|Kriging" --timeout 1000 --schedule-random || echo "fail"
Expand Down
4 changes: 1 addition & 3 deletions lib/include/OTconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@
#cmakedefine size_t

/* Define to 1 if big endian system */
#ifndef __BIG_ENDIAN__
#cmakedefine __BIG_ENDIAN__
#endif
#cmakedefine DSFMT_BIG_ENDIAN

/* Define to 1 if UnsignedInteger and uint64_t are the same type */
#cmakedefine OPENTURNS_UNSIGNEDLONG_SAME_AS_UINT64
6 changes: 4 additions & 2 deletions lib/src/Base/Func/PiecewiseHermiteEvaluation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Sample PiecewiseHermiteEvaluation::operator () (const Sample & inSample) const
{
if (inSample.getDimension() != 1) throw InvalidArgumentException(HERE) << "Error: expected an input sample of dimension 1, got dimension=" << inSample.getDimension();
const UnsignedInteger size = inSample.getSize();
if (values_.getSize() == 1) return Sample(size, values_[0]);
const UnsignedInteger dimension = getOutputDimension();
Sample output(size, dimension);
const UnsignedInteger iRight = locations_.getSize() - 1;
Expand Down Expand Up @@ -154,6 +155,7 @@ Sample PiecewiseHermiteEvaluation::operator () (const Sample & inSample) const
Point PiecewiseHermiteEvaluation::derivate(const Point & inP) const
{
if (inP.getDimension() != 1) throw InvalidArgumentException(HERE) << "Error: expected an input point of dimension 1, got dimension=" << inP.getDimension();
if (values_.getSize() == 1) return Point(values_.getDimension());;
const Scalar x = inP[0];
UnsignedInteger iLeft = 0;
if (x <= locations_[iLeft]) return values_[iLeft];
Expand Down Expand Up @@ -232,7 +234,7 @@ Sample PiecewiseHermiteEvaluation::getDerivatives() const
void PiecewiseHermiteEvaluation::setDerivatives(const Sample & derivatives)
{
const UnsignedInteger size = derivatives.getSize();
if (!(size >= 2)) throw InvalidArgumentException(HERE) << "Error: there must be at least 2 points to build a piecewise Hermite interpolation function, but size=" << size;
if (!(size >= 1)) throw InvalidArgumentException(HERE) << "Error: there must be at least 1 point to build a piecewise Hermite interpolation function, but size=" << size;
if (size != locations_.getSize()) throw InvalidArgumentException(HERE) << "Error: the number of derivatives=" << size << " must match the number of previously set locations=" << locations_.getSize();
derivatives_ = derivatives;
}
Expand All @@ -243,7 +245,7 @@ void PiecewiseHermiteEvaluation::setLocationsValuesAndDerivatives(const Point &
const Sample & derivatives)
{
const UnsignedInteger size = locations.getSize();
if (!(size >= 2)) throw InvalidArgumentException(HERE) << "Error: there must be at least 2 points to build a piecewise Hermite interpolation function, but size=" << size;
if (!(size >= 1)) throw InvalidArgumentException(HERE) << "Error: there must be at least 1 point to build a piecewise Hermite interpolation function, but size=" << size;
if (size != values.getSize()) throw InvalidArgumentException(HERE) << "Error: the number of values=" << values.getSize() << " must match the number of locations=" << size;
if (size != derivatives.getSize()) throw InvalidArgumentException(HERE) << "Error: the number of derivatives=" << derivatives.getSize() << " must match the number of locations=" << size;
const UnsignedInteger outputDimension = values.getDimension();
Expand Down
6 changes: 4 additions & 2 deletions lib/src/Base/Func/PiecewiseLinearEvaluation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ UnsignedInteger PiecewiseLinearEvaluation::FindSegmentIndex(const Point & locati
Point PiecewiseLinearEvaluation::operator () (const Point & inP) const
{
if (inP.getDimension() != 1) throw InvalidArgumentException(HERE) << "Error: expected an input point of dimension 1, got dimension=" << inP.getDimension();
if (values_.getSize() == 1) return values_[0];
const Scalar x = inP[0];
UnsignedInteger iLeft = 0;
if (x <= locations_[iLeft])
Expand All @@ -159,6 +160,7 @@ Sample PiecewiseLinearEvaluation::operator () (const Sample & inSample) const
{
if (inSample.getDimension() != 1) throw InvalidArgumentException(HERE) << "Error: expected an input sample of dimension 1, got dimension=" << inSample.getDimension();
const UnsignedInteger size = inSample.getSize();
if (values_.getSize() == 1) return Sample(size, values_[0]);
const UnsignedInteger dimension = getOutputDimension();
Sample output(size, dimension);
const UnsignedInteger maxIndex = locations_.getSize() - 1;
Expand Down Expand Up @@ -241,7 +243,7 @@ void PiecewiseLinearEvaluation::setValues(const Point & values)
void PiecewiseLinearEvaluation::setValues(const Sample & values)
{
const UnsignedInteger size = values.getSize();
if (!(size >= 2)) throw InvalidArgumentException(HERE) << "Error: there must be at least 2 points to build a piecewise Hermite interpolation function, but size=" << size;
if (!(size >= 1)) throw InvalidArgumentException(HERE) << "Error: there must be at least 1 point to build a piecewise linear interpolation function, but size=" << size;
if (size != locations_.getSize()) throw InvalidArgumentException(HERE) << "Error: the number of values=" << size << " must match the number of previously set locations=" << locations_.getSize();
values_ = values;
}
Expand All @@ -250,7 +252,7 @@ void PiecewiseLinearEvaluation::setLocationsAndValues(const Point & locations,
const Sample & values)
{
const UnsignedInteger size = locations.getSize();
if (!(size >= 2)) throw InvalidArgumentException(HERE) << "Error: there must be at least 2 points to build a piecewise Hermite interpolation function, but size=" << size;
if (!(size >= 1)) throw InvalidArgumentException(HERE) << "Error: there must be at least 1 point to build a piecewise linear interpolation function, but size=" << size;
if (size != values.getSize()) throw InvalidArgumentException(HERE) << "Error: the number of values=" << values.getSize() << " must match the number of locations=" << size;
// Sort the data in increasing order according to the locations
Collection< std::pair<Scalar, UnsignedInteger> > locationAndIndex(size);
Expand Down
2 changes: 2 additions & 0 deletions lib/src/Base/Func/openturns/EvaluationImplementation.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public:
EvaluationImplementation * clone() const override;

/** Comparison operator */
protected:
using PersistentObject::operator ==;
public:
Bool operator ==(const EvaluationImplementation & other) const;

/** String converter */
Expand Down
2 changes: 2 additions & 0 deletions lib/src/Base/Func/openturns/FieldFunctionImplementation.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public:
FieldFunctionImplementation * clone() const override;

/** Comparison operator */
protected:
using PersistentObject::operator ==;
public:
Bool operator ==(const FieldFunctionImplementation & other) const;

/** String converter */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public:
FieldToPointFunctionImplementation * clone() const override;

/** Comparison operator */
protected:
using PersistentObject::operator ==;
public:
Bool operator ==(const FieldToPointFunctionImplementation & other) const;

/** String converter */
Expand Down
2 changes: 2 additions & 0 deletions lib/src/Base/Func/openturns/FunctionImplementation.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ public:
FunctionImplementation * clone() const override;

/** Comparison operator */
protected:
using PersistentObject::operator ==;
public:
Bool operator ==(const FunctionImplementation & other) const;

/** String converter */
Expand Down
2 changes: 2 additions & 0 deletions lib/src/Base/Func/openturns/GradientImplementation.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public:
GradientImplementation * clone() const override;

/** Comparison operator */
protected:
using PersistentObject::operator ==;
public:
Bool operator ==(const GradientImplementation & other) const;

/** String converter */
Expand Down
2 changes: 2 additions & 0 deletions lib/src/Base/Func/openturns/HessianImplementation.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public:
HessianImplementation * clone() const override;

/** Comparison operator */
protected:
using PersistentObject::operator ==;
public:
Bool operator ==(const HessianImplementation & other) const;

/** String converter */
Expand Down
1 change: 1 addition & 0 deletions lib/src/Base/Optim/Ceres.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "openturns/Log.hxx"
#include "openturns/SpecFunc.hxx"
#ifdef OPENTURNS_HAVE_CERES
#include "openturns/OTwindows.h" // ceres includes windows.h
#include <ceres/ceres.h>
#endif

Expand Down
Loading

0 comments on commit dbbf2f8

Please sign in to comment.