From 390607e2eef224a881b7a0349352ff3bfd7cb605 Mon Sep 17 00:00:00 2001 From: Congjian Wang - INL Date: Thu, 19 Nov 2020 13:45:58 -0700 Subject: [PATCH] Debug (#1372) * Adding ability to sign the .so files. (#1362) Adding ability to sign the .so files.. This will be needed in future mac os releases. * debug * fix dymolainterface * revert code interface changes * update rounding error for time index * fix index for duplicated values Co-authored-by: Joshua J. Cogliati --- build_raven | 12 +++++++++++- doc/workshop/.gitignore | 1 + framework/CodeInterfaces/Dymola/DymolaInterface.py | 13 ++++++++++++- scripts/establish_conda_env.sh | 10 ++++++++++ tests/framework/.gitignore | 12 ++++++++++++ 5 files changed, 46 insertions(+), 2 deletions(-) diff --git a/build_raven b/build_raven index f96661ca69..7e8dd9f2d6 100755 --- a/build_raven +++ b/build_raven @@ -107,5 +107,15 @@ fi (cd $RAVEN_BUILD_DIR && ${PYTHON_COMMAND} ./setup.py build_ext build install --install-platlib=./framework/contrib/AMSC) - +if [ ! -z "$RAVEN_SIGNATURE" ]; +then + #This is to allow the code to be signed on mac os computers. + # It requires a signature (possibly self signed) to be used. + # Creating a signature is discussed at: + # https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html + # RAVEN_SIGNATURE can be added to .ravenrc + echo "... Signing code with '$RAVEN_SIGNATURE' ..." + (cd $CROW_DIR/install/crow_modules && pwd && codesign -s "$RAVEN_SIGNATURE" -v *.so) + (cd $RAVEN_BUILD_DIR/framework/contrib/AMSC && pwd && codesign -s "$RAVEN_SIGNATURE" -v *.so) +fi echo ... done! diff --git a/doc/workshop/.gitignore b/doc/workshop/.gitignore index 022fc33895..a0a3fa75ec 100644 --- a/doc/workshop/.gitignore +++ b/doc/workshop/.gitignore @@ -57,3 +57,4 @@ stochasticCollocation/inputs/run/training_data.xml timeDepDataMining/inputs/basicStatisticsTimeDependent/ timeDepDataMining/inputs/resultsHierarchicalDTW/ timeDepDataMining/inputs/timeSliceKMeans/ +forwardSampling/Inputs/test_*.xml diff --git a/framework/CodeInterfaces/Dymola/DymolaInterface.py b/framework/CodeInterfaces/Dymola/DymolaInterface.py index d8a8393455..9c651c4dd8 100644 --- a/framework/CodeInterfaces/Dymola/DymolaInterface.py +++ b/framework/CodeInterfaces/Dymola/DymolaInterface.py @@ -104,6 +104,7 @@ import pandas as pd from CodeInterfaceBaseClass import CodeInterfaceBase +from utils import mathUtils class Dymola(CodeInterfaceBase): """ @@ -449,9 +450,19 @@ def finalizeCodeOutput(self, command, output, workingDir): m = t.duplicated() if len(t[m]): # duplicated values + tIndex = None + iIndex = 1 for i in range(len(t[m])): index = t[m].index[i] - t[index] = t[index] + numpy.finfo(float).eps + if tIndex is None: + tIndex = t[index] + else: + if mathUtils.compareFloats(tIndex, t[index], tol=1.0E-15): + iIndex += 1 + else: + iIndex = 1 + tIndex = t[index] + t[index] = t[index] + numpy.finfo(float).eps*t[index]*iIndex varTrajectories[:,0] = t.to_numpy() response = {var:varTrajectories[:,i] for (i, var) in enumerate(varNames[0])} # write CSV if the user requests it diff --git a/scripts/establish_conda_env.sh b/scripts/establish_conda_env.sh index 7308a15860..551f5d06f0 100755 --- a/scripts/establish_conda_env.sh +++ b/scripts/establish_conda_env.sh @@ -470,4 +470,14 @@ fi # activate environment and write settings if successful activate_env +if [ -z "$RAVEN_SIGNATURE" ]; +then + RAVEN_SIGNATURE=$(read_ravenrc "RAVEN_SIGNATURE") +fi +if [ ! -z "$RAVEN_SIGNATURE" ]; +then + if [[ $ECE_VERBOSE == 0 ]]; then echo "... Using '$RAVEN_SIGNATURE' for signing ..."; fi + export RAVEN_SIGNATURE +fi + if [[ $ECE_VERBOSE == 0 ]]; then echo ... done!; fi diff --git a/tests/framework/.gitignore b/tests/framework/.gitignore index 416d82575f..8539e3ce56 100644 --- a/tests/framework/.gitignore +++ b/tests/framework/.gitignore @@ -168,3 +168,15 @@ unit_tests/utils/parse/fromXmltoGetpot.i user_guide/EnsembleModel/run_basic/sample/ ROM/TimeSeries/ARMA/ARMAreseed/ ROM/TimeSeries/ARMA/Segmented/arma.pk +ROM/TimeSeries/ARMA/Multicycle/arma.pk +DataObjects/StringIO/sample/ +CodeInterfaceTests/RAVEN/Code/sample/ +CodeInterfaceTests/Neutrino/Neutrino_Base/sampleNeutrino/[1-3] +CodeInterfaceTests/MOOSEBaseApps/MooseExample18WithGenericFile/myMC/[12] +CodeInterfaceTests/MOOSEBaseApps/MooseExample18OnlyGenericFile/myMC/[12] +CodeInterfaceTests/MOOSEBaseApps/MooseExample18OnlyGenericFile/myMC/ex18.i +CodeInterfaceTests/MOOSEBaseApps/MooseExample18WithGenericFile/myMC/ex18.i +CodeInterfaceTests/MOOSEBaseApps/InputParser/sample/[12]/formattest.i +CodeInterfaceTests/MOOSEBaseApps/InputParser/sample/[12]/out~formattest +CodeInterfaceTests/MOOSEBaseApps/InputParser/sample/formattest.i +hybridModel/logicalCode/logicalModelCode/ \ No newline at end of file