Skip to content

Instantly share code, notes, and snippets.

View jschueller's full-sized avatar

Julien Schueller jschueller

  • Phimeca Engineering
  • Elsass
View GitHub Profile
import openturns as ot
class CensoredDistribution(ot.PythonDistribution):
def __init__(self, distribution, bounds):
dim = distribution.getDimension()
super(CensoredDistribution, self).__init__(dim)
if dim != bounds.getDimension():
raise ValueError("distribution/bounds dimension do not match")
if dim > 1:
raise ValueError("TODO")
@jschueller
jschueller / Toy_case.py
Last active October 2, 2023 14:48
bench OT kriging optim Cobyla
#!/usr/bin/env python
import openturns as ot
from sklearn.metrics import mean_squared_error
import numpy as np
print(ot.__file__)
def calculate_metrics(y_test, y_mean_prediction, y_var_prediction):
#! /usr/bin/env python
import openturns as ot
import openturns.experimental as otexp
from openturns.usecases import ishigami_function as ishigami_function
import time
ot.TESTPREAMBLE()
#ot.Log.Show(ot.Log.INFO)
im = ishigami_function.IshigamiModel()
@jschueller
jschueller / debug.rst
Last active November 23, 2022 13:28
debug

ASAN:

cmake -DCMAKE_BUILD_TYPE="" -DCMAKE_CXX_FLAGS="-fadress-sanitizer -O1 -fomit-framepointer" ..

debug modelica leaks using valgrind:

LD_PRELOAD=/tmp/zoe/binaries/linux64/IshigamiFunction.so valgrind --leak-check=yes --track-origins=no --log-file=valgrind_output.txt --suppressions=valgrind-python.supp --keep-debuginfo=yes /usr/bin/python    ex_zoe.py

gdb inside docker:

@jschueller
jschueller / inverseform2.py
Created September 13, 2021 13:59
inverse form
#!/usr/bin/env python
import openturns as ot
import math
class InverseFORMResult:
def __init__(self, p, n):
self.p_ = p
self.n_ = n
def getOptimalValue(self):
@jschueller
jschueller / docker.rst
Last active September 15, 2021 16:48
docker.rst

docker

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
from math import *
import openturns as ot
from time import time
TESTPREAMBLE()
#Log.Show(Log.INFO)
@jschueller
jschueller / bench_chaos_database.py
Last active June 20, 2018 13:13
bench chaos database
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
from math import *
import openturns as ot
from time import time
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
@jschueller
jschueller / inverseform.py
Last active January 5, 2018 09:45
Inverse FORM sample
#! /usr/bin/env python
from __future__ import print_function
import openturns as ot
import math as m
class InverseFORM(object):
def __init__(self, event, parameterName, startingPoint, targetBeta):
assert(parameterName in event.getParameterDescription())
self.event_ = event