From 6fab7d19c4a06042f6e6f462240a84c67ed8d0ed Mon Sep 17 00:00:00 2001 From: mandd Date: Wed, 14 Jul 2021 17:17:07 -0600 Subject: [PATCH 1/7] added src and test file --- src/basicEventScheduler.py | 108 ++++++++++++++++++++++++++ tests/test_basicEventScheduler.xml | 119 +++++++++++++++++++++++++++++ 2 files changed, 227 insertions(+) create mode 100644 src/basicEventScheduler.py create mode 100644 tests/test_basicEventScheduler.xml diff --git a/src/basicEventScheduler.py b/src/basicEventScheduler.py new file mode 100644 index 0000000..b367f28 --- /dev/null +++ b/src/basicEventScheduler.py @@ -0,0 +1,108 @@ +# Copyright 2017 Battelle Energy Alliance, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Created on June 24, 2020 + +@author: mandd +""" + +#External Modules--------------------------------------------------------------- +import numpy as np +import xarray as xr +import pandas as pd +#External Modules End----------------------------------------------------------- + +#Internal Modules--------------------------------------------------------------- +from PluginsBaseClasses.ExternalModelPluginBase import ExternalModelPluginBase +#Internal Modules End----------------------------------------------------------- + +class basicEventScheduler(ExternalModelPluginBase): + """ + This class is designed to create a Maintenance Scheduler model + """ + def __init__(self): + """ + Constructor + @ In, None + @ Out, None + """ + ExternalModelPluginBase.__init__(self) + + def initialize(self, container, runInfoDict, inputFiles): + """ + Method to initialize the Basic Event Scheduler model + @ In, container, object, self-like object where all the variables can be stored + @ In, runInfoDict, dict, dictionary containing all the RunInfo parameters (XML node ) + @ In, inputFiles, list, list of input files (if any) + @ Out, None + """ + + def _readMoreXML(self, container, xmlNode): + """ + Method to read the portion of the XML that belongs to the Basic Event Scheduler model + @ In, container, object, self-like object where all the variables can be stored + @ In, xmlNode, xml.etree.ElementTree.Element, XML node that needs to be read + @ Out, None + """ + container.basicEvents = {} + container.timeSpamID = None + + for child in xmlNode: + if child.tag == 'BE': + container.basicEvents[child.text.strip()] = [child.get('tin'),child.get('tfin')] + elif child.tag == 'timeSpamID': + container.timeSpamID = child.text.strip() + else: + raise IOError("basicEventScheduler: xml node " + str(child.tag) + " is not allowed") + + def run(self, container, inputs): + """ + This method generate an historySet from the a pointSet which contains initial and final time of the + basic events + @ In, inputDataset, dict, dictionary of inputs from RAVEN + @ In, container, object, self-like object where all the variables can be stored + @ Out, basicEventHistorySet, Dataset, xarray dataset which contains time series for each basic event + """ + if len(inputs) > 2: + raise IOError("basicEventScheduler: More than one file has been passed to the MCS solver") + + dataDict = {} + dataDict['tin'] = [] + dataDict['tfin'] = [] + for key in container.basicEvents.keys(): + dataDict['tin'].append(inputs[container.basicEvents[key][0]]) + dataDict['tfin'].append(inputs[container.basicEvents[key][1]]) + + inputDataset = pd.DataFrame.from_dict(dataDict) + timeArray = np.concatenate([inputDataset[container.tInitial],inputDataset[container.tEnd]]) + timeArraySorted = np.sort(timeArray,axis=0) + timeArrayCleaned = np.unique(timeArraySorted) + + keys = list(container.invMapping.keys()) + dataVars={} + for key in keys: + dataVars[key]=(['RAVEN_sample_ID',container.timeID],np.zeros((1,timeArrayCleaned.shape[0]))) + + basicEventHistorySet = xr.Dataset(data_vars = dataVars, + coords = dict(time=timeArrayCleaned, + RAVEN_sample_ID=np.zeros(1))) + + for index,key in enumerate(inputDataset[container.beId].values): + tin = inputDataset[container.tInitial][index].values + tend = inputDataset[container.tEnd][index].values + indexes = np.where(np.logical_and(timeArrayCleaned>tin,timeArrayCleaned<=tend)) + basicEventHistorySet[key][0][indexes] = 1.0 + + return basicEventHistorySet + diff --git a/tests/test_basicEventScheduler.xml b/tests/test_basicEventScheduler.xml new file mode 100644 index 0000000..e2e354f --- /dev/null +++ b/tests/test_basicEventScheduler.xml @@ -0,0 +1,119 @@ + + + SR2ML/basicEventScheduler + mandd + 2021-07-14 + SR2ML/basicEventScheduler + + This model provided the schedule of a set of basic events create an history set containing + basic event temporal profiles. Each basic event is represented by the initial and final time + where basic event is set to True (i.e., with probability=1.0) + + + + + basicEventScheduler + simRun + 1 + + + + + BE1_tin, BE2_tin, BE3_tin,timeSpam, + BE1_tfin,BE2_tfin,BE3_tfin + BE1 + BE2 + BE3 + timeSpam + + + + + + 0. + 1. + + + 2. + 3. + + + 1. + 3. + + + 2. + 3. + + + 4. + 5. + + + 3. + 5. + + + + + + + 1 + + + BE1_tin_dist + + + BE2_tin_dist + + + BE3_tin_dist + + + BE1_tin_dist + + + BE2_tin_dist + + + BE3_tin_dist + + 1.0 + + + + + + basicEventSchedule_PointSet + MCSmodel + MC_external + sim_HS + Print_sim_HS + + + + + + csv + sim_HS + input,output + + + + + + BE1_tin, BE2_tin, BE3_tin,timeSpam, + BE1_tfin,BE2_tfin,BE3_tfin + OutputPlaceHolder + + + BE1_tin, BE2_tin, BE3_tin,timeSpam, + BE1_tfin,BE2_tfin,BE3_tfin + BE1,BE2,BE3,BE4,TOP + + time + + + + + From 53b7eafb2c7bd0898c8174a4c57d4ff2a8c09e1e Mon Sep 17 00:00:00 2001 From: mandd Date: Thu, 15 Jul 2021 10:00:50 -0600 Subject: [PATCH 2/7] added documentation --- __init__.py | 1 + .../include/basicEventScheduler.tex | 41 +++++++++++++++++++ doc/user_manual/user_manual.tex | 1 + src/basicEventScheduler.py | 40 +++++++++--------- tests/test_basicEventScheduler.xml | 26 ++++++------ tests/tests | 6 +++ 6 files changed, 83 insertions(+), 32 deletions(-) create mode 100644 doc/user_manual/include/basicEventScheduler.tex diff --git a/__init__.py b/__init__.py index 23a467f..70798ef 100644 --- a/__init__.py +++ b/__init__.py @@ -9,6 +9,7 @@ from SR2ML.src import MaintenanceModel from SR2ML.src import MCSSolver from SR2ML.src import MarginModel +from SR2ML.src import basicEventScheduler from SR2ML.src.PostProcessors import DataLabeling from SR2ML.src.PostProcessors import ETImporter from SR2ML.src.PostProcessors import FTImporter diff --git a/doc/user_manual/include/basicEventScheduler.tex b/doc/user_manual/include/basicEventScheduler.tex new file mode 100644 index 0000000..b0b448f --- /dev/null +++ b/doc/user_manual/include/basicEventScheduler.tex @@ -0,0 +1,41 @@ +\section{Basic Event Scheduler Model} +\label{sec:basicEventScheduler} + +This model is designed to read the initial and final time under which a set of basic events +are set to True, and then it generates an HistorySet with the full temporal profile of all +basic events. + + +All the specifications of the Basic Event Scheduler model are given in the \xmlNode{ExternalModel} block. +Inside the \xmlNode{ExternalModel} block, the XML +nodes that belong to this models are: +\begin{itemize} + \item \xmlNode{variables}, \xmlDesc{string, required parameter}, a list containing the names of both the input and output variables of the model + \item \xmlNode{BE}, \xmlDesc{string, required parameter}, the name ID of all basic events + \begin{itemize} + \item \xmlAttr{tin}, \xmlDesc{required string attribute}, name ID of the variable describing the initial time of the BE + \item \xmlAttr{tin}, \xmlDesc{required string attribute}, name ID of the variable describing the final time of the BE + \end{itemize} +\end{itemize} + +The example of \textbf{basicEventScheduler} model is provided below: +\begin{lstlisting}[style=XML] + + + BE1_tin, BE2_tin, BE3_tin, + BE1_tfin,BE2_tfin,BE3_tfin, + BE1,BE2,BE3,time + BE1 + BE2 + BE3 + time + + +\end{lstlisting} + +\subsection{basicEventScheduler Reference Tests} +\begin{itemize} + \item SR2ML/tests/test\_basicEventScheduler.xml +\end{itemize} + + diff --git a/doc/user_manual/user_manual.tex b/doc/user_manual/user_manual.tex index 6c542a8..cf5f80f 100644 --- a/doc/user_manual/user_manual.tex +++ b/doc/user_manual/user_manual.tex @@ -316,6 +316,7 @@ \input{include/MCSImporter.tex} \input{include/DiscreteRiskMeasures.tex} \input{include/MarginModels.tex} + \input{include/basicEventScheduler.tex} \section*{Document Version Information} This document has been compiled using the following version of the plug-in git repository: diff --git a/src/basicEventScheduler.py b/src/basicEventScheduler.py index b367f28..fa5c5d7 100644 --- a/src/basicEventScheduler.py +++ b/src/basicEventScheduler.py @@ -24,7 +24,7 @@ #External Modules End----------------------------------------------------------- #Internal Modules--------------------------------------------------------------- -from PluginsBaseClasses.ExternalModelPluginBase import ExternalModelPluginBase +from PluginBaseClasses.ExternalModelPluginBase import ExternalModelPluginBase #Internal Modules End----------------------------------------------------------- class basicEventScheduler(ExternalModelPluginBase): @@ -56,13 +56,14 @@ def _readMoreXML(self, container, xmlNode): @ Out, None """ container.basicEvents = {} - container.timeSpamID = None for child in xmlNode: if child.tag == 'BE': container.basicEvents[child.text.strip()] = [child.get('tin'),child.get('tfin')] - elif child.tag == 'timeSpamID': - container.timeSpamID = child.text.strip() + elif child.tag == 'timeID': + container.timeID = child.text.strip() + elif child.tag == 'variables': + variables = [str(var.strip()) for var in child.text.split(",")] else: raise IOError("basicEventScheduler: xml node " + str(child.tag) + " is not allowed") @@ -74,22 +75,19 @@ def run(self, container, inputs): @ In, container, object, self-like object where all the variables can be stored @ Out, basicEventHistorySet, Dataset, xarray dataset which contains time series for each basic event """ - if len(inputs) > 2: - raise IOError("basicEventScheduler: More than one file has been passed to the MCS solver") - dataDict = {} - dataDict['tin'] = [] - dataDict['tfin'] = [] for key in container.basicEvents.keys(): - dataDict['tin'].append(inputs[container.basicEvents[key][0]]) - dataDict['tfin'].append(inputs[container.basicEvents[key][1]]) - - inputDataset = pd.DataFrame.from_dict(dataDict) - timeArray = np.concatenate([inputDataset[container.tInitial],inputDataset[container.tEnd]]) + dataDict[key] = [] + dataDict[key].append(inputs[container.basicEvents[key][0]][0]) + dataDict[key].append(inputs[container.basicEvents[key][1]][0]) + + inputDataset = pd.DataFrame.from_dict(dataDict, orient='index',columns=['tin', 'tfin']) + + timeArray = np.concatenate([inputDataset['tin'],inputDataset['tfin']]) timeArraySorted = np.sort(timeArray,axis=0) timeArrayCleaned = np.unique(timeArraySorted) - keys = list(container.invMapping.keys()) + keys = list(container.basicEvents.keys()) dataVars={} for key in keys: dataVars[key]=(['RAVEN_sample_ID',container.timeID],np.zeros((1,timeArrayCleaned.shape[0]))) @@ -98,11 +96,15 @@ def run(self, container, inputs): coords = dict(time=timeArrayCleaned, RAVEN_sample_ID=np.zeros(1))) - for index,key in enumerate(inputDataset[container.beId].values): - tin = inputDataset[container.tInitial][index].values - tend = inputDataset[container.tEnd][index].values + for key in container.basicEvents.keys(): + tin = inputs[container.basicEvents[key][0]][0] + tend = inputs[container.basicEvents[key][1]][0] indexes = np.where(np.logical_and(timeArrayCleaned>tin,timeArrayCleaned<=tend)) basicEventHistorySet[key][0][indexes] = 1.0 + + container.__dict__[key] = basicEventHistorySet[key].values[0] + + container.__dict__[container.timeID] = timeArrayCleaned - return basicEventHistorySet + print(container.__dict__) diff --git a/tests/test_basicEventScheduler.xml b/tests/test_basicEventScheduler.xml index e2e354f..35f44fd 100644 --- a/tests/test_basicEventScheduler.xml +++ b/tests/test_basicEventScheduler.xml @@ -19,12 +19,13 @@ - BE1_tin, BE2_tin, BE3_tin,timeSpam, - BE1_tfin,BE2_tfin,BE3_tfin + BE1_tin, BE2_tin, BE3_tin, + BE1_tfin,BE2_tfin,BE3_tfin, + BE1,BE2,BE3,time BE1 BE2 BE3 - timeSpam + time @@ -70,22 +71,21 @@ BE3_tin_dist - BE1_tin_dist + BE1_tfin_dist - BE2_tin_dist + BE2_tfin_dist - BE3_tin_dist + BE3_tfin_dist - 1.0 - basicEventSchedule_PointSet - MCSmodel + inputPlaceHolder + basicEventScheduler MC_external sim_HS Print_sim_HS @@ -102,16 +102,16 @@ - BE1_tin, BE2_tin, BE3_tin,timeSpam, + BE1_tin, BE2_tin, BE3_tin, BE1_tfin,BE2_tfin,BE3_tfin OutputPlaceHolder - BE1_tin, BE2_tin, BE3_tin,timeSpam, + BE1_tin, BE2_tin, BE3_tin, BE1_tfin,BE2_tfin,BE3_tfin - BE1,BE2,BE3,BE4,TOP + BE1,BE2,BE3 - time + time diff --git a/tests/tests b/tests/tests index 7b21058..a339a27 100644 --- a/tests/tests +++ b/tests/tests @@ -107,4 +107,10 @@ input = 'test_MCSSolver_margin.xml' UnorderedCsv = 'MCSSolverMargin/Print_sim_PS.csv' [../] + + [./TestBasicEventScheduler] + type = 'RavenFramework' + input = 'test_basicEventScheduler.xml' + OrderedCsv = 'basicEventScheduler/Print_sim_HS_0.csv' + [../] [] From 512eaf607ab66ae3c1e0f81fad2d70b288e56362 Mon Sep 17 00:00:00 2001 From: mandd Date: Thu, 15 Jul 2021 10:09:32 -0600 Subject: [PATCH 3/7] delete whitepsaces --- src/basicEventScheduler.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/basicEventScheduler.py b/src/basicEventScheduler.py index fa5c5d7..25955bb 100644 --- a/src/basicEventScheduler.py +++ b/src/basicEventScheduler.py @@ -38,7 +38,7 @@ def __init__(self): @ Out, None """ ExternalModelPluginBase.__init__(self) - + def initialize(self, container, runInfoDict, inputFiles): """ Method to initialize the Basic Event Scheduler model @@ -56,7 +56,7 @@ def _readMoreXML(self, container, xmlNode): @ Out, None """ container.basicEvents = {} - + for child in xmlNode: if child.tag == 'BE': container.basicEvents[child.text.strip()] = [child.get('tin'),child.get('tfin')] @@ -66,7 +66,7 @@ def _readMoreXML(self, container, xmlNode): variables = [str(var.strip()) for var in child.text.split(",")] else: raise IOError("basicEventScheduler: xml node " + str(child.tag) + " is not allowed") - + def run(self, container, inputs): """ This method generate an historySet from the a pointSet which contains initial and final time of the @@ -74,19 +74,19 @@ def run(self, container, inputs): @ In, inputDataset, dict, dictionary of inputs from RAVEN @ In, container, object, self-like object where all the variables can be stored @ Out, basicEventHistorySet, Dataset, xarray dataset which contains time series for each basic event - """ + """ dataDict = {} for key in container.basicEvents.keys(): dataDict[key] = [] dataDict[key].append(inputs[container.basicEvents[key][0]][0]) - dataDict[key].append(inputs[container.basicEvents[key][1]][0]) - - inputDataset = pd.DataFrame.from_dict(dataDict, orient='index',columns=['tin', 'tfin']) + dataDict[key].append(inputs[container.basicEvents[key][1]][0]) + + inputDataset = pd.DataFrame.from_dict(dataDict, orient='index',columns=['tin', 'tfin']) timeArray = np.concatenate([inputDataset['tin'],inputDataset['tfin']]) timeArraySorted = np.sort(timeArray,axis=0) timeArrayCleaned = np.unique(timeArraySorted) - + keys = list(container.basicEvents.keys()) dataVars={} for key in keys: @@ -95,16 +95,16 @@ def run(self, container, inputs): basicEventHistorySet = xr.Dataset(data_vars = dataVars, coords = dict(time=timeArrayCleaned, RAVEN_sample_ID=np.zeros(1))) - + for key in container.basicEvents.keys(): tin = inputs[container.basicEvents[key][0]][0] tend = inputs[container.basicEvents[key][1]][0] indexes = np.where(np.logical_and(timeArrayCleaned>tin,timeArrayCleaned<=tend)) basicEventHistorySet[key][0][indexes] = 1.0 - + container.__dict__[key] = basicEventHistorySet[key].values[0] - + container.__dict__[container.timeID] = timeArrayCleaned - + print(container.__dict__) From 27dcbba373db9595ec89b829337ca1c5397467de Mon Sep 17 00:00:00 2001 From: mandd Date: Thu, 15 Jul 2021 10:12:28 -0600 Subject: [PATCH 4/7] cleaning code --- src/basicEventScheduler.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/basicEventScheduler.py b/src/basicEventScheduler.py index 25955bb..9ccc774 100644 --- a/src/basicEventScheduler.py +++ b/src/basicEventScheduler.py @@ -106,5 +106,3 @@ def run(self, container, inputs): container.__dict__[container.timeID] = timeArrayCleaned - print(container.__dict__) - From 571c36cb6164121e12a8b12a986441d994cf502c Mon Sep 17 00:00:00 2001 From: mandd Date: Tue, 20 Jul 2021 17:12:20 -0600 Subject: [PATCH 5/7] first review --- __init__.py | 2 +- .../include/basicEventScheduler.tex | 5 +++- ...entScheduler.py => BasicEventScheduler.py} | 23 ++++++------------- .../basicEventScheduler/Print_sim_HS_0.csv | 7 ++++++ tests/test_basicEventScheduler.xml | 2 +- tests/tests | 2 +- 6 files changed, 21 insertions(+), 20 deletions(-) rename src/{basicEventScheduler.py => BasicEventScheduler.py} (83%) create mode 100644 tests/gold/basicEventScheduler/Print_sim_HS_0.csv diff --git a/__init__.py b/__init__.py index 70798ef..8b8d07b 100644 --- a/__init__.py +++ b/__init__.py @@ -9,7 +9,7 @@ from SR2ML.src import MaintenanceModel from SR2ML.src import MCSSolver from SR2ML.src import MarginModel -from SR2ML.src import basicEventScheduler +from SR2ML.src import BasicEventScheduler from SR2ML.src.PostProcessors import DataLabeling from SR2ML.src.PostProcessors import ETImporter from SR2ML.src.PostProcessors import FTImporter diff --git a/doc/user_manual/include/basicEventScheduler.tex b/doc/user_manual/include/basicEventScheduler.tex index b0b448f..0e20525 100644 --- a/doc/user_manual/include/basicEventScheduler.tex +++ b/doc/user_manual/include/basicEventScheduler.tex @@ -4,6 +4,9 @@ \section{Basic Event Scheduler Model} This model is designed to read the initial and final time under which a set of basic events are set to True, and then it generates an HistorySet with the full temporal profile of all basic events. +This HistorySet is generated by colleting all the initial and final time values, by ordering +them in ascending order, and by setting the corresponding logical values for each basic event +along the time axis. All the specifications of the Basic Event Scheduler model are given in the \xmlNode{ExternalModel} block. @@ -14,7 +17,7 @@ \section{Basic Event Scheduler Model} \item \xmlNode{BE}, \xmlDesc{string, required parameter}, the name ID of all basic events \begin{itemize} \item \xmlAttr{tin}, \xmlDesc{required string attribute}, name ID of the variable describing the initial time of the BE - \item \xmlAttr{tin}, \xmlDesc{required string attribute}, name ID of the variable describing the final time of the BE + \item \xmlAttr{tfin}, \xmlDesc{required string attribute}, name ID of the variable describing the final time of the BE \end{itemize} \end{itemize} diff --git a/src/basicEventScheduler.py b/src/BasicEventScheduler.py similarity index 83% rename from src/basicEventScheduler.py rename to src/BasicEventScheduler.py index 9ccc774..5ef2032 100644 --- a/src/basicEventScheduler.py +++ b/src/BasicEventScheduler.py @@ -1,16 +1,6 @@ -# Copyright 2017 Battelle Energy Alliance, LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Copyright 2020, Battelle Energy Alliance, LLC +# ALL RIGHTS RESERVED + """ Created on June 24, 2020 @@ -27,7 +17,7 @@ from PluginBaseClasses.ExternalModelPluginBase import ExternalModelPluginBase #Internal Modules End----------------------------------------------------------- -class basicEventScheduler(ExternalModelPluginBase): +class BasicEventScheduler(ExternalModelPluginBase): """ This class is designed to create a Maintenance Scheduler model """ @@ -70,8 +60,9 @@ def _readMoreXML(self, container, xmlNode): def run(self, container, inputs): """ This method generate an historySet from the a pointSet which contains initial and final time of the - basic events - @ In, inputDataset, dict, dictionary of inputs from RAVEN + basic events. This method is generating the time series variable basicEventHistorySet which is passed + to RAVEN through the container.__dict__ container + @ In, inputs, dict, dictionary of inputs from RAVEN @ In, container, object, self-like object where all the variables can be stored @ Out, basicEventHistorySet, Dataset, xarray dataset which contains time series for each basic event """ diff --git a/tests/gold/basicEventScheduler/Print_sim_HS_0.csv b/tests/gold/basicEventScheduler/Print_sim_HS_0.csv new file mode 100644 index 0000000..0590809 --- /dev/null +++ b/tests/gold/basicEventScheduler/Print_sim_HS_0.csv @@ -0,0 +1,7 @@ +time,BE1,BE2,BE3 +0.2246649631356506,0.0,0.0,0.0 +2.6344256060278104,1.0,0.0,0.0 +2.8543678209777847,0.0,0.0,0.0 +2.914493040161788,0.0,1.0,0.0 +4.562087161131689,0.0,1.0,1.0 +4.785268305285197,0.0,0.0,1.0 diff --git a/tests/test_basicEventScheduler.xml b/tests/test_basicEventScheduler.xml index 35f44fd..77a7747 100644 --- a/tests/test_basicEventScheduler.xml +++ b/tests/test_basicEventScheduler.xml @@ -18,7 +18,7 @@ - + BE1_tin, BE2_tin, BE3_tin, BE1_tfin,BE2_tfin,BE3_tfin, BE1,BE2,BE3,time diff --git a/tests/tests b/tests/tests index a339a27..790d099 100644 --- a/tests/tests +++ b/tests/tests @@ -111,6 +111,6 @@ [./TestBasicEventScheduler] type = 'RavenFramework' input = 'test_basicEventScheduler.xml' - OrderedCsv = 'basicEventScheduler/Print_sim_HS_0.csv' + csv = 'basicEventScheduler/Print_sim_HS_0.csv' [../] [] From 7eb7c07212b09a3fc6c50ff71a2ca1b508591e03 Mon Sep 17 00:00:00 2001 From: mandd Date: Wed, 21 Jul 2021 08:37:59 -0600 Subject: [PATCH 6/7] added text in manual --- doc/user_manual/include/basicEventScheduler.tex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/user_manual/include/basicEventScheduler.tex b/doc/user_manual/include/basicEventScheduler.tex index 0e20525..b066845 100644 --- a/doc/user_manual/include/basicEventScheduler.tex +++ b/doc/user_manual/include/basicEventScheduler.tex @@ -4,10 +4,13 @@ \section{Basic Event Scheduler Model} This model is designed to read the initial and final time under which a set of basic events are set to True, and then it generates an HistorySet with the full temporal profile of all basic events. + This HistorySet is generated by colleting all the initial and final time values, by ordering them in ascending order, and by setting the corresponding logical values for each basic event along the time axis. - +Note that this model performs a conversion from interval-based data to instant-based data +(i.e., the history set). The convention is that a logical value set to 1 at a specific time +instant implies that the basic event is actually True from the previous time instant. All the specifications of the Basic Event Scheduler model are given in the \xmlNode{ExternalModel} block. Inside the \xmlNode{ExternalModel} block, the XML From a5cb574290480271c12fce1ce0384c2a961dc60e Mon Sep 17 00:00:00 2001 From: mandd Date: Wed, 21 Jul 2021 08:48:44 -0600 Subject: [PATCH 7/7] forgot last edit --- src/BasicEventScheduler.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/BasicEventScheduler.py b/src/BasicEventScheduler.py index 5ef2032..eb1d9cf 100644 --- a/src/BasicEventScheduler.py +++ b/src/BasicEventScheduler.py @@ -64,7 +64,6 @@ def run(self, container, inputs): to RAVEN through the container.__dict__ container @ In, inputs, dict, dictionary of inputs from RAVEN @ In, container, object, self-like object where all the variables can be stored - @ Out, basicEventHistorySet, Dataset, xarray dataset which contains time series for each basic event """ dataDict = {} for key in container.basicEvents.keys():