MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testCanReadDoubleMetadata

Method testCanReadDoubleMetadata

test/IECoreVDB/VDBObjectTest.py:79–108  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

77 self.assertEqual( metadata, expected )
78
79 def testCanReadDoubleMetadata( self ) :
80 sourcePath = os.path.join( self.dataDir, "sphere.vdb" )
81 vdb = IECoreVDB.VDBObject( sourcePath )
82
83 grid = vdb.findGrid( "ls_sphere" )
84 grid.updateMetadata( { "test" : 0.0 } )
85 vdb.insertGrid( grid )
86
87 metadata = vdb.metadata( "ls_sphere" )
88
89 # skip the file size
90 del metadata['file_mem_bytes']
91
92 expected = IECore.CompoundObject(
93 {
94 'name' : IECore.StringData( 'ls_sphere' ),
95 'file_voxel_count' : IECore.Int64Data( 270638 ),
96 'file_bbox_min' : IECore.V3iData( imath.V3i( -62, -62, -62 ) ),
97 'file_bbox_max' : IECore.V3iData( imath.V3i( 62, 62, 62 ) ),
98 'is_local_space' : IECore.BoolData( 0 ),
99 'is_saved_as_half_float' : IECore.BoolData( 1 ),
100 'value_type' : IECore.StringData( 'float' ),
101 'class' : IECore.StringData( 'level set' ),
102 #'file_mem_bytes': IECore.Int64Data( 2643448 ),
103 'vector_type' : IECore.StringData( 'invariant' ),
104 'test' : IECore.DoubleData( 0.0 )
105 }
106 )
107
108 self.assertEqual( metadata, expected )
109
110
111 def testCanEstimateMemoryUsage( self ):

Callers

nothing calls this directly

Calls 7

findGridMethod · 0.95
insertGridMethod · 0.95
metadataMethod · 0.95
joinMethod · 0.80
VDBObjectMethod · 0.80
updateMetadataMethod · 0.80
CompoundObjectMethod · 0.80

Tested by

no test coverage detected