Skip to content

Commit

Permalink
Merge pull request #119 from XENONnT/rm_fittable_warning
Browse files Browse the repository at this point in the history
Remove unnecessary warning given new ptype constraints
  • Loading branch information
hammannr authored Dec 8, 2023
2 parents 82eba10 + 4dc8e94 commit fc9d8e4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
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

0 comments on commit fc9d8e4

Please sign in to comment.