Skip to content

Commit

Permalink
Fixed syntax in imports and get_data
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonRaker committed Oct 19, 2015
1 parent b37ae22 commit e60e1f8
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions siphon/ncss.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import xml.etree.ElementTree as ET
import atexit
from io import BytesIO
from os import remove
import platform

import numpy as np
import os
import platform
import atexit

from .http_util import DataQuery, HTTPEndPoint, parse_iso_date
from .ncss_dataset import NCSSDataset
Expand Down Expand Up @@ -357,25 +357,14 @@ def read_netcdf(data, handle_units): # pylint:disable=unused-argument
tmp_file.flush()
return Dataset(tmp_file.name, 'r')

# def temp_opener(name, flag, mode=0o777):
# return os.open(name, flag | os.O_TEMPORARY, mode)

# with tempfile.NamedTemporaryFile() as f:
# f.write(DATA)
# f.flush()
# with open(f.name, "rb", opener=temp_opener) as f:
# assert f.read() == DATA

# assert not os.path.exists(f.name)

except ImportError:
import warnings
warnings.warn('netCDF4 module not installed. '
'Will be unable to handle NetCDF returns from NCSS.')

def deletetempfile(fname):
try:
os.remove(fname)
remove(fname)
except PermissionError:
import warnings
warnings.warn('temporary netcdf dataset file not deleted. '
Expand Down

0 comments on commit e60e1f8

Please sign in to comment.