Skip to content
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

Costing Unification: reorganize classes and consistent calculation of capital annualization #1299

Merged
merged 16 commits into from
Mar 15, 2024

Conversation

bknueven
Copy link
Contributor

@bknueven bknueven commented Feb 15, 2024

Fixes: #1134 (part 3 of 3)

Summary/Motivation:

This PR completes the reorganization of WaterTAP's costing framework.

Changes proposed in this PR:

  • Move code common to both the WaterTAPCosting and ZeroOrderCosting packages to base class
  • Remove references to factor_capital_annualization to standardize the name capital_recovery_factor in both packages. Also renames factor_maintenance_labor_chemical and factor_total_investment to maintenance_labor_chemical_factor and total_investment_factor, respectively, for consistency with capital_recovery_factor, utilization_factor, etc.
  • Unify the handling of the capital annualization factor: by default wacc / plant_lifetime are fixed and capital_recovery_factor is calculated. A warning is raised during initialization of the costing package if exactly two of these three variables is not fixed.
  • Modifications to a few examples which fixed factor_capital_annualization (now capital_recovery_factor) on the WaterTAPCosting package.
  • Creates a new costing package, WaterTAPCostingDetailed, which has the same variables / parameters as the ZeroOrderCosting package, but the same assumptions as the WaterTAPCosting package. The ZeroOrderCosting package now inherits from WaterTAPCostingDetailed.
  • Added tests for WaterTAPCostingDetailed and the new handling of capital annualization factor.
  • Modify the documentation to reflect above, including improved and streamlined documentation of existing functionality.

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

Attention: Patch coverage is 97.81022% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 94.25%. Comparing base (4f8c33a) to head (4a127fb).

Files Patch % Lines
watertap/costing/watertap_costing_package.py 98.18% 2 Missing ⚠️
watertap/costing/zero_order_costing.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1299   +/-   ##
=======================================
  Coverage   94.24%   94.25%           
=======================================
  Files         371      370    -1     
  Lines       37943    37952    +9     
=======================================
+ Hits        35761    35770    +9     
  Misses       2182     2182           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Feb 15, 2024
@bknueven
Copy link
Contributor Author

Per discussion, maybe we should rename factor_capital_annualization to factor_capital_recovery.

@bknueven bknueven marked this pull request as ready for review February 16, 2024 23:28
Copy link
Contributor

@kurbansitterley kurbansitterley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lbianchi-lbl lbianchi-lbl enabled auto-merge (squash) March 15, 2024 16:25
@lbianchi-lbl lbianchi-lbl merged commit 635c757 into watertap-org:main Mar 15, 2024
24 checks passed
@adam-a-a adam-a-a mentioned this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Normal Normal Priority Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify costing packages
5 participants