-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e36dce4
commit 08c86a2
Showing
2 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
Testing the prediciton tool | ||
""" | ||
import subprocess | ||
import numpy as np | ||
import whereistheplanet.whereistheplanet as witp | ||
|
||
def test_all_predictions(): | ||
""" | ||
Test all predictions to make sure the posteriors exist. | ||
Checks the values produced are not nan | ||
""" | ||
labels = witp.post_dict.keys() | ||
|
||
for name in labels: | ||
print(name) | ||
ra_args, dec_args, sep_args, pa_args = witp.predict_planet(name) | ||
assert np.all(~np.isnan(ra_args)) | ||
assert np.all(~np.isnan(pa_args)) | ||
|
||
def test_cmd_line(): | ||
""" | ||
Test command line script | ||
""" | ||
subprocess.run(['whereistheplanet', 'betpicb', '-t', '2022-01-01']) | ||
|
||
if __name__ == "__main__": | ||
test_all_predictions() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters