Skip to content

Commit

Permalink
Fixed issue that caused integs to fail in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ifeoluwaale committed Dec 25, 2023
1 parent 30637e3 commit 86e467a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions tests/integs/test_integ_chron.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
import dplpy as dpl

def test_chron_no_prewhiten_no_biweight():
data = dpl.readers("../tests/data/csv/ca533.csv")
data = dpl.readers("./tests/data/csv/ca533.csv")

res = dpl.chron(data, biweight=False, prewhiten=False, plot=False)
# TODO: assert contents of res


def test_chron_prewhiten_no_biweight():
data = dpl.readers("../tests/data/csv/ca533.csv")
data = dpl.readers("./tests/data/csv/ca533.csv")

res = dpl.chron(data, biweight=True, prewhiten=False, plot=False)
# TODO: assert contents of res

def test_chron_prewhiten_with_biweight():
data = dpl.readers("../tests/data/csv/ca533.csv")
data = dpl.readers("./tests/data/csv/ca533.csv")

res = dpl.chron(data, biweight=True, prewhiten=True, plot=False)
# TODO: assert contents of res


# def test_chron_prewhiten_biweight_plot():
# data = dpl.readers("../integs/data/csv/ca533.csv")
# data = dpl.readers("./integs/data/csv/ca533.csv")

# res = dpl.chron(data, biweight=True, prewhiten=True, plot=True)
# # TODO: assert contents of res
Expand Down
6 changes: 3 additions & 3 deletions tests/integs/test_integ_detrend.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os

def test_detrend_all_fits_residual():
data = dpl.readers("../tests/data/csv/ca533.csv")
data = dpl.readers("./tests/data/csv/ca533.csv")

spline_data = dpl.detrend(data, fit="spline", method="residual", plot=False)
modnegex_data = dpl.detrend(data, fit="ModNegEx", method="residual", plot=False)
Expand All @@ -15,7 +15,7 @@ def test_detrend_all_fits_residual():
# TODO: assert detrended data for correctness

def test_detrend_all_fits_difference():
data = dpl.readers("../tests/data/csv/ca533.csv")
data = dpl.readers("./tests/data/csv/ca533.csv")

spline_data = dpl.detrend(data, fit="spline", method="difference", plot=False)
modnegex_data = dpl.detrend(data, fit="ModNegEx", method="difference", plot=False)
Expand All @@ -27,7 +27,7 @@ def test_detrend_all_fits_difference():

# Commented out because plots block execution in vscode. WIP
# def test_detrend_all_fits_plot():
# data = dpl.readers("../integs/data/csv/ca533.csv")
# data = dpl.readers("./integs/data/csv/ca533.csv")

# spline_data = dpl.detrend(data, fit="spline", method="difference", plot=True)
# modnegex_data = dpl.detrend(data, fit="ModNegEx", method="difference", plot=True)
Expand Down
12 changes: 6 additions & 6 deletions tests/integs/test_integ_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

# #TODO: assert content of plots somehow
# def test_seg_plots():
# ca533 = dpl.readers("../integs/data/csv/ca533.csv")
# ca667 = dpl.readers("../integs/data/rwl/ca667.rwl", header=True)
# ca533 = dpl.readers("./integs/data/csv/ca533.csv")
# ca667 = dpl.readers("./integs/data/rwl/ca667.rwl", header=True)

# dpl.plot(ca533, "seg")
# dpl.plot(ca667, "seg")


# def test_spag_plots():
# ca533 = dpl.readers("../integs/data/csv/ca533.csv")
# ca667 = dpl.readers("../integs/data/rwl/ca667.rwl", header=True)
# ca533 = dpl.readers("./integs/data/csv/ca533.csv")
# ca667 = dpl.readers("./integs/data/rwl/ca667.rwl", header=True)

# dpl.plot(ca533, "spag")
# dpl.plot(ca667, "spag")

# def test_line_plots():
# ca533 = dpl.readers("../integs/data/csv/ca533.csv")
# ca667 = dpl.readers("../integs/data/rwl/ca667.rwl", header=True)
# ca533 = dpl.readers("./integs/data/csv/ca533.csv")
# ca667 = dpl.readers("./integs/data/rwl/ca667.rwl", header=True)

# dpl.plot(ca533, "line")
# dpl.plot(ca667, "line")
Expand Down
10 changes: 5 additions & 5 deletions tests/integs/test_integ_readers_and_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os

def test_read_and_write_csv(tmp_path):
ca533 = dpl.readers("../tests/data/csv/ca533.csv")
ca533 = dpl.readers("./tests/data/csv/ca533.csv")

write_path = os.path.join(tmp_path,"test_write")

