BayesWatch / pytorch-experiments-template

A pytorch based classification experiments template
GNU General Public License v3.0
5 stars 1 forks source link

dataparallel bug fix (Sourcery refactored) #58

Closed sourcery-ai[bot] closed 3 years ago

sourcery-ai[bot] commented 3 years ago

Pull Request #57 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will re-run and update (force-push) this Pull Request with new refactorings as necessary. If Sourcery finds no refactorings at any point, this Pull Request will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the data_parallel_fix branch, then run:

git fetch origin sourcery/data_parallel_fix
git merge --ff-only FETCH_HEAD
git reset HEAD^
sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.22%.

Quality metrics Before After Change
Complexity 12.33 🙂 11.95 🙂 -0.38 👍
Method Length 89.39 🙂 89.09 🙂 -0.30 👍
Working memory 15.11 😞 15.23 ⛔ 0.12 👎
Quality 53.39% 🙂 53.17% 🙂 -0.22% 👎
Other metrics Before After Change
Lines 1039 1034 -5
Changed files Quality Before Quality After Quality Change
train.py 28.37% 😞 28.64% 😞 0.27% 👍
datasets/dataset_loading_hub.py 69.78% 🙂 69.79% 🙂 0.01% 👍
utils/pretty_progress_reporting.py 52.69% 🙂 52.74% 🙂 0.05% 👍
utils/storage.py 74.62% 🙂 74.58% 🙂 -0.04% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
utils/pretty_progress_reporting.py PrettyProgressReporter.__init__ 1 ⭐ 200 😞 18 ⛔ 46.55% 😞 Try splitting into smaller methods. Extract out complex expressions
utils/storage.py build_experiment_folder 10 🙂 138 😞 12 😞 50.90% 🙂 Try splitting into smaller methods. Extract out complex expressions
datasets/dataset_loading_hub.py load_dataset 0 ⭐ 114 🙂 19 ⛔ 55.53% 🙂 Extract out complex expressions
train.py get_base_argument_parser 0 ⭐ 250 ⛔ 9 🙂 57.34% 🙂 Try splitting into smaller methods
datasets/dataset_loading_hub.py CINIC10Loader.get_data 4 ⭐ 92 🙂 11 😞 64.24% 🙂 Extract out complex expressions

Legend and Explanation

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.