Skip to content

Commit

Permalink
adjusted test_full_roundtrip to handle list of radiusParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmlongLANL committed Feb 22, 2025
1 parent 1528139 commit 9cd9253
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/unit/pleiades/sammy/test_parfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def test_parse_single_card(single_card_input):
"""Test parsing file with fudge factor and single broadening card."""
parfile = SammyParameterFile.from_string(single_card_input)

print(parfile)

# Check fudge factor
assert parfile.fudge == pytest.approx(0.1)

Expand Down Expand Up @@ -267,10 +269,15 @@ def test_full_roundtrip(self, temp_dir):
print(loaded_parfile.radius)
assert loaded_parfile.radius is not None
assert orig_parfile.radius is not None
assert loaded_parfile.radius.parameters.effective_radius == pytest.approx(orig_parfile.radius.parameters.effective_radius)
assert loaded_parfile.radius.parameters.true_radius == pytest.approx(orig_parfile.radius.parameters.true_radius)
assert loaded_parfile.radius.parameters.spin_groups == orig_parfile.radius.parameters.spin_groups
assert loaded_parfile.radius.parameters.vary_effective == orig_parfile.radius.parameters.vary_effective

# both original and loaded radius parameters should be length 1
assert len(loaded_parfile.radius.parameters) == 1
assert len(orig_parfile.radius.parameters) == 1

assert loaded_parfile.radius.parameters[0].effective_radius == pytest.approx(orig_parfile.radius.parameters[0].effective_radius)
assert loaded_parfile.radius.parameters[0].true_radius == pytest.approx(orig_parfile.radius.parameters[0].true_radius)
assert loaded_parfile.radius.parameters[0].spin_groups == orig_parfile.radius.parameters[0].spin_groups
assert loaded_parfile.radius.parameters[0].vary_effective == orig_parfile.radius.parameters[0].vary_effective

# Compare data reduction parameters
assert loaded_parfile.data_reduction is not None
Expand Down

0 comments on commit 9cd9253

Please sign in to comment.