sbi icon indicating copy to clipboard operation
sbi copied to clipboard

AssertionError for using ConditionalPotential

Open janfb opened this issue 1 year ago • 2 comments

Describe the bug base_posterior raises an AssertionError when it is passed a potential_fn that does not have x_o as an argument, e.g., when using the ConditionalPotential

https://github.com/sbi-dev/sbi/blob/17f3033aa55514ac6c039da729ee84ce32eb20d9/sbi/inference/posteriors/base_posterior.py#L47-L54

To Reproduce pytest tests/mnle_test.py::test_mnle_with_experimental_conditions

Expected behavior No AssertionError.

janfb avatar Mar 11 '24 16:03 janfb

I encountered and fixed this in the current draft for #979 (while trying to get all tests running for the new interface).

The problem is that the conditional_potential does not have an x_o keyword argument (adding a unused one fixed this for me)

manuelgloeckler avatar Mar 12 '24 07:03 manuelgloeckler

fixed in #979

janfb avatar Mar 15 '24 08:03 janfb

Can we close this issue as resolved @janfb?

gmoss13 avatar Mar 19 '24 08:03 gmoss13