Commit ff3830b7 authored by matthmey's avatar matthmey
Browse files

clean up

parent 3816abf3
...@@ -79,7 +79,6 @@ class GSNDataSource(DataSource): ...@@ -79,7 +79,6 @@ class GSNDataSource(DataSource):
), ),
skiprows=0, skiprows=0,
) )
print(colnames)
columns_old = colnames["colname_old"].values columns_old = colnames["colname_old"].values
columns_new = colnames["colname_new"].values columns_new = colnames["colname_new"].values
columns_unit = colnames["unit"].values columns_unit = colnames["unit"].values
...@@ -169,7 +168,6 @@ class GSNDataSource(DataSource): ...@@ -169,7 +168,6 @@ class GSNDataSource(DataSource):
except: except:
pass pass
# Remove columns with only 'null' # Remove columns with only 'null'
df = df.replace(r"null", np.nan, regex=True) df = df.replace(r"null", np.nan, regex=True)
isnull = df.isnull().all() isnull = df.isnull().all()
...@@ -178,8 +176,6 @@ class GSNDataSource(DataSource): ...@@ -178,8 +176,6 @@ class GSNDataSource(DataSource):
df = df.set_index("time") df = df.set_index("time")
df = df.sort_index(axis=1) df = df.sort_index(axis=1)
print(df)
x = xr.DataArray(df, dims=["time", "name"], name="CSV") x = xr.DataArray(df, dims=["time", "name"], name="CSV")
try: try:
......
...@@ -46,15 +46,17 @@ class TestSeismicSource(object): ...@@ -46,15 +46,17 @@ class TestSeismicSource(object):
# TODO: make test to compare start_times # TODO: make test to compare start_times
@pytest.mark.slow
def test_gsn(): def test_gsn():
# test_data = pd.read_csv(test_data_dir + 'matterhorn_27_temperature_rock.csv',index_col='time') # test_data = pd.read_csv(test_data_dir + 'matterhorn_27_temperature_rock.csv',index_col='time')
gsn_node = stuett.data.GSNDataSource(deployment="matterhorn", position=30, vsensor="temperature_rock") gsn_node = stuett.data.GSNDataSource(deployment="matterhorn", position=30, vsensor="temperature_rock")
x = gsn_node({"start_time":"2017-07-01","end_time":"2017-07-02"}) x = gsn_node({"start_time":"2017-07-01","end_time":"2017-07-02"})
print(x)
assert x.sum() == 1600959.34
#TODO: proper testing
test_gsn() # test_gsn()
def test_delayed(): def test_delayed():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment