Skip to content

Commit 5910324

Browse files
committed
Enable gallery load_dataset() to handle zipped shape files MPY-306
1 parent 283f713 commit 5910324

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

metview/gallery.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@
77
# granted to it by virtue of its status as an intergovernmental organisation
88
# nor does it submit to any jurisdiction.
99

10+
import zipfile
11+
1012
import metview as mv
1113

1214

1315
def load_dataset(filename):
1416
base_url = "http://download.ecmwf.org/test-data/metview/gallery/"
1517
try:
1618
d = mv.download(url=base_url + filename, target=filename)
19+
if filename.endswith(".zip"):
20+
with zipfile.ZipFile(filename, "r") as f:
21+
f.extractall()
1722
return d
1823
except:
1924
raise Exception(

0 commit comments

Comments
 (0)