Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Nov 30, 2022

Branch master refactored by Sourcery.

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

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 master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from edson-github November 30, 2022 17:41
Comment on lines -63 to +73
tmp_name = 'tmp_{}'.format(fname)
cmd = 'jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=30 --output {} {}'.format(
tmp_name, os_path)
tmp_name = f'tmp_{fname}'
cmd = f'jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=30 --output {tmp_name} {os_path}'

_run_cmd(cmd, cwd=dir_)
source = tmp_name

if SAVE_PY:
out_dir_py = os.path.join(os.path.dirname(dir_), 'py')
os.makedirs(out_dir_py, exist_ok=True)
cmd = 'jupyter nbconvert --to python --output-dir {} --output {}.py {}'.format(
out_dir_py, out_file_base, source)
cmd = f'jupyter nbconvert --to python --output-dir {out_dir_py} --output {out_file_base}.py {source}'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function post_save refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Nov 30, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 11.93 🙂 11.93 🙂 0.00
Method Length 90.00 🙂 91.50 🙂 1.50 👎
Working memory 10.95 😞 10.95 😞 0.00
Quality 47.17% 😞 46.96% 😞 -0.21% 👎
Other metrics Before After Change
Lines 92 92 0
Changed files Quality Before Quality After Quality Change
utils/post_save_hook.py 47.17% 😞 46.96% 😞 -0.21% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
utils/post_save_hook.py post_save 15 🙂 273 ⛔ 13 😞 34.95% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

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!

Help us improve this quality report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant