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

Remove unnecessary warning given new ptype constraints #119

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions alea/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,6 @@ def generate_data(self, **kwargs) -> Union[dict, list]:
This implementation won't allow you to call generate_data by positional arguments.

"""
if set(kwargs.keys()) - set(self.parameters.fittable):
warnings.warn(
"When you pass non-fittable parameters to generate_data, "
"you might changed the nominal values of the parameters.",
)
if not self.parameters.values_in_fit_limits(**kwargs):
raise ValueError("Values are not within fit limits")
generate_values = self.parameters(**kwargs)
Expand Down
5 changes: 1 addition & 4 deletions tests/test_gaussian_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ def setUp(cls):
def test_data_generation(self):
"""Test generation of data."""
self.model.data = self.model.generate_data(mu=0)
with self.assertWarns(
Warning, msg="Should raise warning when generate_data with non-fittable parameter"
):
self.model.generate_data(mu=0, sigma=2)
self.model.generate_data(mu=0, sigma=2)

def test_data_storage(self):
"""Test storage of data to file and retrieval of data from file."""
Expand Down
Loading