-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another fitting test #59
Conversation
tests/test_gaussian_model.py
Outdated
"""Test of generate_data and fit method of the GaussianModel class""" | ||
@classmethod | ||
def setUp(cls): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pep8] reported by reviewdog 🐶
D200 One-line docstring should fit on one line with quotes
tests/test_gaussian_model.py
Outdated
|
||
def test_data_generation(self): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pep8] reported by reviewdog 🐶
D200 One-line docstring should fit on one line with quotes
tests/test_gaussian_model.py
Outdated
self.simple_model.data = self.simple_model.generate_data(mu=0, sigma=2) | ||
self.simple_model.store_data(toydata_file, [self.simple_model.data]) | ||
stored_data = inference_interface.toydata_from_file('simple_data.hdf5') | ||
assert self.simple_model.data == stored_data[0] , "Stored data disagrees with data!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pep8] reported by reviewdog 🐶
E203 whitespace before ','
tests/test_gaussian_model.py
Outdated
best_fit, lf = self.simple_model.fit(sigma=2) | ||
hat_fit = best_fit["mu"] | ||
np.testing.assert_almost_equal(hat_meas, hat_fit), "best-fit does not agree" | ||
np.testing.assert_almost_equal(lf, sps.norm(hat_fit, 2).logpdf(hat_meas)) , "likelihood function disagrees" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pep8] reported by reviewdog 🐶
WPS428 Found statement that has no effect
tests/test_gaussian_model.py
Outdated
best_fit, lf = self.simple_model.fit(sigma=2) | ||
hat_fit = best_fit["mu"] | ||
np.testing.assert_almost_equal(hat_meas, hat_fit), "best-fit does not agree" | ||
np.testing.assert_almost_equal(lf, sps.norm(hat_fit, 2).logpdf(hat_meas)) , "likelihood function disagrees" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pep8] reported by reviewdog 🐶
WPS221 Found line with high Jones Complexity: 16 > 14
tests/test_gaussian_model.py
Outdated
best_fit, lf = self.simple_model.fit(sigma=2) | ||
hat_fit = best_fit["mu"] | ||
np.testing.assert_almost_equal(hat_meas, hat_fit), "best-fit does not agree" | ||
np.testing.assert_almost_equal(lf, sps.norm(hat_fit, 2).logpdf(hat_meas)) , "likelihood function disagrees" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pep8] reported by reviewdog 🐶
E203 whitespace before ','
tests/test_gaussian_model.py
Outdated
best_fit, lf = self.simple_model.fit(sigma=2) | ||
hat_fit = best_fit["mu"] | ||
np.testing.assert_almost_equal(hat_meas, hat_fit), "best-fit does not agree" | ||
np.testing.assert_almost_equal(lf, sps.norm(hat_fit, 2).logpdf(hat_meas)) , "likelihood function disagrees" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pep8] reported by reviewdog 🐶
E501 line too long (115 > 100 characters)
tests/test_gaussian_model.py
Outdated
best_fit, lf = self.simple_model.fit(sigma=2) | ||
hat_fit = best_fit["mu"] | ||
np.testing.assert_almost_equal(hat_meas, hat_fit), "best-fit does not agree" | ||
np.testing.assert_almost_equal(lf, sps.norm(hat_fit, 2).logpdf(hat_meas)) , "likelihood function disagrees" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pep8] reported by reviewdog 🐶
W292 no newline at end of file
No description provided.