Closed AntreasAntoniou closed 3 years ago
The main reason is that it causes a bug if it's not there. There were two solutions to that:
What's the bug?
If there aren't **kwargs then any additional arguments like model.type passed into the downstream classes will throw an error of unexpected argument.
On Thu, May 6, 2021 at 3:30 PM Jack Turner @.**@.>> wrote:
What's the bug?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/BayesWatch/pytorch-experiments-template/pull/75#issuecomment-833569598, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACSK4NU3DX5ZAYNFUHARC4LTMKRX5ANCNFSM44FXCIGQ.
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.
@jack-willturner Any thoughts?
❌ Merging this PR will decrease code quality in the affected files by 1.08%.
Quality metrics | Before | After | Change |
---|---|---|---|
Complexity | 2.66 ⭐ | 2.89 ⭐ | 0.23 👎 |
Method Length | 62.64 🙂 | 63.11 🙂 | 0.47 👎 |
Working memory | 10.44 😞 | 10.67 😞 | 0.23 👎 |
Quality | 66.32% 🙂 | 65.24% 🙂 | -1.08% 👎 |
Other metrics | Before | After | Change |
---|---|---|---|
Lines | 1622 | 1499 | -123 |
Changed files | Quality Before | Quality After | Quality Change |
---|---|---|---|
models/init.py | 61.37% 🙂 | 61.37% 🙂 | 0.00% |
models/auto_builder_models.py | 63.30% 🙂 | 63.29% 🙂 | -0.01% 👎 |
models/auto_builder_transformers.py | 59.81% 🙂 | 59.76% 🙂 | -0.05% 👎 |
models/densenet.py | 69.80% 🙂 | 69.74% 🙂 | -0.06% 👎 |
models/resnet.py | 71.44% 🙂 | 71.42% 🙂 | -0.02% 👎 |
models/wresnet.py | 65.55% 🙂 | 65.51% 🙂 | -0.04% 👎 |
Here are some functions in these files that still need a tune-up:
File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
---|---|---|---|---|---|---|
models/auto_builder_models.py | BatchRelationalModule.forward | 13 🙂 | 373 ⛔ | 15 😞 | 31.20% 😞 | Try splitting into smaller methods. Extract out complex expressions |
models/auto_builder_models.py | BatchRelationalModule.build | 13 🙂 | 451 ⛔ | 14 😞 | 31.54% 😞 | Try splitting into smaller methods. Extract out complex expressions |
models/resnet.py | ResNet.__init__ | 9 🙂 | 178 😞 | 16 ⛔ | 42.42% 😞 | Try splitting into smaller methods. Extract out complex expressions |
models/wresnet.py | WideResNet.__init__ | 5 ⭐ | 230 ⛔ | 14 😞 | 44.81% 😞 | Try splitting into smaller methods. Extract out complex expressions |
models/auto_builder_transformers.py | VisualTransformer.build | 3 ⭐ | 287 ⛔ | 13 😞 | 45.47% 😞 | Try splitting into smaller methods. Extract out complex expressions |
The emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.
Please see our documentation here for details on how these metrics are calculated.
We are actively working on this report - lots more documentation and extra metrics to come!
Let us know what you think of it by mentioning @sourcery-ai in a comment.
We made a fairly conscious decision to remove these in bb6e56bb1719b07d74301d941160ac18c7f0e4cf. Is there a reason you want to bring them back?