usnistgov / E3

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

Refactor: Analysis object conditions #31

Closed tashakim closed 3 years ago

tashakim commented 3 years ago

Description

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

(1) Adjust the requirement for a minimum of 2 of 3 values for real discount rate, nominal discount rate, and inflation rate. Updated conditions: If real discount rate boolean = true, we need either the (a) real discount rate, or (b) both the nominal discount and inflation rates (used to calculate the real discount rate). Else if real discount rate boolean = false, we need 2 of the 3 to ensure the nominal discount and inflation rates can be calculated.

(2) Federal and other income tax rates should not be required because we do not use them in the current version.

(3) Interest rate is not currently being used and could be null. MARR and reinvestment rates are defaulted to null, and are optional. Since discussion on this part has not resolved, this is a work-in-progress, and can be addressed in a different Pull Request.

Motivation and Context

Prior to this change, just providing the real discount rate threw an error. However, if user has selected 'real discount rate boolean' to be true, then just providing the real discount rate should be sufficient for calculations.

Also, federal and other income tax rates are not applicable for the current non-income calculations, therefore should not be required.

Closes #27