Skip to content

Commit

Permalink
Debug (#1372)
Browse files Browse the repository at this point in the history
* 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 <joshua-cogliati-inl@users.noreply.github.com>
  • Loading branch information
wangcj05 and joshua-cogliati-inl authored Nov 19, 2020
1 parent 0309ee9 commit 390607e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
12 changes: 11 additions & 1 deletion build_raven
Original file line number Diff line number Diff line change
Expand Up @@ -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!
1 change: 1 addition & 0 deletions doc/workshop/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ stochasticCollocation/inputs/run/training_data.xml
timeDepDataMining/inputs/basicStatisticsTimeDependent/
timeDepDataMining/inputs/resultsHierarchicalDTW/
timeDepDataMining/inputs/timeSliceKMeans/
forwardSampling/Inputs/test_*.xml
13 changes: 12 additions & 1 deletion framework/CodeInterfaces/Dymola/DymolaInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
import pandas as pd

from CodeInterfaceBaseClass import CodeInterfaceBase
from utils import mathUtils

class Dymola(CodeInterfaceBase):
"""
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions scripts/establish_conda_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions tests/framework/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit 390607e

Please sign in to comment.