Skip to content

Commit 4238367

Browse files
committed
#507: add config file test for lbaf viz deprecation
1 parent 3d897d9 commit 4238367

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

tests/unit/IO/test_lbs_visualizer_deprecation.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import os
22
import logging
33
import unittest
4+
import subprocess
45
from src.lbaf.IO.lbsVisualizer import Visualizer
56

67
class TestVizDeprecation(unittest.TestCase):
78
"""Test for lbsVisualizer's deprecation."""
89

910
def test_lbs_visualizer_deprecation(self):
10-
11-
# Instantiate dummy Visualizer to ensure Deprecation Error is thrown
1211
try:
1312
visualizer = Visualizer(
1413
logger=logging.getLogger(),
@@ -19,5 +18,13 @@ def test_lbs_visualizer_deprecation(self):
1918
except DeprecationWarning as e:
2019
assert str(e) == "LBAF's Visualizer has been deprecated and will be removed in a future release. Visualizations should be generated with DARMA/vt-tv."
2120

21+
def test_lbs_visualizer_config(self):
22+
config_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), "config", "conf_wrong_visualization.yml")
23+
pipes = subprocess.Popen(["python", "src/lbaf", "-c", config_file], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
24+
std_err = pipes.communicate()[1].decode("utf-8")
25+
26+
assert pipes.returncode != 0
27+
assert "DeprecationWarning: LBAF\'s Visualizer has been deprecated and will be removed in a future release. Visualizations should be generated with DARMA/vt-tv." in std_err
28+
2229
if __name__ == "__main__":
2330
unittest.main()

tests/unit/IO/test_vt_writer.py

-4
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ def test_vt_writer_required_fields_output(self):
140140
output_file_name = f"{output_file_prefix}.{i}.json"
141141
output_file = os.path.join(output_dir, output_file_name)
142142

143-
# print(f"[{__loader__.name}] Compare input file ({input_file_name}) and output file ({output_file_name})...")
144-
145143
# validate that output file exists at rank i
146144
self.assertTrue(
147145
os.path.isfile(output_file),
@@ -218,8 +216,6 @@ def test_vt_writer_communications_output(self):
218216
output_file_name = f"{output_file_prefix}.{r_id}.json"
219217
output_file = os.path.join(output_dir, output_file_name)
220218

221-
# print(f"[{__loader__.name}] Compare input file ({input_file_name}) and output file ({output_file_name})...")
222-
223219
# validate that output file exists at rank i
224220
self.assertTrue(
225221
os.path.isfile(output_file),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Specify input
2+
from_data:
3+
data_stem: ../data/synthetic_lb_data/data
4+
phase_ids:
5+
- 0
6+
7+
# Specify work model
8+
work_model:
9+
name: AffineCombination
10+
parameters:
11+
alpha: 1.0
12+
beta: 0.0
13+
gamma: 0.0
14+
15+
# Specify algorithm
16+
algorithm:
17+
name: InformAndTransfer
18+
phase_id: 0
19+
parameters:
20+
n_iterations: 8
21+
n_rounds: 4
22+
fanout: 4
23+
order_strategy: element_id
24+
transfer_strategy: Recursive
25+
criterion: Tempered
26+
max_objects_per_transfer: 8
27+
deterministic_transfer: true
28+
29+
# Specify output
30+
output_dir: ../../output
31+
output_file_stem: output_file
32+
visualization:
33+
x_ranks: 2
34+
y_ranks: 2
35+
z_ranks: 1
36+
object_jitter: 0.5
37+
rank_qoi: load
38+
object_qoi: load
39+
force_continuous_object_qoi: true
40+
output_visualization_dir: ../../output
41+
output_visualization_file_stem: output_file

0 commit comments

Comments
 (0)