usnistgov / E3

API that provides standards based economic calculations.
Other
6 stars 3 forks source link

Feature: Support mid-year discounting #32

Closed tashakim closed 2 years ago

tashakim commented 2 years ago

Description

This PR makes the following changes following discussion in issue #22.

Rather than using an integer field to indicate end-of-year or mid-year compounding, we define timestepComp to be a Django ChoiceField, that user can choose to be either "EndOfYear", "MidYear", "Continuous". timestepVal will be independent from timestepComp.

The present value computation method in e3_django/compute/api.py was changed to use mid-year discounted costs (t-0.5) instead of (t).

Motivation and Context

Previously, E3 assumed end-of-year (EOY) discounting. However, some third parties would be interested in mid-year discounting (or continuous compounding) rather than EOY. We need a way to track which discounting we are using, and incorporate this into our calculations.

Closes #22