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

Maintenace #43

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .ci_support/run_docker_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake -DCMAKE_INSTALL_PREFIX=~/.local \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=32 \
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Wshadow -Werror -D_GLIBCXX_ASSERTIONS" \
-DSWIG_COMPILE_FLAGS="-O1 -Wno-unused-parameter -Wno-shadow" \
-DSPHINX_FLAGS="-W -T -j4" \
-DUSE_SPHINX=ON -DSPHINX_FLAGS="-W -T -j4" \
/io
make install
make tests
Expand Down
18 changes: 7 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.13)

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

# By default, build in Release mode. Must appear before project() command
Expand Down Expand Up @@ -29,9 +29,6 @@ endif()

find_package (OpenTURNS CONFIG REQUIRED)
message (STATUS "Found OpenTURNS: ${OPENTURNS_ROOT_DIR} (found version \"${OPENTURNS_VERSION_STRING}\")")
if (NOT DEFINED OPENTURNS_PYTHON_MODULE_PATH)
set (OPENTURNS_PYTHON_MODULE_PATH ${OPENTURNS_PYTHON3_MODULE_PATH})
endif ()

if (NOT BUILD_SHARED_LIBS)
list ( APPEND OTROBOPT_DEFINITIONS "-DOTROBOPT_STATIC" )
Expand All @@ -52,16 +49,14 @@ set (OTROBOPT_DATA_PATH ${CMAKE_INSTALL_DATAROOTDIR})
set (OTROBOPT_CONFIG_CMAKE_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/otrobopt)
set (OTROBOPT_DOC_PATH ${CMAKE_INSTALL_DOCDIR})

set (CMAKE_CXX_STANDARD 11)

if (BUILD_PYTHON)
find_package (SWIG 3)
include (${SWIG_USE_FILE})

if (CMAKE_VERSION VERSION_LESS 3.24)
find_package (Python 3.5 COMPONENTS Interpreter Development)
if (CMAKE_VERSION VERSION_LESS 3.28)
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 Development.SABIModule)
endif ()

if (Python_FOUND)
Expand All @@ -75,7 +70,8 @@ if (BUILD_PYTHON)
find_program (SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx Documentation Builder (sphinx-doc.org)")
find_python_module (numpydoc)
find_python_module (sphinx_gallery)
if (SPHINX_EXECUTABLE AND NUMPYDOC_FOUND AND SPHINX_GALLERY_FOUND AND MATPLOTLIB_FOUND)
find_python_module (sphinx_copybutton)
if (SPHINX_EXECUTABLE AND NUMPYDOC_FOUND AND SPHINX_GALLERY_FOUND AND SPHINX_COPYBUTTON_FOUND AND MATPLOTLIB_FOUND)
find_python_module (sphinx)
endif ()
if (NOT SPHINX_FOUND)
Expand Down Expand Up @@ -132,7 +128,7 @@ endmacro ( ot_add_current_dir_to_include_dirs )

set ( CPACK_PACKAGE_NAME ${PACKAGE_NAME} )
set ( CPACK_PACKAGE_VERSION_MAJOR 0 )
set ( CPACK_PACKAGE_VERSION_MINOR 14 )
set ( CPACK_PACKAGE_VERSION_MINOR 15 )
set ( CPACK_PACKAGE_VERSION_PATCH )
set ( CPACK_SOURCE_GENERATOR "TGZ;TBZ2" )
set (CPACK_BINARY_STGZ OFF CACHE BOOL "STGZ")
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
= 0.15 release (wip)

* Maintenance

= 0.14 release (2024-05-12)

* Maintenance
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.14
0.15
2 changes: 1 addition & 1 deletion distro/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
otrobopt (0.14-0.1) unstable; urgency=low
otrobopt (0.15-0.1) unstable; urgency=low

* Non-maintainer upload.
* Initial release.
Expand Down
2 changes: 1 addition & 1 deletion distro/rpm/otrobopt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
-DBUILD_SHARED_LIBS:BOOL=ON

Name: otrobopt
Version: 0.14
Version: 0.15
Release: 0%{?dist}
Summary: OpenTURNS module
Group: System Environment/Libraries
Expand Down
1 change: 1 addition & 0 deletions python/doc/_templates/MeasureEvaluation.rst_t
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:exclude-members: __call__, thisown

{% block methods %}
.. automethod:: __init__
Expand Down
1 change: 1 addition & 0 deletions python/doc/_templates/class.rst_t
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:exclude-members: __call__, thisown

{% block methods %}
.. automethod:: __init__
Expand Down
8 changes: 7 additions & 1 deletion python/doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ imgmath_embed = True

extensions.append('matplotlib.sphinxext.plot_directive')

extensions.append('sphinx_copybutton')
copybutton_prompt_text = ">>> "

extensions.append('sphinx_gallery.gen_gallery')
sphinx_gallery_conf = {
'examples_dirs': ['examples'], # path to example scripts
Expand All @@ -88,7 +91,7 @@ master_doc = 'index'

# General information about the project.
project = u'OTRobOpt'
copyright = u'2015-2018 Airbus-EDF-IMACS-Phimeca'
copyright = u'2015-2024 Airbus-EDF-IMACS-Phimeca'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -287,3 +290,6 @@ texinfo_documents = [

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

# If true, Sphinx will warn about all references where the target cannot be found.
nitpicky = True
27 changes: 13 additions & 14 deletions python/src/SubsetInverseSampling_doc.i.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

Parameters
----------
event : :class:`~openturns.Event`
Event we are computing the probability of. The threshold of the event is
not used.
event : :class:`~openturns.RandomVector`
Event we are computing the probability of. The threshold of the event is not used.
targetProbability : float
The wanted final probability.
proposalRange : float, optional
Expand Down Expand Up @@ -78,31 +77,31 @@ Create a performance function with an associated distribution.
>>> mean = ot.Point([7., 2.])
>>> sigma = ot.Point(dim, 1.0)
>>> R = ot.IdentityMatrix(dim)
>>> myDistribution = ot.Normal(mean, sigma, R)
>>> vect = ot.RandomVector(myDistribution)
>>> distribution = ot.Normal(mean, sigma, R)
>>> vect = ot.RandomVector(distribution)
>>> output = ot.CompositeRandomVector(limitState, vect)

Create an event with a fictional threshold value which will not be used.

>>> myEvent = ot.ThresholdEvent(output, ot.Less(), 0.)
>>> event = ot.ThresholdEvent(output, ot.Less(), 0.)

Define the target probability for which the threshold will be computed.

>>> targetProbability = 0.0002
>>> mySS = otrobopt.SubsetInverseSampling(myEvent, targetProbability)
>>> mySS.setMaximumOuterSampling(10000)
>>> mySS.run()
>>> algo = otrobopt.SubsetInverseSampling(event, targetProbability)
>>> algo.setMaximumOuterSampling(10000)
>>> algo.run()

Get some results.

>>> resultSS = mySS.getResult()
>>> pf = resultSS.getProbabilityEstimate()
>>> threshold = mySS.getThresholdPerStep()[-1]
>>> threshold_cl = mySS.getThresholdConfidenceLength(0.90)
>>> result = algo.getResult()
>>> pf = result.getProbabilityEstimate()
>>> threshold = algo.getThresholdPerStep()[-1]
>>> threshold_cl = algo.getThresholdConfidenceLength(0.90)

See also
--------
openturns.Simulation"
openturns.EventSimulation"

// ---------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@

from .otrobopt import *

__version__ = '0.14'
__version__ = '0.15'