Esempio n. 1
0
 def dim_y(self, resolution):
     """docstring for _dim_y"""
     # hmmm, this if decreases performance. should we care?
     if resolution not in self.resolutions:
         raise ValueError("Resolution %d not in tiling scheme" % resolution)
     return int(
         roundceil(self.height / (float(resolution) * self.tilesize[1])))
Esempio n. 2
0
	def dim_y(self, resolution):
		"""docstring for _dim_y"""
		# hmmm, this if decreases performance. should we care?
		if resolution not in self.resolutions:
			raise ValueError("Resolution %d not in tiling scheme" % resolution)
		return int(roundceil(self.height / (float(resolution) * self.tilesize[1])))
    def test_roundceil_round(self):
		
		# hitting the rounding case
        self.assertEqual(roundceil(1.00000001), 1)
        self.assertEqual(roundceil(1.001, epsilon=0.1), 1)
    def test_roundceil_ceil(self):

		# hitting the ceiling case
        self.assertEqual(roundceil(1.1), 2)
        self.assertEqual(roundceil(1.01, epsilon=0.001), 2)