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

First implementation of Buffers (Sourcery refactored) #92

Closed sourcery-ai[bot] closed 3 years ago

sourcery-ai[bot] commented 3 years ago

Pull Request #91 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 buffer branch, then run:

git fetch origin sourcery/buffer
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.27%.

Quality metrics Before After Change
Complexity 24.46 😞 23.34 😞 -1.12 πŸ‘
Method Length 91.30 πŸ™‚ 90.04 πŸ™‚ -1.26 πŸ‘
Working memory 11.81 😞 11.87 😞 0.06 πŸ‘Ž
Quality 44.31% 😞 44.58% 😞 0.27% πŸ‘
Other metrics Before After Change
Lines 1384 1358 -26
Changed files Quality Before Quality After Quality Change
processscheduler/solution.py 38.14% 😞 36.81% 😞 -1.33% πŸ‘Ž
processscheduler/solver.py 36.08% 😞 37.16% 😞 1.08% πŸ‘
processscheduler/task_constraint.py 73.96% πŸ™‚ 74.50% πŸ™‚ 0.54% πŸ‘

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

File Function Complexity Length Working Memory Quality Recommendation
processscheduler/solution.py SchedulingSolution.render_gantt_matplotlib 50 β›” 684 β›” 22 β›” 6.28% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solver.py SchedulingSolver.__init__ 48 β›” 582 β›” 14 😞 13.55% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solver.py SchedulingSolver.build_solution 42 β›” 425 β›” 12 😞 18.77% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solver.py SchedulingSolver.solve_optimize_incremental 29 😞 290 β›” 15 😞 22.30% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solution.py SchedulingSolution.render_gantt_plotly 23 😞 290 β›” 17 β›” 23.64% β›” Refactor to reduce nesting. 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 #92 (ac421e6) into buffer (095baed) will decrease coverage by 0.00%. The diff coverage is 90.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           buffer      #92      +/-   ##
==========================================
- Coverage   95.33%   95.33%   -0.01%     
==========================================
  Files          33       33              
  Lines        3883     3859      -24     
==========================================
- Hits         3702     3679      -23     
+ Misses        181      180       -1     
Impacted Files Coverage Ξ”
processscheduler/solver.py 96.55% <75.00%> (+0.22%) :arrow_up:
processscheduler/solution.py 94.97% <100.00%> (-0.27%) :arrow_down:
processscheduler/task_constraint.py 100.00% <100.00%> (ΓΈ)

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 095baed...ac421e6. Read the comment docs.