Repository navigation
fix: Check instance of prior so ValueError is rised after .append_simultions was executed, see #1793 - #1803
Conversation
…ltions was executed, see sbi-dev#1793
There was a problem hiding this comment.
Thanks @Jocho-Smith . This solution would always raise an error when no prior is passed, right?
This is somewhat suboptimal, because for e.g. standard NPE we would not like to raise an error here (i.e. with sample_with=direct).
I think the _resolve_prior method should be aware of "for what" it should resolve the prior (e.g. it should get the sample_with argument. If a certain sample_with method does require a proper prior then we should raise an Error, otherwise not. Maybe @janfb also has some idea on this.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1803 +/- ##
==========================================
- Coverage 87.86% 87.80% -0.07%
==========================================
Files 140 140
Lines 12726 12726
==========================================
- Hits 11182 11174 -8
- Misses 1544 1552 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Hey @manuelgloeckler , thanks or reviewing. I'll think about it and implement a solution. I like your idea of passing Also it seems like my local tests were not configured properly, b/c I didn't get errors on my machine. I'll also look into that. |
|
Hey @Jocho-Smith, I have found the issue for the uninformative error message I think what we should do here:
|
|
Good catch @manuelgloeckler ! I like the idea and will try to implement this (hopefully next week!)
Shouldn't we rather test |
|
Yeah |
|
Hi @manuelgloeckler, I implemented it now and appended some tests in tests/posterior_parameters_test.py (like @Dev-Sudarshan suggested), only covering NPE. Local pre-commit + tests passed. Happy to hear your thoughts. |
manuelgloeckler
left a comment
There was a problem hiding this comment.
That looks great @Jocho-Smith ! Code looks great, will wait for the CI to run through (might be some interaction I dont foresee) and then merge it.
Thanks for finding and fixing this!
This PR implements the small fix mentioned in #1793