Skip to content

Commit

Permalink
Alfoa/issue780 ls (#781)
Browse files Browse the repository at this point in the history
* Closes  #780

* Update h5py_interface_creator.py

* Update test_adaptive_sampler.xml

* Update test_adaptive_sampler.xml
  • Loading branch information
alfoa authored and wangcj05 committed Sep 20, 2018
1 parent da4ec50 commit 5f29fe8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
7 changes: 6 additions & 1 deletion framework/h5py_interface_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ def addGroup(self,rlz):
@ Out, None
"""
parentID = rlz.get("RAVEN_parentID",[None])[0]
groupName = str(rlz.get("prefix")[0] if not isinstance(rlz.get("prefix"),basestring) else rlz.get("prefix"))
prefix = rlz.get("prefix")
if prefix is not None:
groupName = str(prefix[0] if not isinstance(prefix,basestring) else prefix)
else:
# this can happen when we want to add sampler generated data (e.g. LimitSurface) in the database
groupName = str(len(self.allGroupPaths))
if parentID:
#If Hierarchical structure, firstly add the root group
if not self.firstRootGroup or parentID == "None":
Expand Down
23 changes: 19 additions & 4 deletions tests/framework/PostProcessors/LimitSurface/test_LimitSurface.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<name>framework/PostProcessors/LimitSurface.testLimitSurfacePostProcessor</name>
<author>alfoa</author>
<created>2014-07-10</created>
<classesTested>Models.PostProcessors.LimitSurface, Functions.External</classesTested>
<classesTested>Models.PostProcessors.LimitSurface, Functions.External, Databases.HDF5</classesTested>
<description>
This test is aimed to check the capability of RAVEN to generate Limit Surfaces from a pre-generated data set (in this case, generated with
a MonteCarlo sampling), outputting the generated Limit Surface in DataObject.PointSet(s) reporting both transition boundaries (-1 1) or just
a MonteCarlo sampling), outputting the generated Limit Surface in DataObject.PointSet(s) and Databases.HDF5 reporting both transition boundaries (-1 1) or just
one of them.
</description>
<revisions>
Expand All @@ -24,12 +24,19 @@
<revision author="alfoa" date="2017-12-14">
Moved LimitSurface Postprocessor tests in a specific directory (tests/framework/PostProcessors/LimitSurface) and updated for new DataObject structure
</revision>
<revision author="alfoa" date="2018-09-11"> Added an additional IOStep to check that the limit surface DataObject can be dumped into a Database of type HDF5</revision>
</revisions>
<requirements>R-RA-1</requirements>
</TestInfo>
<RunInfo>
<WorkingDir>limitSurface</WorkingDir>
<Sequence>FirstMRun,ComputeLimitSurfacePositive,ComputeLimitSurfaceNegative,ComputeLimitSurfacePositiveNegative</Sequence>
<Sequence>
FirstMRun,
ComputeLimitSurfacePositive,
ComputeLimitSurfaceNegative,
ComputeLimitSurfacePositiveNegative,
dumpLimitSurfacePositiveNegativeInHDF5
</Sequence>
<batchSize>1</batchSize>
</RunInfo>

Expand Down Expand Up @@ -134,8 +141,16 @@
<Output class="DataObjects" type="PointSet">LimitSurfacePositiveNegative</Output>
<Output class="OutStreams" type="Print">LimitSurfacePositiveNegative_dump</Output>
</PostProcess>
<IOStep name="dumpLimitSurfacePositiveNegativeInHDF5">
<Input class="DataObjects" type="PointSet">LimitSurfacePositiveNegative</Input>
<Output class="Databases" type="HDF5">test_db_database</Output>
</IOStep>
</Steps>


<Databases>
<HDF5 name="test_db_database" readMode="overwrite"/>
</Databases>

<OutStreams>
<Print name="PointSetPostProcTest_dump">
<type>csv</type>
Expand Down

0 comments on commit 5f29fe8

Please sign in to comment.