migrated tests from set_x to bind - #1948
Conversation
|
Note that I implemented bind definitions independent from set_x (which will be implemented in #1945 everywhere). I did this here already to avoid recursion errors. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## gsoc-2026 #1948 +/- ##
=============================================
- Coverage 87.99% 87.43% -0.57%
=============================================
Files 144 144
Lines 13499 14312 +813
=============================================
+ Hits 11879 12514 +635
- Misses 1620 1798 +178
Flags with carried forward coverage won't be shown. Click here to find out more. |
dgedon
left a comment
There was a problem hiding this comment.
Again make sure to import things on file level. Otherwise this PR is fine.
Also can you run tests to see if we still call at some point .set_x(). This should be visible now with the deprecation warning. No more .set_x() calls should be within the internals of the package, at this point, right? So only users would get the deprecation warning if they explicitly use `.set_x() in their workflow.
|
|
||
| def bind(self, x_o: torch.Tensor, x_is_iid: bool = True) -> "FakePotential": | ||
| """Create new potential with x bound, without mutable state.""" | ||
| from sbi.utils.user_input_checks import process_x |
There was a problem hiding this comment.
Can yuou move this to file level?
|
|
||
| def bind(self, x_o: torch.Tensor, x_is_iid: bool = True) -> "FakePotential": | ||
| """Create new potential with x bound, without mutable state.""" | ||
| from sbi.utils.user_input_checks import process_x |
There was a problem hiding this comment.
Can yuou move this to file level?
This PR prepares the set_x deprecation by swapping set_x with bind