Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Sep 21, 2024
1 parent dd007a7 commit 802d682
Show file tree
Hide file tree
Showing 137 changed files with 122 additions and 189 deletions.
5 changes: 3 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== 0.2 release (in-progress) ==
== 0.2 release (2024-09-21) ==

- Fixed the number of X points in DrawEvent.draw() (PR #90)
- Added Uncecomp 2021 examples in Jupyter Notebooks.
Expand All @@ -13,7 +13,8 @@
- Added Borehole function for SA.
- Fixed reference values of reliability problems:
RP14, RP22, RP25, RP31, RP35, RP75, FourBranch.
- Updated to OpenTURNS v1.17.
- Updated to OpenTURNS v1.23
- Sphinx documentation

== 0.1.1 release ==

Expand Down
3 changes: 1 addition & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# otbenchmark documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 19 15:57:39 2015.
Expand Down Expand Up @@ -48,7 +47,7 @@
'examples_dirs': ['examples'],
'gallery_dirs': ['auto_examples'],
'show_signature': False,
'ignore_pattern': 'rp8.py|rp33|drawevent|draw_cross_cuts|plot_bbrc'
'ignore_pattern': 'plot_bbrc'
}

if Version(sphinx_gallery.__version__) >= Version("0.17.0"):
Expand Down
4 changes: 2 additions & 2 deletions doc/examples/README.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Examples
========
General examples
================
8 changes: 8 additions & 0 deletions doc/examples/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
========
Examples
========

.. toctree::
:maxdepth: 2

../auto_examples/index.rst
5 changes: 3 additions & 2 deletions doc/examples/plot_draw_cross_cuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
event = problem.getEvent()
g = event.getFunction()


# ## Compute the bounds of the domain
# %%
# Compute the bounds of the domain
# --------------------------------

# %%
inputVector = event.getAntecedent()
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/plot_drawevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)

