( self )
| 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 ): |
nothing calls this directly
no test coverage detected