Closed manuelgloeckler closed 3 months ago
Internal neural_nets
module
Edit updated:
Just for 'uitls` module
Edit: This I already fixed and seems fine.
Just for inference
Edit: Updated
Just for analysis
Edit: Fixed
Just for samplers
Edit: This seems already good
Okay what's left over (according to pylint) currently is:
Edit: Will still be detected, but now not executed on initialization.
Attention: Patch coverage is 89.87342%
with 8 lines
in your changes missing coverage. Please review.
Project coverage is 72.92%. Comparing base (
8efb8e4
) to head (30d878d
). Report is 3 commits behind head on main.
Wow, that worked better than expected. All imports work now. Some remarks:
import sbi.utils as utils
(this has a lot of dependencies) for internal imports. Try to use the low-level children i.e. from sbi.utils.xxx import yyy
.@janfb Good point; after importing "hierarchically," it looks way better. (at least on the bottom)
I also removed the typing imports because it seems a bit weird to me to expose types from the typing module to the user in sbi.inference
(but I can add them back).
I removed a lot of from sbi.utils import ___few_functions___
, to decrease the large dependency on initializing the whole utils module. Is now more distributed through the individual files
What does this implement/fix? Explain your changes
Currently, a lot of functions can not be directly imported due to circular imports e.g.
Does this close any currently open issues?
Maybe #1158
Any relevant code examples, logs, error output, etc?
This is likely due to our current import hierarchy, which is quite chaotic and circular.