コード例 #1
0
	def createTestObjs(self):
		#Create co-ordinates
		self.cellA = uCellHelp.UnitCell(lattParams=self.lattParams, lattAngles=self.lattAngles)
		self.cellA.cartCoords = self.coords

		#Create a simple one-step trajectory
		self.stepA = trajCoreHelp.TrajStepFlexible(unitCell=self.cellA)
		self.trajA = trajCoreHelp.TrajectoryInMemory([self.stepA])

		#Create bins then options objects
		self.distBinsA = binResHelp.BinnedResultsStandard.fromBinEdges(self.distBinEdgesA)
		self.planarBinsA = binResHelp.BinnedResultsStandard.fromBinEdges(self.planarBinEdgesA)

		self.distBinsB = binResHelp.BinnedResultsStandard.fromBinEdges(self.distBinEdgesB)
		self.planarBinsB = binResHelp.BinnedResultsStandard.fromBinEdges(self.planarBinEdgesB)

#binResObj, indicesA, indicesB, volume=None, minDistAToB=False):
		self.minDistsOptsA = calcDistribCoreHelp.CalcRdfOptions(self.distBinsA, self.indicesA_optsA, self.indicesB_optsA, minDistAToB=True)
		self.minDistsOptsB = calcDistribCoreHelp.CalcRdfOptions(self.distBinsB, self.indicesA_optsB, self.indicesB_optsB, minDistAToB=True)

#binResObj, indices, planeEqn=None, volume=None):
		self.planarDistOptsA = calcRadImpl.CalcPlanarRdfOptions(self.planarBinsA, self.indicesA_optsA)
		self.planarDistOptsB = calcRadImpl.CalcPlanarRdfOptions(self.planarBinsB, self.indicesA_optsB)

		self.optsObjs = [ [self.minDistsOptsA, self.planarDistOptsA], [self.minDistsOptsB, self.planarDistOptsB] ]
コード例 #2
0
	def createTestObjs(self):
		dudBinObj = None

		currArgs = [dudBinObj, self.primaryIndices, [2,8,9]]
		self.distOptsObj = calcDistribCoreHelp.CalcRdfOptions(*currArgs, minDistAToB=True)

		currArgs = [dudBinObj, self.primaryIndices]
		self.planarDistsOptsObj = calcRadImpl.CalcPlanarRdfOptions(*currArgs)
コード例 #3
0
 def testExpectedCaseA_commandInterface(self):
     optsObj = tCode.CalcPlanarRdfOptions(self.binResObjA,
                                          self.indicesA,
                                          planeEqn=self.planeEqn,
                                          volume=self.inpVolumes)
     expBinObj = self._loadExpBinsCaseA()
     tCode.populatePlanarRdfsFromOptionsObjs(self.trajA, [optsObj])
     actBinObj = self.binResObjA
     self.assertEqual(expBinObj, actBinObj)
	def createTestObjs(self):
		#Geom
		self.cellA = uCellHelp.UnitCell(lattParams=self.lattParams, lattAngles=self.lattAngles)
		self.cellA.cartCoords = self.coords

		#Options objects
		currArgs = [self.rdfBinObj, self.indicesA, self.indicesB]
		self.rdfOptObj = distrOptObjHelp.CalcRdfOptions(*currArgs, minDistAToB=self.minDistAToB, filterBasedOnBins=self.rdfFilterBasedOnBins)
		self.planarOptObj = calcRadImpl.CalcPlanarRdfOptions(self.dudBinResObj, self.indicesA, planeEqn=self.planeEqn)

		#Create sparse matrix populator and populate it
		self.sparseMatrixObj = atomComboObjsMapHelp.getSparseMatrixCalculatorFromOptsObjIter([self.rdfOptObj, self.planarOptObj])
		self.sparseMatrixObj.calcMatricesForGeom(self.cellA)

		#Create the binner object
		self.testObj = atomComboObjsMapHelp.getMultiDimBinValGetterFromOptsObjs([self.rdfOptObj,self.planarOptObj])
	def createTestObjs(self):
		#Create the geometry
		self.cellA = uCellHelp.UnitCell(lattParams=self.lattParams, lattAngles=self.lattAngles)
		self.cellA.cartCoords = self.coords

		#Create opts for both planar and min dists
		dudBinsObj = None
		self.planarOpts = calcRadImpl.CalcPlanarRdfOptions(dudBinsObj, self.planarIndices, planeEqn=self.planeEqn)
		self.optsObj = calcDistribCoreHelp.CalcRdfOptions(dudBinsObj, self.fromIndices, self.toIndices, minDistAToB=True)


		#Create sparse matrix object + populate arrays
		self.sparseMatrixObj = atomComboObjsMapHelp.getSparseMatrixCalculatorFromOptsObjIter([self.planarOpts, self.optsObj])
		self.sparseMatrixObj.calcMatricesForGeom(self.cellA)

		#Create the individual binner objects
		self.planarBinner = tCode._PlanarDistsGetOneDimValsToBin(self.planeEqn, self.planarIndices)
		self.minDistBinner = tCode._MinDistsGetOneDimValsToBin(self.fromIndices, self.toIndices)

		#Create the binner object
		self.testObj = atomComboCoreHelp._GetMultiDimValsToBinFromSparseMatrices([self.planarBinner, self.minDistBinner])
コード例 #6
0
	def testExpectedCallToPopulate_forPlanarRdfObj(self, mockPopulateOpts):
		#Only care about what type of class these options are
		optsA = calcRadDistribImplHelp.CalcPlanarRdfOptions(self.binObjA, [1])
		optsB = calcRadDistribImplHelp.CalcPlanarRdfOptions(self.binObjA, [1])
		tCode._populateInpOptsUsingTrajs([[optsA, optsB]], self.inpTrajs)
		mockPopulateOpts.assert_called()
コード例 #7
0
 def createTestObjs(self):
     binVals = {"rdf": self.rdfVals}
     self.binResA = binResHelp.BinnedResultsStandard.fromBinEdges(
         self.binEdges, binVals=binVals)
     self.optObjA = tCode.CalcPlanarRdfOptions(self.binResA, None)
コード例 #8
0
	def createTestObjs(self):
		dudBinObj, dudSecondaryIndices = None, [5]

		currArgs = [dudBinObj, self.primaryIndicesA, dudSecondaryIndices]
		self.objA = calcDistribCoreHelp.CalcRdfOptions(*currArgs, minDistAToB=True)
		self.objB = calcRadImpl.CalcPlanarRdfOptions(dudBinObj, self.primaryIndicesB)