Expand All @@ -16,7 +16,7 @@ def test_read_and_write_csv(tmp_path):


def test_read_and_write_rwl_no_headers(tmp_path):
viet001 = dpl.readers("../tests/data/rwl/viet001.rwl")
viet001 = dpl.readers("./tests/data/rwl/viet001.rwl")

write_path = os.path.join(tmp_path, "test_write")

Expand All @@ -28,7 +28,7 @@ def test_read_and_write_rwl_no_headers(tmp_path):


def test_read_and_write_rwl_with_headers(tmp_path):
th001 = dpl.readers("../tests/data/rwl/th001.rwl", header=True)
th001 = dpl.readers("./tests/data/rwl/th001.rwl", header=True)

write_path = os.path.join(tmp_path, "test_write")

Expand All @@ -40,7 +40,7 @@ def test_read_and_write_rwl_with_headers(tmp_path):


def test_read_and_write_long_rwl(tmp_path):
ca667 = dpl.readers("../tests/data/rwl/ca667.rwl", header=True)
ca667 = dpl.readers("./tests/data/rwl/ca667.rwl", header=True)

write_path = os.path.join(tmp_path, "test_write")

Expand All @@ -51,7 +51,7 @@ def test_read_and_write_long_rwl(tmp_path):
pd.testing.assert_frame_equal(ca667, ca667_alt)

def test_read_and_write_weird_rwl(tmp_path):
wwr = dpl.readers("../tests/data/rwl/wwr.rwl")
wwr = dpl.readers("./tests/data/rwl/wwr.rwl")

write_path = os.path.join(tmp_path, "test_write")

Expand Down
2 changes: 1 addition & 1 deletion tests/integs/test_integ_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os

def test_summary_methods():
data = dpl.readers("../tests/data/csv/ca533.csv")
data = dpl.readers("./tests/data/csv/ca533.csv")

dpl.summary(data)
dpl.report(data)
Expand Down
10 changes: 5 additions & 5 deletions tests/integs/test_integ_xdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
import os

def test_xdate_diff_bins():
ca533 = dpl.readers("../tests/data/csv/ca533.csv")
ca533 = dpl.readers("./tests/data/csv/ca533.csv")

ca533_bindata_1 = dpl.xdate(ca533, bin_floor=0)
ca533_bindata_2 = dpl.xdate(ca533, bin_floor=10)
ca533_bindata_3 = dpl.xdate(ca533, bin_floor=100)

def test_xdate_diff_slide_periods():
ca533 = dpl.readers("../tests/data/csv/ca533.csv")
ca533 = dpl.readers("./tests/data/csv/ca533.csv")

ca533_bindata_1 = dpl.xdate(ca533, slide_period=30)
ca533_bindata_2 = dpl.xdate(ca533, slide_period=50)
ca533_bindata_3 = dpl.xdate(ca533, slide_period=80)

def test_xdate_diff_corrs():
ca667 = dpl.readers("../tests/data/rwl/ca667.rwl", header=True)
ca667 = dpl.readers("./tests/data/rwl/ca667.rwl", header=True)

ca667_bindata_1 = dpl.xdate(ca667, corr="Spearman")
ca667_bindata_2 = dpl.xdate(ca667, corr="Pearson")

def test_xdate_not_prewhitened():
ca667 = dpl.readers("../tests/data/rwl/ca667.rwl", header=True)
ca667 = dpl.readers("./tests/data/rwl/ca667.rwl", header=True)

ca667_bindata = dpl.xdate(ca667, prewhiten=False)

# Commented out because plots block execution in vscode. WIP
# def test_xdate_plot():
# co021 = dpl.readers("../integs/data/rwl/co021.rwl")
# co021 = dpl.readers("./integs/data/rwl/co021.rwl")

# dpl.xdate_plot(co021)
6 changes: 3 additions & 3 deletions tests/integs/test_variance_stab.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
import pandas as pd

def test_chron_stab_no_biweight():
data = dpl.readers("../tests/data/csv/ca533.csv")
data = dpl.readers("./tests/data/csv/ca533.csv")

res = dpl.chron_stabilized(data, biweight=False)
# TODO: assert contents of res


def test_chron_stab_with_biweight():
data = dpl.readers("../tests/data/csv/ca533.csv")
data = dpl.readers("./tests/data/csv/ca533.csv")

res = dpl.chron_stabilized(data)
# TODO: assert contents of res

def test_chron_stab_with_running_rbar():
data = dpl.readers("../tests/data/csv/ca533.csv")
data = dpl.readers("./tests/data/csv/ca533.csv")

res = dpl.chron_stabilized(data, running_rbar=True)
# TODO: assert contents of res

0 comments on commit 86e467a

Please sign in to comment.