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

Relaxed dtype check in tests #80

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion pecos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pecos import utils
from pecos import pv

__version__ = '0.3.0'
__version__ = '0.3.1'

__copyright__ = """Copyright 2016 National Technology & Engineering
Solutions of Sandia, LLC (NTESS). Under the terms of Contract
Expand Down
16 changes: 8 additions & 8 deletions pecos/tests/test_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def test_check_exact_times_true(self):
columns=['Variable Name', 'Start Time', 'End Time', 'Timesteps', 'Error Flag'],
index=pd.RangeIndex(start=0, stop=1, step=1)
)
assert_frame_equal(expected, self.pm.test_results)
assert_frame_equal(expected, self.pm.test_results, check_dtype=False)

def test_check_exact_times_false(self):
self.pm.check_timestamp(3600, exact_times=False)
Expand All @@ -358,7 +358,7 @@ def test_check_exact_times_false(self):
columns=['Variable Name', 'Start Time', 'End Time', 'Timesteps', 'Error Flag'],
index=pd.RangeIndex(start=0, stop=1, step=1)
)
assert_frame_equal(expected, self.pm.test_results)
assert_frame_equal(expected, self.pm.test_results, check_dtype=False)

def test_check_exact_times_true_with_start_time(self):
self.pm.check_timestamp(3600, expected_start_time=pd.Timestamp('2016-10-17 01:00:00'),
Expand All @@ -370,7 +370,7 @@ def test_check_exact_times_true_with_start_time(self):
columns=['Variable Name', 'Start Time', 'End Time', 'Timesteps', 'Error Flag'],
index=pd.RangeIndex(start=0, stop=1, step=1)
)
assert_frame_equal(expected, self.pm.test_results)
assert_frame_equal(expected, self.pm.test_results, check_dtype=False)


class Test_check_delta(unittest.TestCase):
Expand Down Expand Up @@ -401,7 +401,7 @@ def test_deadsensor(self):
index=pd.RangeIndex(start=0, stop=2, step=1)
)
#pecos.graphics.plot_test_results(self.pm.df, self.pm.test_results, filename_root='test_deadsensor')
assert_frame_equal(expected, self.pm.test_results)
assert_frame_equal(expected, self.pm.test_results, check_dtype=False)

def test_increment_deadsensor(self):
# As expected, check_increment does not produce the same results as check_delta
Expand All @@ -418,7 +418,7 @@ def test_abrupt_change(self):
columns=['Variable Name', 'Start Time', 'End Time', 'Timesteps', 'Error Flag'],
index=pd.RangeIndex(start=0, stop=3, step=1)
)
assert_frame_equal(expected, self.pm.test_results)
assert_frame_equal(expected, self.pm.test_results, check_dtype=False)

def test_abrupt_positive_change(self):
# abrupt positive change = > 7 in 3 hours
Expand All @@ -429,7 +429,7 @@ def test_abrupt_positive_change(self):
columns=['Variable Name', 'Start Time', 'End Time', 'Timesteps', 'Error Flag'],
index=pd.RangeIndex(start=0, stop=2, step=1)
)
assert_frame_equal(expected, self.pm.test_results)
assert_frame_equal(expected, self.pm.test_results, check_dtype=False)

def test_abrupt_negative_change(self):
# abrupt negative change = < 7 in 3 hours
Expand All @@ -439,7 +439,7 @@ def test_abrupt_negative_change(self):
columns=['Variable Name', 'Start Time', 'End Time', 'Timesteps', 'Error Flag'],
index=pd.RangeIndex(start=0, stop=1, step=1)
)
assert_frame_equal(expected, self.pm.test_results)
assert_frame_equal(expected, self.pm.test_results, check_dtype=False)

def test_delta_scale(self, output=False):
# The following function was used to test scalability of the delta test
Expand Down Expand Up @@ -545,7 +545,7 @@ def test_outlier(self):
columns=['Variable Name', 'Start Time', 'End Time', 'Timesteps', 'Error Flag'],
index=pd.RangeIndex(start=0, stop=2, step=1)
)
assert_frame_equal(expected, self.pm.test_results)
assert_frame_equal(expected, self.pm.test_results, check_dtype=False)

# Functional tests
results = pecos.monitoring.check_outlier(self.pm.data, [None, 1.9], window=None, absolute_value=True )
Expand Down
Loading