File tree Expand file tree Collapse file tree 2 files changed +0
-45
lines changed
Expand file tree Collapse file tree 2 files changed +0
-45
lines changed Original file line number Diff line number Diff line change 11# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
3- import gzip
43import os
5- import shutil
6-
7-
8- def gunzip (filename ):
9- """ Decompress a file with gzip.
10-
11- Parameters
12- ----------
13- filename : str
14- Fully qualified path of the file to decompress.
15-
16- Returns
17- -------
18- filename : str
19- Name of the decompressed file (or input filename if gzip is not
20- available).
21- """
22-
23- # ".fz" denotes RICE rather than gzip compression
24- if not filename .endswith ('.fz' ):
25- with gzip .open (filename , 'rb' ) as f_in :
26- with open (filename .rsplit ("." , 1 )[0 ], 'wb' ) as f_out :
27- shutil .copyfileobj (f_in , f_out )
28- return filename .rsplit ("." , 1 )[0 ]
29- else :
30- return filename
314
325
336# If there is an update issue of astropy#2793 that got merged, this should
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments