Skip to content

Commit

Permalink
Revert "remove wrong warning"
Browse files Browse the repository at this point in the history
Re-introduce a check for gamma and lambda fixed to different values in
case of equal asymptote experiments, but turning it into an Exception.
There's no way in this case to know what the user meant, so it safer
to bail out instead of guessing which parameter is to be trusted.

This reverts commit ec4e716.
  • Loading branch information
otizonaizit committed Sep 23, 2024
1 parent d247109 commit 9c01394
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions psignifit/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ def check_experiment_type_matches_fixed_parameters(self, fixed_params, experimen
if fixed_params is not None and 'gamma' in fixed_params:
warnings.warn(
f'The parameter gamma was fixed to {fixed_params["gamma"]}. In {ExperimentType.N_AFC.value} experiments gamma is automatically fixed to 1/n. Ignoring fixed gamma.')
if experiment_type == ExperimentType.EQ_ASYMPTOTE.value:
if fixed_params is not None:
if 'gamma' in fixed_params:
pass # we assume the user knows what they are doing
if 'lambda' in fixed_params:
pass # we assume the user knows what they are doing
if 'lambda' in fixed_params and 'gamma' in fixed_params:
if fixed_params['gamma'] != fixed_params['lambda']:
raise PsignifitException(
f'The parameters lambda {fixed_params["lambda"]} and'
f' gamma {fixed_params["gamma"]} were fixed to different values.'
f' In {experiment_type} experiments gamma and lambda need to be equal. ')


def check_experiment_type(self, value):
Expand Down

0 comments on commit 9c01394

Please sign in to comment.