Skip to content

Commit 1452323

Browse files
committed
lint flake8 remediations
1 parent 51b0f01 commit 1452323

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
pip install flake8
2727
2828
- name: lint with flake8
29-
run: flake8 --ignore=E501,W292
29+
run: flake8 --ignore=E501,W292,W293
3030

3131
- name: run tests
3232
run: |

bot/utils/calculations.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
import math
21
from bot.utils.helpers import generate_estimated_yield
32
from config.settings import DEBUG
43

54

65
# Calculate profit based on user inputs and real-time prices
76
def calculate_custom_profit(prices, herbs, farming_level, patches, weiss, trollheim, hosidius, fortis, compost, kandarin_diary, kourend, magic_secateurs, farming_cape, bottomless_bucket, attas):
87
# Constants and multipliers
9-
compost_chance_reduction = {'None': 1, 'Compost': 2, 'Supercompost': 5, 'Ultracompost': 10}
108
compost_life_value = {'None': 0, 'Compost': 1, 'Supercompost': 2, 'Ultracompost': 3}
119
item_bonus = 0.1 if magic_secateurs else 0
1210
item_bonus += 0.05 if farming_cape else 0
1311
kandarin_bonus = float(kandarin_diary.split('%')[0]) / 100 if kandarin_diary != 'None' else 0
1412
kourend_bonus = 0.05 if kourend else 0
15-
diary_bonus = kandarin_bonus + kourend_bonus
16-
compost_bonus = compost_chance_reduction.get(compost, 1)
13+
diary_bonus = kandarin_bonus + kourend_bonus
1714
compost_life = compost_life_value.get(compost, 0)
1815
attas_bonus = 0.05 if attas else 0 # Assuming animaType can be checked similarly
1916

@@ -54,7 +51,7 @@ def calculate_custom_profit(prices, herbs, farming_level, patches, weiss, trollh
5451
# Calculate expected yield using detailed mechanics
5552
expected_yield_unprotected = generate_estimated_yield(
5653
farming_level, low_cts, high_cts, harvest_lives, item_bonus, diary_bonus, attas_bonus)
57-
54+
5855
# Calculate total yield and profit for unprotected patches
5956
total_yield_unprotected = expected_yield_unprotected * unprotected_patches
6057

0 commit comments

Comments
 (0)