self.assertEqual(nNod+2, m1_bis.getNumberOfNodes())
self.assertEqual([6,7], nodesDup.getValues())
self.assertEqual([2.,1., 3.,1.], m2_bis.getCoords()[nNod:].getValues())
- self.assertEqual(set([3,10,11]), set(cells1.getValues()))
- self.assertEqual(set([8,9,4,5]), set(cells2.getValues()))
+ self.assertEqual({3,10,11}, set(cells1.getValues()))
+ self.assertEqual({8,9,4,5}, set(cells2.getValues()))
self.assertEqual([9,11],mfu.getGroupArr(-1,"group").getValues())
self.assertEqual([23,24],mfu.getGroupArr(-1,"group_dup").getValues())
self.assertEqual([0,1],mfu.getGroupArr(-1,"group2").getValues())
self.assertEqual(nNod+1, m2_bis.getNumberOfNodes())
self.assertEqual([3], nodesDup.getValues())
self.assertEqual(m3_bis.getCoords()[3].getValues(), m3_bis.getCoords()[nNod:].getValues())
- self.assertEqual(set([22]), set(cells1.getValues()))
- self.assertEqual(set([77]), set(cells2.getValues()))
+ self.assertEqual({22}, set(cells1.getValues()))
+ self.assertEqual({77}, set(cells2.getValues()))
self.assertEqual([36,74],mfu.getGroupArr(-1,"group").getValues())
self.assertEqual([0,1],mfu.getGroupArr(0,"group_3d").getValues())
self.assertEqual([213],mfu.getGroupArr(-1,"group_dup").getValues()) # here only one cell has been duplicated
m=m.buildUnstructured()
m.setName("mm")
f=m.getMeasureField(False)
- self.assertIn(m.getHeapMemorySize(),range(3552-100,3552+100+4*strMulFac))
- self.assertIn(f.getHeapMemorySize(),range(4215-100,4215+100+8*strMulFac))
+ self.assertIn(m.getHeapMemorySize(),list(range(3552-100,3552+100+4*strMulFac)))
+ self.assertIn(f.getHeapMemorySize(),list(range(4215-100,4215+100+8*strMulFac)))
#
mm=MEDFileUMesh()
mm.setMeshAtLevel(0,m)
- self.assertIn(mm.getHeapMemorySize(),range(3889-100,4225+100+10*strMulFac))
+ self.assertIn(mm.getHeapMemorySize(),list(range(3889-100,4225+100+10*strMulFac)))
ff=MEDFileField1TS()
ff.setFieldNoProfileSBT(f)
- self.assertIn(ff.getHeapMemorySize(),range(771-40,871+21+(4+1)*strMulFac))
+ self.assertIn(ff.getHeapMemorySize(),list(range(771-40,871+21+(4+1)*strMulFac)))
#
fff=MEDFileFieldMultiTS()
fff.appendFieldNoProfileSBT(f)
- self.assertIn(fff.getHeapMemorySize(),range(815-50,915+30+(6+2)*strMulFac))
+ self.assertIn(fff.getHeapMemorySize(),list(range(815-50,915+30+(6+2)*strMulFac)))
f.setTime(1.,0,-1)
fff.appendFieldNoProfileSBT(f)
- self.assertIn(fff.getHeapMemorySize(),range(1594-90,1794+50+(10+1)*strMulFac))
- self.assertIn(fff[0,-1].getHeapMemorySize(),range(771-40,871+20+(4+1)*strMulFac))
+ self.assertIn(fff.getHeapMemorySize(),list(range(1594-90,1794+50+(10+1)*strMulFac)))
+ self.assertIn(fff[0,-1].getHeapMemorySize(),list(range(771-40,871+20+(4+1)*strMulFac)))
f2=f[:50]
f2.setTime(2.,1,-1)
pfl=DataArrayInt.Range(0,50,1) ; pfl.setName("pfl")
fff.appendFieldProfile(f2,mm,0,pfl)
- self.assertIn(fff.getHeapMemorySize(),range(2348-130,2608+100+(10+2)*strMulFac))
- self.assertIn(fff.getProfile("pfl").getHeapMemorySize(),range(204-10,204+10+2*strMulFac))
- self.assertIn(fff[1,-1].getHeapMemorySize(),range(738-50,838+30+4*strMulFac))
+ self.assertIn(fff.getHeapMemorySize(),list(range(2348-130,2608+100+(10+2)*strMulFac)))
+ self.assertIn(fff.getProfile("pfl").getHeapMemorySize(),list(range(204-10,204+10+2*strMulFac)))
+ self.assertIn(fff[1,-1].getHeapMemorySize(),list(range(738-50,838+30+4*strMulFac)))
pass
def testCurveLinearMesh1(self):
self.assertTrue(not ff0.getUndergroundDataArray().isAllocated())
self.assertEqual(ff0.getUndergroundDataArray().getInfoOnComponents(),['X [km]','YY [mm]'])
heap_memory_ref=ff0.getHeapMemorySize()
- self.assertIn(heap_memory_ref,range(182,465+2*strMulFac))
+ self.assertIn(heap_memory_ref,list(range(182,465+2*strMulFac)))
ff0.loadArrays() ##
arr=DataArrayDouble(140) ; arr.iota() ; arr.rearrange(2)
self.assertTrue(ff0.getUndergroundDataArray().isEqualWithoutConsideringStr(arr,1e-14))
ff0=MEDFileField1TS(fname,"FieldCellPfl",False)
self.assertEqual(ff0.getUndergroundDataArray().getInfoOnComponents(),["XX [pm]","YYY [hm]"])
heap_memory_ref=ff0.getHeapMemorySize()
- self.assertIn(heap_memory_ref,range(350,520+6*strMulFac))
+ self.assertIn(heap_memory_ref,list(range(350,520+6*strMulFac)))
ff0.loadArrays() ##
arr=DataArrayDouble(100) ; arr.iota() ; arr.rearrange(2)
self.assertTrue(ff0.getUndergroundDataArray().isEqualWithoutConsideringStr(arr,1e-14))
self.assertEqual(ff0.getUndergroundDataArray().getIJ(30,1),5.5)
self.assertTrue(not ff0.getUndergroundDataArray().isEqualWithoutConsideringStr(arr,1e-14))
heap_memory_ref=ff0.getHeapMemorySize()
- self.assertIn(heap_memory_ref,range(1100,1384+2*strMulFac))
+ self.assertIn(heap_memory_ref,list(range(1100,1384+2*strMulFac)))
ff0.unloadArrays()
hmd=ff0.getHeapMemorySize()-heap_memory_ref
self.assertEqual(hmd,-800) # -50*8*2
#
ff0=MEDFileField1TS(fname,"FieldCellPfl",-1,-1,False)
heap_memory_ref=ff0.getHeapMemorySize()
- self.assertIn(heap_memory_ref,range(299,520+6*strMulFac))
+ self.assertIn(heap_memory_ref,list(range(299,520+6*strMulFac)))
ff0.loadArrays() ##
self.assertTrue(ff0.getUndergroundDataArray().isEqualWithoutConsideringStr(arr,1e-14))
self.assertEqual(ff0.getHeapMemorySize()-heap_memory_ref,50*8*2)
#
ff0=MEDFileAnyTypeFieldMultiTS.New(fname,fieldName,False)
heap_memory_ref=ff0.getHeapMemorySize()
- self.assertIn(heap_memory_ref,range(5536,8212+(80+26+1)*strMulFac))
+ self.assertIn(heap_memory_ref,list(range(5536,8212+(80+26+1)*strMulFac)))
ff0.loadArrays()
self.assertEqual(ff0.getHeapMemorySize()-heap_memory_ref,20*70*8*2)
del ff0
#
ffs=MEDFileFields(fname,False)
heap_memory_ref=ffs.getHeapMemorySize()
- self.assertIn(heap_memory_ref,range(5335,9031+(80+50+len(ffs))*strMulFac))
+ self.assertIn(heap_memory_ref,list(range(5335,9031+(80+50+len(ffs))*strMulFac)))
ffs.loadArrays()
self.assertEqual(ffs.getHeapMemorySize()-heap_memory_ref,20*70*8*2+70*8*2+50*8*2)
pass
tester.assertTrue(mm.getFamilyFieldAtLevel(-1).isEqual(DataArrayInt([6,7,200,201,202,8,9,10,11,203,204,205,206,207])))
tester.assertTrue(mm.getNumberFieldAtLevel(-1).isEqual(DataArrayInt([16,17,300,301,302,18,19,20,21,303,304,305,306,307])))
refFamIds=[("FAMILLE_ZERO",0),('F1',1),('F2',2),('F3',3),('F4',4),('F5',5),('F6',6),('F7',7),('F8',8),('F9',9),('G1',31),('G10',40),('G11',41),('G2',32),('G3',33),('G4',34),('G5',35),('G6',36),('G7',37),('G8',38),('G9',39),("H1",100)]
- tester.assertEqual(set(mm.getFamiliesNames()),set([elt[0] for elt in refFamIds]))
- tester.assertEqual(set([mm.getFamilyId(elt) for elt in mm.getFamiliesNames()]),set([elt[1] for elt in refFamIds]))
+ tester.assertEqual(set(mm.getFamiliesNames()),{elt[0] for elt in refFamIds})
+ tester.assertEqual({mm.getFamilyId(elt) for elt in mm.getFamiliesNames()},{elt[1] for elt in refFamIds})
tester.assertEqual(mm.getGroupsNames(),('myGRP','myGRP1','myGRP2'))
tester.assertEqual(mm.getAllDistributionOfTypes(),[(NORM_TRI3,5),(NORM_QUAD4,9),(NORM_TETRA4,5),(NORM_PENTA6,4),(NORM_ERROR,9)])
pass