Skip to content

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Dec 8, 2024

Fixes an issue in test_priors_to_measurements which led to evaluating the prior at the wrong parameter values (using the location parameter of the prior instead of the actually estimated parameters). The problem was in the test code, not the tested code.

@dweindl dweindl requested a review from a team as a code owner December 8, 2024 15:43
@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.36%. Comparing base (4be03c8) to head (38560d9).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #336   +/-   ##
========================================
  Coverage    74.36%   74.36%           
========================================
  Files           53       53           
  Lines         5138     5138           
  Branches       903      903           
========================================
  Hits          3821     3821           
  Misses         977      977           
  Partials       340      340           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +42 to +48
x_scaled_dict = dict(
zip(
original_problem.x_free_ids,
original_problem.x_nominal_free_scaled,
strict=True,
)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it really be scaled values here? I assume the prior is either (1) unscaled or (2) on parameterScale. The former means this should be unscaled, and the latter is already handled in the observable formulae for these dummy prior observables, so no scaling is required here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far, this test only handles PARAMETER_SCALE_NORMAL (to be extended in #329). Yes, the scaling is handled in the observable formulae, but here, we need to write the simulation table. For that, we do not evaluate the observable formula using the given parameters, but write the result directly. Therefore, we need the scaled ones.

Fixes an issue in `test_priors_to_measurements` which led to evaluating the prior at the wrong parameter values
(using the location parameter of the prior instead of the actually estimated parameters).
The problem was in the test code, not the tested code.
@dweindl dweindl force-pushed the fix_test_priors_to_measurements branch from b15d57e to 749168c Compare December 9, 2024 13:53
Copy link
Member

@dilpath dilpath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, then fine as is

dweindl and others added 2 commits December 9, 2024 15:02
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
@dweindl dweindl merged commit 980926f into PEtab-dev:develop Dec 9, 2024
7 checks passed
@dweindl dweindl deleted the fix_test_priors_to_measurements branch December 9, 2024 14:10
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.

3 participants