Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter Notebook Versions of Examples #402

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion examples/density_methods/nonlinearMap/myModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ def QoI_map(parameter_samples):

def my_model(parameter_samples):
QoI_samples = QoI_map(parameter_samples)
return QoI_samples
return QoI_samples
18 changes: 17 additions & 1 deletion examples/measure_methods/FEniCS/Compute_Save_KL.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@
from projectKL import projectKL
from poissonRandField import solvePoissonRandomField
import scipy.io as sio
import sys
import argparse

# This has been changed from a function to a script which can be run in
# simple docker container. The function is defined below, but as a script,
# this file takes in-line arguments for numKL. Default value is 2.

parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('Kval', type=int, nargs='?', default='2',
help='an integer for the number of KL terms')

nK = parser.parse_args()
print(nK.Kval)
print("which is type: " +str(type(nK.Kval)))

def computeSaveKL(numKL):
'''
Expand Down Expand Up @@ -73,3 +84,8 @@ def computeSaveKL(numKL):
kl_mdat['KL_eigen_vals'] = eigen_val

sio.savemat("KL_expansion", kl_mdat)


# added code which runs KL function defined above with nK terms
computeSaveKL(nK.Kval)
print("Were the KL_expansions saved?")
Loading