Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
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
7 changes: 7 additions & 0 deletions src/python/tests_extended/test_dft_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,13 @@ def method(self):

for test_case in TEST_CASES:
test_name = 'test_%s' % test_case.replace('(', '_').replace(')', '').lower()

# The following test for far future time point. On Windows it's treated correctly as expected
# but for other OS, system_clock::time_point is defined as nanoseconds (64-bit),
# which rolls over somewhere around 2260.
if test_name in 'DateTimeSplitter_Complex' and (platform.system() == "Darwin" or platform.system() == "Linux"):
continue

method = TestOnnxExport.generate_test_method(test_case)
setattr(TestOnnxExport, test_name, method)

Expand Down
20 changes: 10 additions & 10 deletions src/python/tests_extended/test_tensor_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_datetimesplitter(self):

def test_datetimesplitter_complex(self):
training_data = pd.DataFrame(data=dict(
tokens1=[217081624, 1751241600, 217081625, 32445842582]
tokens1=[217081624, 1751241600, 217081625]
))

cols_to_drop = [
Expand All @@ -91,17 +91,17 @@ def test_datetimesplitter_complex(self):

sess = set_up_onnx_model(xf, training_data)

inferencing_data = np.array([217081624, 1751241600, 217081625, 32445842582]).astype(np.int64).reshape(4,1)
inferencing_data = np.array([217081624, 1751241600, 217081625]).astype(np.int64).reshape(4,1)
result = sess.run(None, {"tokens1": inferencing_data})

expected_years = np.array([1976, 2025, 1976, 2998]).reshape(4, 1)
expected_month = np.array([11, 6, 11, 3]).reshape(4, 1)
expected_day = np.array([17, 30, 17, 2]).reshape(4, 1)
expected_hour = np.array([12, 0, 12, 14]).reshape(4, 1)
expected_minute = np.array([27, 0, 27, 3]).reshape(4, 1)
expected_second = np.array([4, 0, 5, 2]).reshape(4, 1)
expected_ampm = np.array([1, 0, 1, 1]).reshape(4, 1)
expected_holidayname = np.array(["", "", "", ""]).reshape(4, 1)
expected_years = np.array([1976, 2025, 1976]).reshape(4, 1)
expected_month = np.array([11, 6, 11]).reshape(4, 1)
expected_day = np.array([17, 30, 17]).reshape(4, 1)
expected_hour = np.array([12, 0, 12]).reshape(4, 1)
expected_minute = np.array([27, 0, 27]).reshape(4, 1)
expected_second = np.array([4, 0, 5]).reshape(4, 1)
expected_ampm = np.array([1, 0, 1]).reshape(4, 1)
expected_holidayname = np.array(["", "", ""]).reshape(4, 1)

np.testing.assert_array_equal(result[1],expected_years)
np.testing.assert_array_equal(result[2],expected_month)
Expand Down
6 changes: 3 additions & 3 deletions src/python/tests_extended/test_tensor_invalid_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ def test_pivot_bad_shape(self):
for test_case_invalid_input in TEST_CASES_FOR_INVALID_INPUT:
test_name = 'test_%s' % test_case_invalid_input.replace('(', '_').replace(')', '').lower()

# The following test for negative timepoints. On Linux and Windows it throws as expected.
# On Mac negative timepoints are a valid input.
if test_name in 'test_datetimesplitter_bad_input_data' and platform.system() == "Darwin":
# The following test for negative timepoints. On Windows it throws as expected.
# On Mac and Linux negative timepoints are a valid input.
if test_name in 'test_datetimesplitter_bad_input_data' and (platform.system() == "Darwin" or platform.system() == "Linux"):
continue

method = TestOnnxExport.generate_test_method_for_bad(test_case_invalid_input)
Expand Down