def test_curveCache(self): 'Ensure that curve caching works properly' # Prepare simple curve settings curvePack1 = 'ZeroLinear', ((0, 1), (1, 1)) curvePack2 = 'ZeroLogistic', ((0, 1), (1, 1)) # Fit curves c1 = curve.fit(*curvePack1) c2 = curve.fit(*curvePack2) c3 = curve.fit(*curvePack1) # Make sure that we are getting the same exact curve self.assertNotEqual(id(c1), id(c2)) self.assertEqual(id(c1), id(c3))
def compute(self): curveType = self.get(SocialInfrastructureDemandCurveType) curvePoints = self.get(SocialInfrastructureDemandCurvePoints) return curve.fit(curveType, curvePoints)
def compute(self): curveType = self.get(ProductiveDemandCurveType) curvePoints = self.get(ProductiveDemandCurvePoints) return curve.fit(curveType, curvePoints)
def compute(self): curveType = self.get(HouseholdDemandCurveType) curvePoints = self.get(HouseholdDemandCurvePoints) return curve.fit(curveType, curvePoints)
def compute(self): curveType = self.get(PublicLightingFacilityCountCurveType) curvePoints = self.get(PublicLightingFacilityCountCurvePoints) return curve.fit(curveType, curvePoints)
def compute(self): curveType = self.get(CommercialFacilityCountCurveType) curvePoints = self.get(CommercialFacilityCountCurvePoints) return curve.fit(curveType, curvePoints)
def compute(self): curveType = self.get(EducationFacilityCountCurveType) curvePoints = self.get(EducationFacilityCountCurvePoints) return curve.fit(curveType, curvePoints)