-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extending the tests to further parts of the code.
- Loading branch information
1 parent
ddc4588
commit 3554284
Showing
4 changed files
with
275 additions
and
2 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
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,19 @@ | ||
from EmpiricalArchive.Extraction.Classfile import * | ||
import numpy as np | ||
|
||
|
||
def test_abs_mag_error(): | ||
# Test with known values | ||
w = 10.0 | ||
delta_w = 0.1 | ||
delta_m = 0.05 | ||
expected_result = np.sqrt((5 / (np.log(10) * w) * delta_w) ** 2 + delta_m ** 2) | ||
assert np.isclose(abs_mag_error(w, delta_w, delta_m), expected_result) | ||
|
||
|
||
def test_RSS(): | ||
# Test with known values | ||
e1 = 0.1 | ||
e2 = 0.2 | ||
expected_result = np.sqrt(e1 ** 2 + e2 ** 2) | ||
assert np.isclose(RSS(e1, e2), expected_result) |
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