Skip to content

Commit

Permalink
Merge pull request #162 from sblunt/labels-load-bugfix
Browse files Browse the repository at this point in the history
fix bug that was causing corner to fail on loaded results objs
  • Loading branch information
sblunt authored Apr 8, 2020
2 parents 6de0182 + 202ce5a commit 1f45025
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,5 @@ build.sh
*.fits
*.png
!docs/orbitize_logo_500.png
.vscode/settings.json
tests/test_results.h5
2 changes: 1 addition & 1 deletion orbitize/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def load_results(self, filename, append=False):
# probably a old results file when reference epoch was fixed at MJD = 0
tau_ref_epoch = 0
try:
labels = np.array([hf.attrs['parameter_labels']])
labels = hf.attrs['parameter_labels']
except KeyError:
# again, probably an old file without saved parameter labels
labels = ['sma1', 'ecc1', 'inc1', 'aop1', 'pan1', 'tau1', 'plx', 'mtot']
Expand Down
2 changes: 1 addition & 1 deletion tests/test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_save_and_load_results(results_to_test, has_lnlike=True):
original_length = results_to_save.post.shape[0]
expected_length = original_length * 2
assert loaded_results.post.shape == (expected_length, 8)
assert loaded_results.labels[0].tolist() == std_labels
assert loaded_results.labels.tolist() == std_labels
if has_lnlike:
assert loaded_results.lnlike.shape == (expected_length,)

Expand Down

0 comments on commit 1f45025

Please sign in to comment.