Skip to content

Commit

Permalink
#507: add config file test for lbaf viz deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly committed May 20, 2024
1 parent 0d560e7 commit 2278265
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
11 changes: 9 additions & 2 deletions tests/unit/IO/test_lbs_visualizer_deprecation.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import os
import logging
import unittest
import subprocess
from src.lbaf.IO.lbsVisualizer import Visualizer

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

def test_lbs_visualizer_deprecation(self):

# Instantiate dummy Visualizer to ensure Deprecation Error is thrown
try:
visualizer = Visualizer(
logger=logging.getLogger(),
Expand All @@ -19,5 +18,13 @@ def test_lbs_visualizer_deprecation(self):
except DeprecationWarning as e:
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."

def test_lbs_visualizer_config(self):
config_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), "config", "conf_wrong_visualization.yml")
pipes = subprocess.Popen(["python", "src/lbaf", "-c", config_file], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
std_err = pipes.communicate()[1].decode("utf-8")

assert pipes.returncode != 0
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

if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions tests/unit/IO/test_vt_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ def test_vt_writer_required_fields_output(self):
output_file_name = f"{output_file_prefix}.{i}.json"
output_file = os.path.join(output_dir, output_file_name)

# print(f"[{__loader__.name}] Compare input file ({input_file_name}) and output file ({output_file_name})...")

# validate that output file exists at rank i
self.assertTrue(
os.path.isfile(output_file),
Expand Down Expand Up @@ -218,8 +216,6 @@ def test_vt_writer_communications_output(self):
output_file_name = f"{output_file_prefix}.{r_id}.json"
output_file = os.path.join(output_dir, output_file_name)

# print(f"[{__loader__.name}] Compare input file ({input_file_name}) and output file ({output_file_name})...")

# validate that output file exists at rank i
self.assertTrue(
os.path.isfile(output_file),
Expand Down
41 changes: 41 additions & 0 deletions tests/unit/config/conf_wrong_visualization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Specify input
from_data:
data_stem: ../data/synthetic_lb_data/data
phase_ids:
- 0

# Specify work model
work_model:
name: AffineCombination
parameters:
alpha: 1.0
beta: 0.0
gamma: 0.0

# Specify algorithm
algorithm:
name: InformAndTransfer
phase_id: 0
parameters:
n_iterations: 8
n_rounds: 4
fanout: 4
order_strategy: element_id
transfer_strategy: Recursive
criterion: Tempered
max_objects_per_transfer: 8
deterministic_transfer: true

# Specify output
output_dir: ../../output
output_file_stem: output_file
visualization:
x_ranks: 2
y_ranks: 2
z_ranks: 1
object_jitter: 0.5
rank_qoi: load
object_qoi: load
force_continuous_object_qoi: true
output_visualization_dir: ../../output
output_visualization_file_stem: output_file

0 comments on commit 2278265

Please sign in to comment.