Skip to content

Commit

Permalink
Merge pull request sxs-collaboration#6210 from knelli2/disable_burger…
Browse files Browse the repository at this point in the history
…s_lb

Disable LB test in Burgers yaml
  • Loading branch information
kidder authored Aug 16, 2024
2 parents 9c3f444 + 19c3cb9 commit 705a34b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
5 changes: 4 additions & 1 deletion src/Visualization/Python/ReadInputFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def find_event(event_name: str, input_file: dict) -> dict:
for trigger_and_events in input_file["EventsAndTriggers"]:
try:
for event in trigger_and_events["Events"]:
if event_name in event:
if isinstance(event, str):
if event == event_name:
return {}
elif event_name in event:
return event[event_name]
except TypeError:
# Backwards compatibility for input files without metadata (can be
Expand Down
8 changes: 0 additions & 8 deletions tests/InputFiles/Burgers/Step.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

Executable: EvolveBurgers
Testing:
CommandLineArgs: +balancer RandCentLB +p2
Timeout: 5
Check: parse;execute
Priority: High
Expand All @@ -30,13 +29,6 @@ Evolution:
Order: 3

PhaseChangeAndTriggers:
- Trigger:
Slabs:
EvenlySpaced:
Interval: 10
Offset: 0
PhaseChanges:
- VisitAndReturn(LoadBalancing)

DomainCreator:
Interval:
Expand Down
13 changes: 8 additions & 5 deletions tests/Unit/Visualization/Python/Test_ReadInputFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,24 @@
class TestReadInputFile(unittest.TestCase):
def setUp(self):
self.input_files_dir = Path(unit_test_src_path(), "..", "InputFiles")
self.input_file = Path(self.input_files_dir, "Burgers/Step.yaml")
self.input_file = Path(
self.input_files_dir, "ExportCoordinates/Input1D.yaml"
)

def test_find_event(self):
with self.input_file.open() as open_input_file:
_, input_file = yaml.safe_load_all(open_input_file)
self.assertEqual(
find_event("ChangeSlabSize", input_file)["DelayChange"], 5
)
self.assertEqual(find_event("Completion", input_file), {})
self.assertIsNone(find_event("NonexistentEvent", input_file))

def test_find_phase_change(self):
with self.input_file.open() as open_input_file:
_, input_file = yaml.safe_load_all(open_input_file)
self.assertEqual(
find_phase_change("VisitAndReturn(LoadBalancing)", input_file), {}
find_phase_change(
"VisitAndReturn(EvaluateAmrCriteria)", input_file
),
{},
)
self.assertIsNone(
find_phase_change("NonexistentPhaseChange", input_file)
Expand Down

0 comments on commit 705a34b

Please sign in to comment.