# %%
domain = drawEvent.fillEventCrossCut(bounds)
Expand Down
14 changes: 8 additions & 6 deletions doc/examples/plot_uncecomp_ot_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
=================================
"""

# %%
# In the otbenchmark package, we use several objects that must be known in order to distinguish which objects
# come from the OpenTURNS library or from otbenchmark.
# For reliability problems, there are three objects that cannot be ignored:
# * the `Distribution`,
# * the `Function`,
# * the `ThresholdEvent`.
#
# * the :class:`openturns.Distribution`,
# * the :class:`openturns.Function`,
# * the :class:`openturns.ThresholdEvent`.
#

# %%
Expand Down Expand Up @@ -85,7 +87,7 @@
graph.setLegendPosition("topright")
graph.setColors(ot.Drawable.BuildDefaultPalette(2))
view = otv.View(graph, figure_kw={"figsize": (4.5, 3.5)})
view.save("two_samples.pdf")
# view.save("two_samples.pdf")

# %%
# Function
Expand Down Expand Up @@ -143,7 +145,7 @@
graph.add(curve)
graph.setColors(ot.Drawable.BuildDefaultPalette(2))
view = otv.View(graph, figure_kw={"figsize": (4.5, 3.5)})
view.save("histo_output.pdf")
# view.save("histo_output.pdf")

# %%
graph = ot.KernelSmoothing().build(outputSample_ind).drawPDF()
Expand All @@ -154,7 +156,7 @@
graph.add(curve)
graph.setColors(ot.Drawable.BuildDefaultPalette(2))
view = otv.View(graph, figure_kw={"figsize": (4.5, 3.5)})
view.save("kernel_output.pdf")
# view.save("kernel_output.pdf")

# %%
# ThresholdEvent
Expand Down
16 changes: 10 additions & 6 deletions doc/examples/reliability_problems/plot_case_rs.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
print("%.1f %% confidence interval :[%.4f,%.4f] " % (level * 100, pmin, pmax))

# %%
# ## Plot the contours of the function
# Plot the contours of the function
# ---------------------------------

# %%
inputVector = event.getAntecedent()
Expand Down Expand Up @@ -81,7 +82,8 @@
_ = otv.View(distribution.drawPDF())

# %%
# ## Visualise the safe and unsafe regions on a sample
# Visualise the safe and unsafe regions on a sample
# -------------------------------------------------

# %%
sampleSize = 500
Expand All @@ -91,10 +93,11 @@

# %%
cloud = drawEvent.drawSampleCrossCut(sampleSize)
cloud
_ = otv.View(cloud)

# %%
# ## Draw the limit state surface
# Draw the limit state surface
# ----------------------------

# %%
bounds = ot.Interval(lowerBound, upperBound)
Expand All @@ -104,10 +107,11 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)

# %%
# ## Fill the event domain with a color
# Fill the event domain with a color
# ----------------------------------

# %%
domain = drawEvent.fillEventCrossCut(bounds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)

# %%
# Fill the event domain with a color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
results[i][5] = benchmarkResult.computedProbability

df = pd.DataFrame(results, index=problem_names, columns=metrics)
df.to_csv("reliability_benchmark_table-output.csv")
# df.to_csv("reliability_benchmark_table-output.csv")
df

# %%
Expand Down
4 changes: 2 additions & 2 deletions doc/examples/reliability_problems/plot_rp110.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
nbPoints = [100, 100]
figure = g.draw(lowerBound, upperBound, nbPoints)
figure.setTitle(" Iso-values of limit state function")
figure
_ = otv.View(figure)

# %%
# Print the iso-values of the distribution
Expand Down Expand Up @@ -95,7 +95,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)

# %%
domain = drawEvent.fillEventCrossCut(bounds)
Expand Down
4 changes: 2 additions & 2 deletions doc/examples/reliability_problems/plot_rp111.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
nbPoints = [100, 100]
figure = g.draw(lowerBound, upperBound, nbPoints)
figure.setTitle(" Iso-values of limit state function")
figure
_ = otv.View(figure)

# %%
_ = otv.View(distribution.drawPDF())
Expand All @@ -85,7 +85,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)

# %%
domain = drawEvent.fillEventCrossCut(bounds)
Expand Down
7 changes: 3 additions & 4 deletions doc/examples/reliability_problems/plot_rp22.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
# %%
nbPoints = [100, 100]
figure = g.draw(lowerBound, upperBound, nbPoints)
figure.setTitle(" Iso-values of limit state function")
figure
figure.setTitle("Iso-values of limit state function")
_ = otv.View(figure)

# %%
# Print the iso-values of the distribution
Expand Down Expand Up @@ -99,8 +99,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph

_ = otv.View(graph)

# %%
domain = drawEvent.fillEventCrossCut(bounds)
Expand Down
4 changes: 2 additions & 2 deletions doc/examples/reliability_problems/plot_rp24.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
nbPoints = [100, 100]
figure = g.draw(lowerBound, upperBound, nbPoints)
figure.setTitle(" Iso-values of limit state function")
figure
_ = otv.View(figure)

# %%
# Print the iso-values of the distribution
Expand All @@ -94,7 +94,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)


# %%
Expand Down
4 changes: 2 additions & 2 deletions doc/examples/reliability_problems/plot_rp25.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
nbPoints = [100, 100]
figure = g.draw(lowerBound, upperBound, nbPoints)
figure.setTitle(" Iso-values of limit state function")
figure
_ = otv.View(figure)

# %%
# Print the iso-values of the distribution
Expand All @@ -86,7 +86,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)

# %%
domain = drawEvent.fillEventCrossCut(bounds)
Expand Down
6 changes: 3 additions & 3 deletions doc/examples/reliability_problems/plot_rp28.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
# %%
nbPoints = [100, 100]
figure = g.draw(lowerBound, upperBound, nbPoints)
figure.setTitle(" Iso-values of limit state function")
figure
figure.setTitle("Iso-values of limit state function")
_ = otv.View(figure)

# %%
# Print the iso-values of the distribution
Expand Down Expand Up @@ -106,7 +106,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)

# %%
domain = drawEvent.fillEventCrossCut(bounds)
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/reliability_problems/plot_rp31.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)

# %%
domain = drawEvent.fillEventCrossCut(bounds)
Expand Down
6 changes: 3 additions & 3 deletions doc/examples/reliability_problems/plot_rp35.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
# %%
nbPoints = [100, 100]
figure = g.draw(lowerBound, upperBound, nbPoints)
figure.setTitle(" Iso-values of limit state function")
figure
figure.setTitle("Iso-values of limit state function")
_ = otv.View(figure)

# %%
# Print the iso-values of the distribution
Expand Down Expand Up @@ -95,7 +95,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)

# %%
domain = drawEvent.fillEventCrossCut(bounds)
Expand Down
3 changes: 1 addition & 2 deletions doc/examples/reliability_problems/plot_rp53.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,13 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)


# %%
domain = drawEvent.fillEventCrossCut(bounds)
_ = otv.View(domain)


# %%
domain.add(cloud)
_ = otv.View(domain)
Expand Down
13 changes: 7 additions & 6 deletions doc/examples/reliability_problems/plot_rp55.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
# %%
nbPoints = [100, 100]
figure = g.draw(lowerBound, upperBound, nbPoints)
figure.setTitle(" Iso-values of limit state function")
figure
figure.setTitle("Iso-values of limit state function")
_ = otv.View(figure)

# %%
# Print the iso-values of the distribution
# Plot the iso-values of the distribution
# ----------------------------------------

# %%
Expand All @@ -77,10 +77,11 @@

# %%
cloud = drawEvent.drawSampleCrossCut(sampleSize)
cloud
_ = otv.View(cloud)

# %%
# ## Draw the limit state surface
# Draw the limit state surface
# ----------------------------

# %%
bounds = ot.Interval(lowerBound, upperBound)
Expand All @@ -90,7 +91,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)


# %%
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/reliability_problems/plot_rp57.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
# %%
graph = drawEvent.drawLimitStateCrossCut(bounds)
graph.add(cloud)
graph
_ = otv.View(graph)

# %%
domain = drawEvent.fillEventCrossCut(bounds)
Expand Down
Loading

0 comments on commit 802d682

Please sign in to comment.