usnistgov / E3

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

Dev #2

Closed tashakim closed 3 years ago

tashakim commented 3 years ago

Notes (plz read with comments in files):

1. Measures Library (1) methods: sumCosts, sumBenefits - where does studyPeriod come from, and is calculation for totalBenefits correct? (2) method: sumCosts - should input to sumCosts be totReqFlow totBenefitsDisc? (3) method sumNonInv?

2. Discounting Library (1) how to check type (real vs. nominal) of escalation rate? (2) formula implementation on lines 53, 60, 66, 70, 96, 102, 104 needs checking

3. Analysis Class (1) line 186: which method in Discounting library should be called? (2) valid range of fields (used validators min/max) needs checking (3) BCN Class needs input range checking

4. Alternative Class (1) init: needs to check alternativeBCNList is associated to BCNIDs. Unsure how this could be done

5. BCNStorage Class (1) methods: updateSensFlows, updateUncFlows - how to update sensitivity & uncertainty flows?

6. TotalOptionalFlows Class (1) bcnType, bcnSubType - stored for convenience; Should I pull these from BCN object?

7. AlternativeSummary Class (1) method: updateMeasure: which var should be updated? (2) variables in class (unique, default, range) needs to be added

dw13813 commented 3 years ago

Hi Tasha,

Answers for the simpler questions have been provided, I’ll look at the code tomorrow unless you want to check at the meeting today. Also I put up the first batch of unit tests today.

David

From: Tasha Kim notifications@github.com Reply-To: usnistgov/E3 reply@reply.github.com Date: Monday, March 8, 2021 at 1:25 PM To: usnistgov/E3 E3@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [usnistgov/E3] Dev (#2)

Notes (plz read with comments in files):

  1. Measures Library (1) methods: sumCosts, sumBenefits - where does studyPeriod come from, and is calculation for totalBenefits correct?

I noticed the issues while writing up the unit tests. sumCosts and sum Benefits have been corrected. Study period is required for the formula, however the code can simply sum all elements of the discounted costs and benefits list, implicitly accounting for study period. (2) method: sumCosts - should input to sumCosts be totReqFlow totBenefitsDisc?

Should be totCostsDisc for Costs and totBenefitsDisc for Benefits (3) method sumNonInv?

Added in files I committed today.

  1. Discounting Library (1) how to check type (real vs. nominal) of escalation rate?

Add analysis.analysisType as an input and create an if statement using it to differentiate between them. This will need to be done in a few other places. (2) formula implementation on lines 53, 60, 66, 70, 96, 102, 104 needs checking

Will do.

  1. Analysis Class (1) line 186: which method in Discounting library should be called?

I’ll update you once I have a chance to look at your code. (2) valid range of fields (used validators min/max) needs checking (3) BCN Class needs input range checking

  1. Alternative Class (1) init: needs to check alternativeBCNList is associated to BCNIDs. Unsure how this could be done

Generate BCN objects first. They should have the altID(s) they’re attached to stored. When generating alternative objects loop through BCNs and verify by comparing. Alternatively you could construct the alternative.bcnList as blank and construct the list by looping through the BCNs. This would implicitly verify the alternative object.

  1. BCNStorage Class (1) methods: updateSensFlows, updateUncFlows - how to update sensitivity & uncertainty flows?

I’m still figuring these out as I write main. For now you can focus on the basic calculations.

  1. TotalOptionalFlows Class (1) bcnType, bcnSubType - stored for convenience; Should I pull these from BCN object?

Yes

  1. AlternativeSummary Class (1) method: updateMeasure: which var should be updated?

Var should be an input. Essentially the string for the variable name. For instance you could update SIR using var == “SIR” or bcr as var == “BCR”. This is currently doing nothing and is there in case it makes sense to use it for the uncertainty calculation

(2) variables in class (unique, default, range) needs to be added

“I’ll check this”


You can view, comment on, or merge this pull request online at:

https://github.com/usnistgov/E3/pull/2

Commit Summary

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/usnistgov/E3/pull/2, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AANSOMHFPDSRHCUEAP7SOSTTCUJA5ANCNFSM4YZ4TVWQ.

tashakim commented 3 years ago

David, thank you for your prompt response. I was hoping to elaborate more on these notes today in the meeting, and wrote these notes so we can keep track.

Thanks for putting up the unit tests. These are very helpful