New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a407828329451165 #64
a407828329451165 #64
Conversation
days_per_year=DAYS_PER_YEAR, | ||
announcement_date=ANNOUNCEMENT_DATE): | ||
first_year_days = (date(announcement_date.year, 12, 31) - announcement_date).days | ||
return [first_year_days] + [days_per_year] * NPV_CALCULATION_DURATION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ця функція вже є, забери її
contract_duration_days, | ||
announcement_date=ANNOUNCEMENT_DATE, | ||
days_per_year=DAYS_PER_YEAR): | ||
contract_duration = calculate_contract_duration(contract_duration_years, contract_duration_days, days_per_year) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нехай функція не використовує інших функцій, а приймає готовий потрібний їй набір даних
|
||
|
||
def calculate_income(client_cost_reductions, client_payments): | ||
return map(lambda x, y: x - y, client_cost_reductions, client_payments) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
перепиши без лямбди
@@ -42,6 +48,46 @@ def contract_duration(self): | |||
) | |||
|
|||
|
|||
|
|||
def days_with_cost_reduction(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тестові дані винеси у окремий файл (esco/tests/npv_test_data.py)
calculate_days_for_discount_rate,
calculate_days_with_payments,
calculate_income
i'll try to commit better next time