openturns icon indicating copy to clipboard operation
openturns copied to clipboard

The doc of the BasisFactory class has no example.

Open mbaudin47 opened this issue 5 years ago • 4 comments

In the doc of the BasisFactory class:

http://openturns.github.io/openturns/master/user_manual/response_surface/_generated/openturns.BasisFactory.html

there is no example.

mbaudin47 avatar Sep 12 '19 09:09 mbaudin47

The context of this bug is the will to create a kriging algorithm with an arbitrary trend. It is easy to create a kriging with a constant, linear or quadratic basis, but, there is no example of how to create a kriging algorithm with a customized trend.

mbaudin47 avatar Sep 12 '19 09:09 mbaudin47

I think python/doc/examples/meta_modeling/kriging_metamodel/plot_kriging_beam_arbitrary_trend.py a.k.a. "Configuring an arbitrary trend in Kriging" shows what you want. What do you think @mbaudin47 ?

josephmure avatar Jan 12 '21 23:01 josephmure

Not in my sense. My message highlights the fact that the API help page has no example.

There are at least two different places for examples, each with a specific content.

  • In my dreams, any API page has a minimal example showing the minimum number of lines of codes (the minimal working example) which creates the object and use its main methods. It focuses on the software and presents the input and output arguments of the class and its methods.
  • On the other hand, examples in the "Examples" section shows how to combine several classes in order to create something meaningful in practice. This is a synthesis exercise. Such a page has interesting examples, which are relevant to the UQ methodology.

mbaudin47 avatar Jan 15 '21 22:01 mbaudin47

A related class is Basis, which does provide not enough examples:

https://openturns.github.io/openturns/latest/user_manual/_generated/openturns.Basis.html

Two examples may be created :

  • create a basis with several functions, based on Symbolic or Python functions,
  • create a basis from the several outputs of a multivariate function.

Another example of a custom basis is provided at FunctionalChaosAlgorithm with your own orthonormal basis construction

mbaudin47 avatar Sep 15 '22 13:09 mbaudin47