Posts by author schueller

User day #10

User day # 10 will be held the 6th June 2017 at EDF Chatou in Paris.

This year the theme will be scikit-learn/openturns.

To register send a mail to anne.dutfoy[at]

  • Posted: 2017-03-21 09:18 (Updated: 2017-03-24 11:28)
  • Author: schueller
  • Categories: (none)
  • Comments (0)

Slides of the 8th User's day


Here are the slides of the 8th OpenTURNS User's day held on 2015/06/12 at EDF R&D.


OT function decorator


Here is an easier way to pass python functions to openturns

First define once this decorator for python functions (could be proposed in a future version):

def FunctionDecorator(n, p):
  class otfunc(OpenTURNSPythonFunction):
    def __init__(self, func):
      OpenTURNSPythonFunction.__init__(self, n, p) 
      self.__class__.__name__ = func.__name__
      self._exec = func 
  return otfunc

Then apply it to your function by adding this one line:

@FunctionDecorator(2, 1)
    Y = [ X[0] + X[1] ]    
    return Y

Then use it through OpenTURNS as usual:

myFunc = NumericalMathFunction( SIMPLEFUNC )

This is open for discussion ...


OT Plotting capabilities using Matplotlib


The work on a new module has begun to plot OpenTURNS graphs through matplotlib.

Those who want a preview of the capabilities can check it out here: viewer

This development is not finalized yet, but we welcome any comments.
To test it, just download this single python script and run it, it will show the following examples.
You can copy it somewhere in your openturns python module path (/usr/lib/python2.7/dist-packages/openturns on debian/ubuntu)

import openturns as ot
from openturns.viewer import View
# create a graph
graph = ot.Normal().drawPDF()

# create a View, accepted keywords are figure.add_subplot+axes.plot/axes.pie/ ones depending on the kind of graph
view = View(graph, plot_kwargs={'color':'blue'})

# save to a file, accepted keywords are figure.savefig ones'curve.png', dpi=100)

# show the graph on the screenn, accepted keywords are ones

Here are a few samples:
/raw-attachment/blog/Matplotlib%20module/curve1.png /raw-attachment/blog/Matplotlib%20module/curve2.png
/raw-attachment/blog/Matplotlib%20module/curve3.png /raw-attachment/blog/Matplotlib%20module/curve4.png
/raw-attachment/blog/Matplotlib%20module/curve5.png /raw-attachment/blog/Matplotlib%20module/curve6.png
/raw-attachment/blog/Matplotlib%20module/curve7.png /raw-attachment/blog/Matplotlib%20module/curve8.png
/raw-attachment/blog/Matplotlib%20module/curve9.png /raw-attachment/blog/Matplotlib%20module/curve10.png