How to use openturns - 3 common examples

To help you get started, we’ve selected a few openturns examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jonathf / chaospy / chaospy / external / openturns_.py View on Github external
def __init__(self, distribution):
        from openturns import ComposedDistribution, ContinuousDistribution
        if isinstance(distribution, ComposedDistribution):
            if not distribution.hasIndependentCopula():
                raise DependencyError("Stochastically dependent "
                                      "OpenTURNS distribution unsupported")
            distributions = [
                openturns_dist(dist)
                for dist in distribution.getDistributionCollection()
            ]
        elif isinstance(distribution, ContinuousDistribution):
            distributions = [openturns_dist(distribution)]
        else:
            assert isinstance(distribution, Iterable) and all([
                isinstance(dist, ContinuousDistribution)
                for dist in distribution
            ]), "Only (iterable of) continuous OpenTURNS distributions supported"
            distributions = [openturns_dist(dist) for dist in distribution]
        J.__init__(self, *distributions)
github jonathf / chaospy / chaospy / external / openturns_.py View on Github external
def __init__(self, distribution):
        from openturns import ComposedDistribution, ContinuousDistribution
        if isinstance(distribution, ComposedDistribution):
            if not distribution.hasIndependentCopula():
                raise DependencyError("Stochastically dependent "
                                      "OpenTURNS distribution unsupported")
            distributions = [
                openturns_dist(dist)
                for dist in distribution.getDistributionCollection()
            ]
        elif isinstance(distribution, ContinuousDistribution):
            distributions = [openturns_dist(distribution)]
        else:
            assert isinstance(distribution, Iterable) and all([
                isinstance(dist, ContinuousDistribution)
                for dist in distribution
            ]), "Only (iterable of) continuous OpenTURNS distributions supported"
            distributions = [openturns_dist(dist) for dist in distribution]
        J.__init__(self, *distributions)
github jonathf / chaospy / chaospy / external / openturns_.py View on Github external
def __init__(self, distribution):
        from openturns import ComposedDistribution, ContinuousDistribution
        if isinstance(distribution, ComposedDistribution):
            if not distribution.hasIndependentCopula():
                raise DependencyError("Stochastically dependent "
                                      "OpenTURNS distribution unsupported")
            distributions = [
                openturns_dist(dist)
                for dist in distribution.getDistributionCollection()
            ]
        elif isinstance(distribution, ContinuousDistribution):
            distributions = [openturns_dist(distribution)]
        else:
            assert isinstance(distribution, Iterable) and all([
                isinstance(dist, ContinuousDistribution)
                for dist in distribution
            ]), "Only (iterable of) continuous OpenTURNS distributions supported"
            distributions = [openturns_dist(dist) for dist in distribution]
        J.__init__(self, *distributions)

openturns

Uncertainty treatment library

LGPL-3.0
Latest version published 20 days ago

Package Health Score

75 / 100
Full package analysis

Similar packages