From b038e69335d2b707fbaf1fe7e621468725ea7626 Mon Sep 17 00:00:00 2001
From: "E. Joshua Rigler" <erigler@usgs.gov>
Date: Mon, 10 Jun 2024 21:41:41 -0600
Subject: [PATCH] Changes to Adjustedalgorithm_test module

It was necessary to explicitly set inchannels and outchannels when
instantiating the AdjustedAlgorithm class in unit tests after other
changes in this MR were made to remove the hard-coded default
inchannels and outchannels.
---
 test/algorithm_test/AdjustedAlgorithm_test.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/test/algorithm_test/AdjustedAlgorithm_test.py b/test/algorithm_test/AdjustedAlgorithm_test.py
index 220d498c6..d5f0b9d89 100644
--- a/test/algorithm_test/AdjustedAlgorithm_test.py
+++ b/test/algorithm_test/AdjustedAlgorithm_test.py
@@ -54,7 +54,9 @@ def test_process_XYZF_AdjustedMatrix():
                 [0, 0, 0, 1],
             ],
             pier_correction=-22,
-        )
+        ),
+        inchannels=["H", "E", "Z", "F"],
+        outchannels=["X", "Y", "Z", "F"],
     )
 
     # load boulder Jan 16 files from /etc/ directory
@@ -114,7 +116,11 @@ def test_process_XYZF_statefile():
     Uses statefile to generate AdjustedMatrix
     """
     # load adjusted data transform matrix and pier correction
-    a = AdjustedAlgorithm(statefile="etc/adjusted/adjbou_state_.json")
+    a = AdjustedAlgorithm(
+        statefile="etc/adjusted/adjbou_state_.json",
+        inchannels=["H", "E", "Z", "F"],
+        outchannels=["X", "Y", "Z", "F"],
+    )
 
     # load boulder Jan 16 files from /etc/ directory
     with open("etc/adjusted/BOU201601vmin.min") as f:
@@ -167,11 +173,12 @@ def test_process_no_statefile():
     Uses default AdjustedMatrix with identity transform
     """
     # initialize adjusted algorithm with no statefile
-    a = AdjustedAlgorithm()
+    a = AdjustedAlgorithm(inchannels=["H", "E", "Z", "F"])
     # load boulder Jan 16 files from /etc/ directory
     with open("etc/adjusted/BOU201601vmin.min") as f:
         raw = i2.IAGA2002Factory().parse_string(f.read())
     # process hezf (raw) channels with identity transform
+    print(a.matrix)
     adjusted = a.process(raw)
     for i in range(len(adjusted)):
         assert_array_equal(adjusted[i].data, raw[i].data)
-- 
GitLab