diff --git a/pycoast/cw_base.py b/pycoast/cw_base.py index 49e3268..f270ffb 100644 --- a/pycoast/cw_base.py +++ b/pycoast/cw_base.py @@ -649,8 +649,8 @@ def _iterate_db(self, db_name, tag, resolution, level, zero_pad, db_root_path=No else: format_string += 'L%s.shp' - if type(level) not in (list,): - level = range(1,level+1) + if not isinstance(level, list): + level = range(1, level + 1) for i in level: @@ -792,13 +792,6 @@ def add_overlay_from_dict(self, overlays, area_def, cache_epoch=None, background params = DEFAULT.copy() params.update(overlays[section]) - params['level'] = int(params['level']) - params['x_offset'] = float(params['x_offset']) - params['y_offset'] = float(params['y_offset']) - params['width'] = float(params['width']) - params['outline_opacity'] = int(params['outline_opacity']) - params['fill_opacity'] = int(params['fill_opacity']) - if section != "coasts": params.pop('fill_opacity', None) params.pop('fill', None) diff --git a/pycoast/tests/test_pycoast.py b/pycoast/tests/test_pycoast.py index 0b9d1de..cf34154 100644 --- a/pycoast/tests/test_pycoast.py +++ b/pycoast/tests/test_pycoast.py @@ -753,7 +753,7 @@ def test_foreground(self): self.assertTrue(fft_metric(euro_data, res), 'Writing of contours failed') - overlays = {'coasts': {'level': 4, 'resolution': 'l'}, + overlays = {'coasts': {'level': [1, 2, 3, 4], 'resolution': 'l'}, 'borders': {'outline': (255, 0, 0), 'resolution': 'c'}, 'rivers': {'outline': 'blue', 'resolution': 'c', 'level': 5}}