Skip to content
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

Merged
merged 2 commits into from
Jul 25, 2023
Merged

Another fitting test #59

merged 2 commits into from
Jul 25, 2023

Conversation

kdund
Copy link
Collaborator

@kdund kdund commented Jul 25, 2023

No description provided.

tests/test_gaussian_model.py Show resolved Hide resolved
"""Test of generate_data and fit method of the GaussianModel class"""
@classmethod
def setUp(cls):
"""

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


def test_data_generation(self):
"""

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 Show resolved Hide resolved
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!"

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 ','

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"

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

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"

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

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"

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 ','

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"

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)

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"

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

@kdund kdund marked this pull request as ready for review July 25, 2023 19:27
@kdund kdund requested a review from dachengx July 25, 2023 19:27
@dachengx dachengx merged commit 59a3902 into init_unittest Jul 25, 2023
@dachengx dachengx deleted the knuttest branch July 25, 2023 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants