tpaviot / ProcessScheduler

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

Refactor Constraint class hierarchy #98

Closed tpaviot closed 3 years ago

codecov-commenter commented 3 years ago

Codecov Report

Merging #98 (fb84a81) into master (cb49252) will increase coverage by 0.00%. The diff coverage is 98.18%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #98   +/-   ##
=======================================
  Coverage   95.13%   95.14%           
=======================================
  Files          34       35    +1     
  Lines        3884     3889    +5     
=======================================
+ Hits         3695     3700    +5     
  Misses        189      189           
Impacted Files Coverage Δ
processscheduler/base.py 93.33% <ø> (-0.79%) :arrow_down:
processscheduler/constraint.py 96.15% <96.15%> (ø)
processscheduler/__init__.py 88.23% <100.00%> (ø)
processscheduler/context.py 90.90% <100.00%> (ø)
processscheduler/problem.py 97.14% <100.00%> (ø)
processscheduler/resource_constraint.py 95.83% <100.00%> (ø)
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 cb49252...fb84a81. Read the comment docs.

sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.91 ⭐ 5.04 ⭐ 0.13 👎
Method Length 49.56 ⭐ 50.00 ⭐ 0.44 👎
Working memory 7.89 🙂 7.93 🙂 0.04 👎
Quality 71.74% 🙂 71.29% 🙂 -0.45% 👎
Other metrics Before After Change
Lines 1085 1046 -39
Changed files Quality Before Quality After Quality Change
processscheduler/init.py 83.46% ⭐ 83.46% ⭐ 0.00%
processscheduler/base.py 86.77% ⭐ 90.54% ⭐ 3.77% 👍
processscheduler/context.py 91.39% ⭐ 91.39% ⭐ 0.00%
processscheduler/problem.py 72.23% 🙂 72.23% 🙂 0.00%
processscheduler/resource_constraint.py 48.03% 😞 48.03% 😞 0.00%
processscheduler/task_constraint.py 74.23% 🙂 74.23% 🙂 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
processscheduler/resource_constraint.py WorkLoad.__init__ 13 🙂 256 ⛔ 14 😞 35.99% 😞 Try splitting into smaller methods. Extract out complex expressions
processscheduler/resource_constraint.py ResourceTasksDistance.__init__ 14 🙂 211 ⛔ 12 😞 40.75% 😞 Try splitting into smaller methods. Extract out complex expressions
processscheduler/task_constraint.py ScheduleNTasksInTimeIntervals.__init__ 5 ⭐ 182 😞 13 😞 49.69% 😞 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
processscheduler/problem.py SchedulingProblem.add_indicator_resource_cost 15 🙂 126 😞 7 🙂 58.20% 🙂 Try splitting into smaller methods

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!