-
Notifications
You must be signed in to change notification settings - Fork 32
✨ Everything as a second level import #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the package to expose utilities, models, layers, datasets, and datamodules at a second-level import, and consolidates duplicate factory functions into single, parameterized versions.
- Moved plotting logic out of
misc.py
into a dedicatedplotting
module and updated exports. - Unified
deep_lab_v3_resnet50
/101
andbts_resnet50
/101
intodeep_lab_v3_resnet
andbts_resnet
with anarch
parameter. - Replaced wildcard imports across
__init__.py
files with explicit second-level exports for shorter import paths.
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
torch_uncertainty/utils/misc.py | Removed plotting imports and plot_hist (moved to plotting.py ). |
torch_uncertainty/utils/init.py | Added plot_hist and show from new plotting module. |
torch_uncertainty/transforms/init.py | Re-exported corruption transforms for direct imports. |
torch_uncertainty/models/segmentation/deeplab.py | Merged two deep_lab_v3_resnet* functions into one with arch . |
torch_uncertainty/models/segmentation/init.py | Exposed deep_lab_v3_resnet at package level. |
torch_uncertainty/models/depth/bts.py | Merged bts_resnet50 /101 into bts_resnet with arch . |
torch_uncertainty/models/depth/init.py | Exposed bts_resnet at package level. |
torch_uncertainty/models/classification/wideresnet/init.py | Replaced wildcards with explicit exports. |
torch_uncertainty/models/classification/vgg/init.py | Replaced wildcards with explicit exports. |
torch_uncertainty/models/classification/resnet/init.py | Replaced wildcards with explicit exports. |
torch_uncertainty/models/classification/init.py | Consolidated all model exports explicitly. |
torch_uncertainty/models/init.py | Added unified model factories to top-level exports. |
torch_uncertainty/layers/init.py | Re-exported new distribution layers for second-level import. |
torch_uncertainty/datasets/init.py | Re-exported classification, regression, segmentation datasets. |
torch_uncertainty/datamodules/classification/init.py | Added UCIClassificationDataModule . |
torch_uncertainty/datamodules/init.py | Added MUADDataModule alongside existing modules. |
torch_uncertainty/baselines/segmentation/deeplab.py | Updated DeepLabBaseline to call the new factory. |
tests/models/test_deeplab.py | Updated tests to exercise deep_lab_v3_resnet . |
tests/baselines/test_standard.py | Removed obsolete error test for legacy version handling. |
Comments suppressed due to low confidence (3)
torch_uncertainty/models/classification/resnet/init.py:2
- Missing re-exports for
mimo_resnet
,packed_resnet
, andresnet
, which are referenced by the top-level classification package. Consider adding:
from .mimo import mimo_resnet
from .packed import packed_resnet
from .std import resnet
from .batched import batched_resnet
torch_uncertainty/baselines/segmentation/deeplab.py:18
- The
version
parameter is no longer used after consolidating to a single factory call. Consider removing this argument to simplify the constructor signature.
version: Literal["std"],
torch_uncertainty/models/depth/bts.py:579
- The new
bts_resnet
function is not covered by existing tests. Add unit tests to verify correct behavior for supportedarch
values (50, 101) and expected errors for unsupported inputs.
def bts_resnet(
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## dev #173 +/- ##
==========================================
- Coverage 98.13% 96.09% -2.04%
==========================================
Files 153 156 +3
Lines 7863 8073 +210
Branches 1034 1049 +15
==========================================
+ Hits 7716 7758 +42
- Misses 91 259 +168
Partials 56 56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks @o-laurent! Indeed, the baselines will be removed for better clarity and to simplify things. |
To make imports shorter...
I didn't include the baselines since they are bound to be deleted in the short/medium term, if I remember correctly.