Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: Fix bad escape codes #256

Merged
merged 4 commits into from
Nov 7, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions siphon/simplewebservice/ndbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _parse_met(content):
'time': None}

df = pd.read_table(StringIO(content), comment='#', na_values='MM',
names=col_names, sep='\s+')
names=col_names, sep=r'\s+')
df['time'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']], utc=True)
df = df.drop(columns=['year', 'month', 'day', 'hour', 'minute'])
df.units = col_units
Expand Down Expand Up @@ -142,7 +142,7 @@ def _parse_drift(content):
'time': None}

df = pd.read_table(StringIO(content), comment='#', na_values='MM',
names=col_names, sep='\s+')
names=col_names, sep=r'\s+')
df['hour'] = np.floor(df['hour_minute'] / 100)
df['minute'] = df['hour_minute'] - df['hour'] * 100
df['time'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']], utc=True)
Expand Down Expand Up @@ -176,7 +176,7 @@ def _parse_cwind(content):
'time': None}

df = pd.read_table(StringIO(content), comment='#', na_values='MM',
names=col_names, sep='\s+')
names=col_names, sep=r'\s+')
df['gust_direction'] = df['gust_direction'].replace(999, np.nan)
df['wind_gust'] = df['wind_gust'].replace(99.0, np.nan)
df['time'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']], utc=True)
Expand Down Expand Up @@ -224,7 +224,7 @@ def _parse_spec(content):
'time': None}

df = pd.read_table(StringIO(content), comment='#', na_values='MM',
names=col_names, sep='\s+')
names=col_names, sep=r'\s+')
df['time'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']], utc=True)
df = df.drop(columns=['year', 'month', 'day', 'hour', 'minute'])
df.units = col_units
Expand Down Expand Up @@ -263,7 +263,7 @@ def _parse_ocean(content):
'time': None}

df = pd.read_table(StringIO(content), comment='#', na_values='MM',
names=col_names, sep='\s+')
names=col_names, sep=r'\s+')
df['time'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']], utc=True)
df = df.drop(columns=['year', 'month', 'day', 'hour', 'minute'])
df.units = col_units
Expand Down Expand Up @@ -293,7 +293,7 @@ def _parse_srad(content):
'time': None}

df = pd.read_table(StringIO(content), comment='#', na_values='MM',
names=col_names, sep='\s+')
names=col_names, sep=r'\s+')
df['time'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']], utc=True)
df = df.drop(columns=['year', 'month', 'day', 'hour', 'minute'])
df.units = col_units
Expand Down Expand Up @@ -321,7 +321,7 @@ def _parse_dart(content):
'time': None}

df = pd.read_table(StringIO(content), comment='#', na_values='MM',
names=col_names, sep='\s+')
names=col_names, sep=r'\s+')

# Replace measurement type integer with minute value
# 1 = 15-minute measurement
Expand Down Expand Up @@ -358,7 +358,7 @@ def _parse_rain(content):
'time': None}

df = pd.read_table(StringIO(content), comment='#', na_values='MM',
names=col_names, sep='\s+')
names=col_names, sep=r'\s+')

df['time'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']], utc=True)
df = df.drop(columns=['year', 'month', 'day', 'hour', 'minute'])
Expand Down Expand Up @@ -392,7 +392,7 @@ def _parse_supl(content):
'time': None}

df = pd.read_table(StringIO(content), comment='#', na_values='MM',
names=col_names, sep='\s+')
names=col_names, sep=r'\s+')

df['time'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']], utc=True)

Expand Down Expand Up @@ -452,7 +452,7 @@ def latest_observations(cls):
resp = endpoint.get_path('data/latest_obs/latest_obs.txt')

df = pd.read_table(StringIO(resp.text), comment='#', na_values='MM',
names=col_names, sep='\s+')
names=col_names, sep=r'\s+')
df['time'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']], utc=True)
df = df.drop(columns=['year', 'month', 'day', 'hour', 'minute'])
df.units = col_units
Expand Down