Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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)
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)