tpaviot / ProcessScheduler

A Python package for automatic and optimized resource scheduling
https://processscheduler.github.io/
GNU General Public License v3.0
59 stars 17 forks source link

Sourcery refactored master branch #94

Closed sourcery-ai[bot] closed 3 years ago

sourcery-ai[bot] commented 3 years ago

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[bot] commented 3 years ago

Sourcery Code Quality Report

βœ…  Merging this PR will increase code quality in the affected files by 0.36%.

Quality metrics Before After Change
Complexity 2.25 ⭐ 1.99 ⭐ -0.26 πŸ‘
Method Length 71.29 πŸ™‚ 70.90 πŸ™‚ -0.39 πŸ‘
Working memory 9.38 πŸ™‚ 9.31 πŸ™‚ -0.07 πŸ‘
Quality 68.18% πŸ™‚ 68.54% πŸ™‚ 0.36% πŸ‘
Other metrics Before After Change
Lines 2406 2386 -20
Changed files Quality Before Quality After Quality Change
benchmark/benchmark_dev_team.py 48.16% 😞 48.16% 😞 0.00%
benchmark/benchmark_mixed.py 38.18% 😞 40.42% 😞 2.24% πŸ‘
processscheduler/base.py 85.75% ⭐ 86.74% ⭐ 0.99% πŸ‘
processscheduler/cost.py 83.67% ⭐ 85.13% ⭐ 1.46% πŸ‘
processscheduler/jupyter_ui.py 71.52% πŸ™‚ 71.89% πŸ™‚ 0.37% πŸ‘
processscheduler/problem.py 71.32% πŸ™‚ 72.23% πŸ™‚ 0.91% πŸ‘
processscheduler/util.py 75.24% ⭐ 75.34% ⭐ 0.10% πŸ‘
test/test_indicator.py 74.01% πŸ™‚ 74.01% πŸ™‚ 0.00%
test/test_resource_tasks_distance.py 57.71% πŸ™‚ 58.04% πŸ™‚ 0.33% πŸ‘
test/test_solver.py 75.22% ⭐ 75.16% ⭐ -0.06% πŸ‘Ž

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

File Function Complexity Length Working Memory Quality Recommendation
test/test_resource_tasks_distance.py TestResourceTasksDistance.test_resource_tasks_distance_double_time_period_2 1 ⭐ 303 β›” 15 😞 44.24% 😞 Try splitting into smaller methods. Extract out complex expressions
processscheduler/problem.py SchedulingProblem.add_objective_flowtime_single_resource 4 ⭐ 206 β›” 12 😞 50.35% πŸ™‚ Try splitting into smaller methods. Extract out complex expressions
test/test_indicator.py TestIndicator.get_single_resource_utilization_problem 0 ⭐ 202 😞 14 😞 51.64% πŸ™‚ Try splitting into smaller methods. Extract out complex expressions
test/test_solver.py TestSolver.test_alternative_workers_2 0 ⭐ 156 😞 17 β›” 52.31% πŸ™‚ Try splitting into smaller methods. Extract out complex expressions
test/test_resource_tasks_distance.py TestResourceTasksDistance.test_resource_tasks_distance_4 0 ⭐ 199 😞 13 😞 53.28% πŸ™‚ Try splitting into smaller methods. 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!

Help us improve this quality report!

codecov-commenter commented 3 years ago

Codecov Report

Merging #94 (4bd47f4) into master (5e1988f) will increase coverage by 0.13%. The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   94.94%   95.07%   +0.13%     
==========================================
  Files          34       34              
  Lines        3857     3838      -19     
==========================================
- Hits         3662     3649      -13     
+ Misses        195      189       -6     
Impacted Files Coverage Ξ”
processscheduler/jupyter_ui.py 44.50% <0.00%> (+1.42%) :arrow_up:
test/test_indicator.py 99.52% <ΓΈ> (ΓΈ)
processscheduler/base.py 94.11% <100.00%> (-0.23%) :arrow_down:
processscheduler/cost.py 85.71% <100.00%> (-0.65%) :arrow_down:
processscheduler/problem.py 97.14% <100.00%> (-0.12%) :arrow_down:
processscheduler/util.py 57.14% <100.00%> (-2.32%) :arrow_down:
test/test_resource_tasks_distance.py 99.46% <100.00%> (ΓΈ)
test/test_solver.py 99.64% <100.00%> (-0.01%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 5e1988f...4bd47f4. Read the comment docs.