-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
531 changed files
with
45,899 additions
and
7,453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
*.m linguist-vendored | ||
*.dat linguist-vendored | ||
*.tab linguist-vendored | ||
*.txt linguist-vendored | ||
*.C linguist-language=C++ | ||
*.h linguist-language=C++ | ||
*.cpp linguist-language=C++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# Process this file with autoconf to produce a configure script. | ||
|
||
AC_PREREQ(2.65) | ||
AC_INIT([queso], [0.51.1], [[email protected]]) | ||
AC_INIT([queso], [0.52.0], [[email protected]]) | ||
PACKAGE_DESCRIPTION="The parallel C++ statistical library QUESO: Quantification of uncertainty for estimation, simulation and optimization" | ||
AC_SUBST([PACKAGE_DESCRIPTION]) | ||
PACKAGE_URL="https://github.com/libqueso/queso" | ||
|
@@ -108,7 +108,7 @@ AM_CONDITIONAL(TRILINOS_ENABLED,test x$HAVE_TRILINOS = x1) | |
AC_CACHE_SAVE | ||
|
||
# Check for libmesh (optional) | ||
AX_PATH_LIBMESH_NEW(0.8.0,no) | ||
AX_PATH_LIBMESH_NEW(0.9.1,no) | ||
AC_CACHE_SAVE | ||
|
||
# Check for GSL (required) | ||
|
@@ -198,26 +198,40 @@ AC_CONFIG_FILES([ | |
test/test_infinite/inf_options | ||
test/test_Regression/GaussianMean1DRegression_options | ||
test/test_Regression/gpmsa_cobra_input.txt | ||
test/test_Regression/test_cobra_samples_diff.sh | ||
test/test_Regression/test_gpmsa_cobra_samples.m | ||
test/test_Regression/ctf_dat.txt | ||
test/test_Regression/dakota_pstudy.dat | ||
test/test_StatisticalInverseProblem/test_LlhdTargetOutput.sh | ||
test/test_StatisticalInverseProblem/both_input.txt | ||
test/test_StatisticalInverseProblem/llhdout_input.txt | ||
test/test_StatisticalInverseProblem/neither_input.txt | ||
test/test_StatisticalInverseProblem/targetout_input.txt | ||
test/test_Regression/jeffreys_input.txt | ||
test/test_Regression/test_jeffreys_samples_diff.sh | ||
test/test_Regression/test_jeffreys_samples.m | ||
test/test_Regression/adaptedcov_input.txt | ||
test/test_gaussian_likelihoods/queso_input.txt | ||
doxygen/Makefile | ||
doxygen/queso.dox | ||
doxygen/txt_common/about_vpath.page | ||
test/test_gaussian_likelihoods/gaussian_consistency_input.txt | ||
]) | ||
|
||
AC_CONFIG_FILES([test/test_Regression/test_cobra_samples_diff.sh | ||
], | ||
[ | ||
chmod +x test/test_Regression/test_cobra_samples_diff.sh | ||
]) | ||
|
||
AC_CONFIG_FILES([ | ||
test/test_StatisticalInverseProblem/test_LlhdTargetOutput.sh | ||
], | ||
[ | ||
chmod +x test/test_StatisticalInverseProblem/test_LlhdTargetOutput.sh | ||
]) | ||
|
||
AC_CONFIG_FILES([ | ||
test/test_Regression/test_jeffreys_samples_diff.sh | ||
], | ||
[ | ||
chmod +x test/test_Regression/test_jeffreys_samples_diff.sh | ||
]) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
""" | ||
-----------------------------------------------------------------------bl- | ||
-------------------------------------------------------------------------- | ||
QUESO - a library to support the Quantification of Uncertainty | ||
for Estimation, Simulation and Optimization | ||
Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the Version 2.1 GNU Lesser General | ||
Public License as published by the Free Software Foundation. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc. 51 Franklin Street, Fifth Floor, | ||
Boston, MA 02110-1301 USA | ||
-----------------------------------------------------------------------el- | ||
This module contains a utility funtion, convertMFile, for converting m-files | ||
generated by QUESO into regular text. See the convertMFile help string for more | ||
specific information on usage and output. Conversion can also be accomplished | ||
by invoking convertQuesoMFileToTxt.py on the command line. In this case, | ||
the script will parse a list of input m-files and create text file output | ||
for each m-file. The script separates the chain data, likelihood data, and | ||
target data into separate output files. For more information on the command | ||
version, run: python convertQuesoMFileToTxt.py --help | ||
""" | ||
|
||
import re | ||
import sys | ||
|
||
def convertMFile(mFileName, getChain=True, getLike=True, | ||
getTarget=True, chainIdent='[cC]hain', | ||
likeIdent='[lL]ikelihood', targetIdent='[tT]arget'): | ||
""" | ||
This function parses chain, likelihood, and target data from a single m-file. | ||
mFileName specifies the name of m-file to parse. The get{Chain,Like,Target} | ||
optional inputs take boolean values indicating if the function should parse | ||
that particular item from the file. The {chain,like,target}Ident optional | ||
inputs allow the user to specify a regular expression that identifies that | ||
particular item in the m-file. This function returns a dictionary | ||
containing keys, 'chain', 'logLikelihood', and 'logTarget'. The value | ||
associated with a particular key is the data for that item in character | ||
string format. If the data for an item cannot be found in the file, the | ||
key for that item will not be present in the dictionary. | ||
""" | ||
|
||
# tokens delimiting the data | ||
dataEncloseTokens = ('[', ']') | ||
|
||
# Read file into string buffer | ||
fIn = open(mFileName,'r') | ||
fileBuf = fIn.read() | ||
fIn.close() | ||
|
||
outputMap = dict() | ||
parseMap = {'chain': (getChain, chainIdent), 'logLikelihood': (getLike, likeIdent), | ||
'logTarget': (getTarget, targetIdent)} | ||
|
||
# iterate over wanted items and parse them from the buffer | ||
for item in parseMap: | ||
if parseMap[item][0] == False: | ||
continue | ||
|
||
# Find tag for current item via search with regex: identString\w*\s*=\s*(?=\[) | ||
parseTagRegEx = parseMap[item][1] + r'\w*\s*=\s*' + '(?=' + re.escape(dataEncloseTokens[0]) + ')' | ||
match = re.search(parseTagRegEx, fileBuf) | ||
tag = '' | ||
if match: | ||
tag = match.group(0) + re.escape(dataEncloseTokens[0]) | ||
else: | ||
print 'Error: Could not find identifier {0} in {1}. Regex string: {2}'.format(item, mFileName, parseTagRegEx) | ||
return outputMap | ||
|
||
# Extract current item data between [ ] via search with regex: (?<=tag)[^\]]+ | ||
parseDataRegEx = '(?<=' + tag + ')[^' + re.escape(dataEncloseTokens[1]) + ']+' | ||
match = re.search(parseDataRegEx, fileBuf) | ||
if match: | ||
outputMap[item] = match.group(0) | ||
else: | ||
print 'Error: Could not find {0} data in {1}. Regex string: {2}'.format(item, mFileName, parseDataRegEx) | ||
return outputMap | ||
|
||
return outputMap | ||
|
||
|
||
if __name__ == "__main__": | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description='Convert a list of m-files generated by QUESO into text files.') | ||
parser.add_argument('-c', '--chain', type=str, choices=['yes','no'], default='yes', | ||
help='Parse chain data from m-file (default: yes)') | ||
parser.add_argument('-l', '--likelihood', type=str, choices=['yes','no'], default='yes', | ||
help='Parse likelihood data from m-file (default: yes)') | ||
parser.add_argument('-t', '--target', type=str, choices=['yes','no'], default='yes', | ||
help='Parse target data from m-file (default: yes)') | ||
|
||
parser.add_argument('-ci', '--chain_identifier', type=str, default='[cC]hain', | ||
help='RegEx string identifying chain entry in the m-file (default: [cC]hain)') | ||
parser.add_argument('-li', '--likelihood_identifier', type=str, default='[lL]ikelihood', | ||
help='RegEx string identifying likelihood entry in the m-file (default: [lL]ikelihood)') | ||
parser.add_argument('-ti', '--target_identifier', type=str, default='[tT]arget', | ||
help='RegEx string identifying target entry in the m-file (default: [tT]arget)') | ||
|
||
parser.add_argument('mFileList', nargs='+', help='List of m-files to convert') | ||
|
||
args = parser.parse_args() | ||
|
||
if args.chain == 'yes': | ||
getChainOpt = True | ||
else: | ||
getChainOpt = False | ||
|
||
if args.likelihood == 'yes': | ||
getLikeOpt = True | ||
else: | ||
getLikeOpt = False | ||
|
||
if args.target == 'yes': | ||
getTargetOpt = True | ||
else: | ||
getTargetOpt = False | ||
|
||
# process files one-by-one | ||
for mFileName in args.mFileList: | ||
outputMap = convertMFile(mFileName, getChain=getChainOpt, getLike=getLikeOpt, getTarget=getTargetOpt, \ | ||
chainIdent=args.chain_identifier, likeIdent=args.likelihood_identifier, \ | ||
targetIdent=args.target_identifier) | ||
|
||
# Write the data out to text files | ||
mFileNameBase = mFileName.rstrip('.m') | ||
for item in outputMap: | ||
outFileName = mFileNameBase + '_' + item + '.txt' | ||
fOut = open(outFileName, 'w') | ||
fOut.write(outputMap[item]) | ||
fOut.close() | ||
print 'Created file {0}...'.format(outFileName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ based/html format. | |
|
||
Bugs in the code and errors or omissions in the documentation can be reported | ||
to [email protected] or as a | ||
<a href="https://github.com/libqueso/queso/issues/new>GitHub ticket</a>. | ||
<a href="https://github.com/libqueso/queso/issues/new">GitHub ticket</a>. | ||
Requests and contributions are also welcome using either of the two methods | ||
mentioned above. | ||
|
||
|
@@ -36,11 +36,10 @@ All bug reports should include: | |
|
||
\section bugs Regression Testing | ||
<ul> | ||
<li> <a href="http://buildbot.ices.utexas.edu/docs/buildbot/queso-branch/build/docs/html/lcov/build/src/index.html">Build\ | ||
bot Coverage</a> | ||
<li> <a href="http://buildbot.ices.utexas.edu/docs/buildbot/queso-branch/build/docs/html/lcov/build/src/index.html">Build bot Coverage</a> | ||
|
||
\section licence License | ||
See <a href="https://github.com/libqueso/queso/blob/master/LICENSE>here</a>. | ||
See <a href="https://github.com/libqueso/queso/blob/master/LICENSE">here</a>. | ||
|
||
\section acknowledgements Acknowledgments | ||
\copydoc Acknowledgments | ||
|
Oops, something went wrong.