MCPcopy Create free account
hub / github.com/Kitware/VTK / testFourth

Method testFourth

IO/Fides/Testing/Python/TestFidesBasic.py:108–137  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

106 return
107
108 def testFourth(self):
109 # This test is based on selecting a BP file that contains some attributes that helps Fides
110 # generate a data model, instead of the user providing the data model.
111 r = vtkIOFides.vtkFidesReader()
112 r.SetFileName(VTK_DATA_ROOT + "/Data/cartesian-attr.bp")
113 r.UpdateInformation()
114 self.assertTrue(r.GetOutputInformation(0).Has(
115 vtkStreamingDemandDrivenPipeline.TIME_STEPS()))
116 nsteps = r.GetOutputInformation(0).Length(vtkStreamingDemandDrivenPipeline.TIME_STEPS())
117 self.assertEqual(nsteps, 1)
118 for i in range(nsteps):
119 self.assertEqual(r.GetOutputInformation(0).Get(
120 vtkStreamingDemandDrivenPipeline.TIME_STEPS(),i), i)
121 pds = r.GetPointDataArraySelection()
122 pds.DisableAllArrays()
123 pds.EnableArray("density")
124 r.Update()
125
126 pdsc = r.GetOutputDataObject(0)
127 self.assertTrue(isinstance(pdsc, vtkPartitionedDataSetCollection))
128 pds = pdsc.GetPartitionedDataSet(0)
129 nParts = pds.GetNumberOfPartitions()
130 self.assertEqual(nParts, 1)
131
132 ds = pds.GetPartition(0)
133 self.assertEqual(ds.GetNumberOfCells(), 440)
134 self.assertEqual(ds.GetNumberOfPoints(), 648)
135 self.assertEqual(ds.GetPointData().GetNumberOfArrays(), 1)
136 self.assertEqual(ds.GetPointData().GetArray(0).GetName(), "density")
137 return
138
139 def testFifth(self):
140 # This test is based on selecting a BP file that contains a group of meshes.

Callers

nothing calls this directly

Calls 15

vtkFidesReaderMethod · 0.80
DisableAllArraysMethod · 0.80
EnableArrayMethod · 0.80
GetPartitionedDataSetMethod · 0.80
rangeClass · 0.50
SetFileNameMethod · 0.45
UpdateInformationMethod · 0.45
HasMethod · 0.45
GetOutputInformationMethod · 0.45
LengthMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected