ProFAST 1.0.6__tar.gz → 1.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {profast-1.0.6 → profast-1.0.7}/LICENSE +8 -8
- profast-1.0.7/NOTICE.txt +3 -0
- {profast-1.0.6/ProFAST.egg-info → profast-1.0.7}/PKG-INFO +18 -16
- profast-1.0.7/ProFAST/__init__.py +26 -0
- profast-1.0.7/ProFAST/examples/incentives_example.py +66 -0
- profast-1.0.7/ProFAST/profast_wrapper.py +260 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/pyc_files/ProFAST_308.pyc +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/pyc_files/ProFAST_309.pyc +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/pyc_files/ProFAST_310.pyc +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/pyc_files/ProFAST_311.pyc +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/pyc_files/ProFAST_312.pyc +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/pyc_files/ProFAST_313.pyc +0 -0
- profast-1.0.7/ProFAST/pyc_files/ProFAST_314.pyc +0 -0
- profast-1.0.7/ProFAST/pyc_files/ProFAST_315.pyc +0 -0
- profast-1.0.7/ProFAST/tools/__init__.py +2 -0
- profast-1.0.7/ProFAST/tools/profast_run_tools.py +291 -0
- profast-1.0.7/ProFAST/tools/profast_to_dict_tools.py +134 -0
- profast-1.0.7/ProFAST/tools/utilities.py +75 -0
- {profast-1.0.6 → profast-1.0.7/ProFAST.egg-info}/PKG-INFO +18 -16
- {profast-1.0.6 → profast-1.0.7}/ProFAST.egg-info/SOURCES.txt +8 -2
- {profast-1.0.6 → profast-1.0.7}/ProFAST.egg-info/requires.txt +1 -0
- {profast-1.0.6 → profast-1.0.7}/README.md +4 -4
- {profast-1.0.6 → profast-1.0.7}/pyproject.toml +5 -4
- profast-1.0.6/NOTICE.txt +0 -3
- profast-1.0.6/ProFAST/__init__.py +0 -20
- profast-1.0.6/ProFAST/resources/h2-fast-2022-07202023-generic-fueling.xlsm +0 -0
- profast-1.0.6/ProFAST/resources/h2-fast-2022-0915.xlsm +0 -0
- {profast-1.0.6 → profast-1.0.7}/MANIFEST.in +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/examples/ProFAST_example.py +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/examples/generic_example.py +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/central_biomass_gasification.json +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/central_coal_gasification_w_ccs.json +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/central_grid_electrolysis_PEM.json +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/central_grid_electrolysis_solid_oxide.json +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/central_natural_gas_reforming_no_ccs.json +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/central_natural_gas_reforming_w_ccs.json +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/central_solar_electrolysis.json +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/central_wind_electrolysis.json +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/gen_h2_fueling.json +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/only_variables.json +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST/resources/regional_feedstock_costs.csv +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST.egg-info/dependency_links.txt +0 -0
- {profast-1.0.6 → profast-1.0.7}/ProFAST.egg-info/top_level.txt +0 -0
- {profast-1.0.6 → profast-1.0.7}/setup.cfg +0 -0
- {profast-1.0.6 → profast-1.0.7}/tests/test_compare_with_excel.py +0 -0
- {profast-1.0.6 → profast-1.0.7}/tests/test_outputs.py +0 -0
- {profast-1.0.6 → profast-1.0.7}/tests/test_setting_variables.py +0 -0
- {profast-1.0.6 → profast-1.0.7}/tests/test_solvers.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
END USER SOFTWARE LICENSE AGREEMENT
|
|
2
2
|
|
|
3
|
-
This License Agreement (“Agreement”) is between the Alliance for
|
|
3
|
+
This License Agreement (“Agreement”) is between the Alliance for Energy Innovation, LLC (“Alliance”), the manager and operator of the National Laboratory of the Rockies (“NLR”) for the U.S. Department of Energy (the “DOE”) and you (“Licensee”) hereinafter “Party” or collectively the “Parties.” By downloading, accessing, or using the Software described hereunder, you agree to be bound by the terms of this Agreement.
|
|
4
4
|
|
|
5
5
|
IF YOU ARE ENTERING INTO THIS AGREEMENT WITHIN THE SCOPE OF YOUR EMPLOYMENT OR IN CONNECTION WITH YOUR ENGAGEMENT AS AN INDEPENDENT CONTRACTOR, THEN THE TERM “LICENSEE” INCLUDES YOUR EMPLOYER OR PRINCIPAL CONTRACTOR, AS APPLICABLE, AND YOU REPRESENT AND WARRANT TO ALLIANCE THAT YOU ARE AUTHORIZED TO ACCEPT THIS AGREEMENT ON SUCH EMPLOYER’S OR PRINCIPAL CONTRACTOR’S BEHALF.
|
|
6
6
|
|
|
7
7
|
1. License Grant.
|
|
8
|
-
Alliance hereby grants Licensee a royalty-free, nonexclusive, nontransferable, limited license for the computer software program “ProFAST (Production Financial Analysis Scenario Tool)” (
|
|
8
|
+
Alliance hereby grants Licensee a royalty-free, nonexclusive, nontransferable, limited license for the computer software program “ProFAST (Production Financial Analysis Scenario Tool)” (NLR Software Record no. SWR-23-88) in executable format, together with any documentation provided by Alliance which relates to its functional, operational or performance characteristics, as made available to Licensee via https://www.github.com/natlabrockies/profast, and as modified from time to time (“Software”) to install, copy, and run the Software for noncommercial, internal research purposes only.
|
|
9
9
|
1.1. Licensee may not disclose Software source code or any executable code generated therefrom to any third party.
|
|
10
10
|
1.2. Licensee may not translate, decompile, reverse engineer, disassemble or otherwise attempt to create a human-readable version of the Software to the extent supplied in object code format.
|
|
11
11
|
1.3. Any copies of the Software made by Licensee shall be subject to the terms of this Agreement.
|
|
@@ -14,18 +14,18 @@ Alliance hereby grants Licensee a royalty-free, nonexclusive, nontransferable, l
|
|
|
14
14
|
|
|
15
15
|
NOTICE
|
|
16
16
|
|
|
17
|
-
Copyright © 2024 Alliance for
|
|
17
|
+
Copyright © 2024 Alliance for Energy Innovation, LLC, Inc. All Rights Reserved
|
|
18
18
|
|
|
19
|
-
This computer software was produced by the Alliance for
|
|
19
|
+
This computer software was produced by the Alliance for Energy Innovation, LLC (Contractor) under Contract No. DE-AC36-08GO28308 with the U.S. Department of Energy (DOE). During the period of commercialization or such other time period specified by the DOE, the Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this data to reproduce, prepare derivative works, and perform publicly and display publicly, by or on behalf of the Government. Subsequent to that period the Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this data to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. The specific term of the license can be identified by inquiry made to the Contractor or DOE. NEITHER THE UNITED STATES NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY DATA, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
|
|
20
20
|
|
|
21
|
-
1.6. Licensee agrees to credit the DOE,
|
|
21
|
+
1.6. Licensee agrees to credit the DOE, NLR, and Alliance in any publication or public presentation that results from use of the Software. However, the names of NLR, DOE, or Alliance may not be used to endorse or promote products derived from this software without specific prior written permission.
|
|
22
22
|
1.7. Alliance makes no guarantee of accessibility or ongoing availability of the Repository or of the Software. Alliance may revoke Licensee’s access or remove any or all portions of the Software from the Repository at any time and for any reason (or for no reason). Licensee agrees that Alliance has no obligation to provide access to the Repository or provide the Software.
|
|
23
23
|
|
|
24
24
|
2. Maintenance or Support. Licensee assumes sole responsibility for the installation, use and results obtained from use of the Software. Alliance shall be under no obligation whatsoever to: (i) provide maintenance or support for Software; or (ii) to notify Licensee of bug fixes, patches, or upgrades to Software (if any). If, in its sole discretion, Alliance makes a Software bug fix, patch or upgrade available to Licensee and Alliance does not separately enter into a written license agreement with Licensee relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement.
|
|
25
25
|
3. United States Government Rights. The Software was developed under funding from the DOE, and the United States Government retains certain rights as follows: For five (5) years after the date permission to assert copyright is obtained from the DOE, and during any subsequent five (5) year renewals, the United States Government is granted for itself and others acting on its behalf a non-exclusive, paid-up, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, perform publicly and display publicly. Subsequent to that period or any extension granted, the Government is granted for itself and others acting on its behalf, a nonexclusive, paid-up, irrevocable worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, perform publicly and display publicly, and to permit others to do so.
|
|
26
|
-
4. Warranty Disclaimer. THE SOFTWARE IS SUPPLIED “AS IS” WITHOUT WARRANTY OF ANY KIND. ALLIANCE,
|
|
27
|
-
5. Limitation of Liability. IN NO EVENT WILL ALLIANCE,
|
|
26
|
+
4. Warranty Disclaimer. THE SOFTWARE IS SUPPLIED “AS IS” WITHOUT WARRANTY OF ANY KIND. ALLIANCE, NLR, THE UNITED STATES GOVERNMENT, DOE, AND THEIR EMPLOYEES, OFFICERS AND AGENTS: (i) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (ii) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF SOFTWARE, (iii) DO NOT REPRESENT THAT USE OF SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, AND (iv) DO NOT WARRANT THAT THE OPERATION OF SOFTWARE WILL BE UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED.
|
|
27
|
+
5. Limitation of Liability. IN NO EVENT WILL ALLIANCE, NLR, DOE OR THE UNITED STATES GOVERNMENT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE (INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS, LOSS OF DATA, LOSS OF USE, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES OR BUSINESS INTERRUPTION) FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF ALLIANCE, NLR, DOE OR THE UNITED STATES GOVERNMENT IS MADE AWARE OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES.
|
|
28
28
|
6. Indemnity. Licensee shall indemnify, defend, and hold harmless Alliance, the DOE, the U.S. Government, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with Licensee’s use of the Software pursuant to this Agreement. Licensee shall pay all costs incurred by Alliance, the DOE and the U.S. Government in enforcing this provision, including reasonable attorney fees. Licensee shall comply with all applicable laws and regulations (including privacy laws and regulations) having application to or governing its use and/or operation of the Software and agrees to indemnify and hold DOE, Alliance and the U.S. Government harmless from and against any claims, damages, losses or obligations suffered or incurred by Alliance directly or indirectly arising from its failure to so comply.
|
|
29
29
|
7. Term and Termination. The license granted to Licensee under this Agreement shall continue unless terminated earlier in accordance with this Agreement. Alliance shall have the right to terminate this license in its sole discretion at any time and for any reason (or for no reason) upon notice to Licensee. If Licensee breaches any term of this Agreement, and fails to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Licensee may terminate this Agreement without cause upon thirty (30) days written notice to Alliance. Upon termination of the Agreement, Licensee shall immediately cease using the Software, destroy all copies of the Software, and provide Alliance with written certification of Licensee’s compliance with the foregoing. Notwithstanding any provision of this Agreement to the contrary, Sections 1.5, 1.6, and 3 through 9 shall survive termination of this Agreement.
|
|
30
30
|
8. Export Controls. Licensee shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of Software, related technical data and direct products thereof, including, without limitation, the Export Administration Regulations.
|
|
31
|
-
9. General. This Agreement, and the rights and liabilities of the Parties with respect to this Agreement and its subject matter, shall be governed by the laws of the State of Colorado, without reference to the principles of conflicts of laws thereof. Any dispute arising out of or relating to this Agreement or its subject matter not settled by the Parties may be resolved only by the courts of the State of Colorado, or if subject matter jurisdiction exists, by the United States federal courts, with venue in the County of Denver (in the case of state court) or in the U.S. District Court for the District of Colorado (in the case of federal court). Each of the Parties hereby consents to the jurisdiction of such courts over it in any action involving any such dispute. Each of the Parties agree not to commence or maintain a legal proceeding involving any such dispute in any forum except a court of the State of Colorado located in Denver County or the United States District Court for the District of Colorado (other than to enforce a judgment obtained in such courts) and agrees not to contest the venue of any action involving any such dispute in the County of Denver or the District of Colorado, as the case may be, nor to assert in any such court the doctrine of forum non conveniens, or the like. Any modification or amendment of this Agreement must be in writing signed by a duly authorized representative of each Party. This Agreement is binding upon and shall inure to the benefit of Alliance, its successors and assignees and therefore may be assigned to a successor operator of
|
|
31
|
+
9. General. This Agreement, and the rights and liabilities of the Parties with respect to this Agreement and its subject matter, shall be governed by the laws of the State of Colorado, without reference to the principles of conflicts of laws thereof. Any dispute arising out of or relating to this Agreement or its subject matter not settled by the Parties may be resolved only by the courts of the State of Colorado, or if subject matter jurisdiction exists, by the United States federal courts, with venue in the County of Denver (in the case of state court) or in the U.S. District Court for the District of Colorado (in the case of federal court). Each of the Parties hereby consents to the jurisdiction of such courts over it in any action involving any such dispute. Each of the Parties agree not to commence or maintain a legal proceeding involving any such dispute in any forum except a court of the State of Colorado located in Denver County or the United States District Court for the District of Colorado (other than to enforce a judgment obtained in such courts) and agrees not to contest the venue of any action involving any such dispute in the County of Denver or the District of Colorado, as the case may be, nor to assert in any such court the doctrine of forum non conveniens, or the like. Any modification or amendment of this Agreement must be in writing signed by a duly authorized representative of each Party. This Agreement is binding upon and shall inure to the benefit of Alliance, its successors and assignees and therefore may be assigned to a successor operator of NLR for the United States Government. This Agreement represents the entire understanding of the Parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. This license does not constitute an endorsement of Licensee’s products and/or services, if any, and Licensee shall not use the names, logos or brands of Alliance, NLR or DOE without the express written consent of Alliance, or DOE as applicable. If any part of this Agreement is found void and unenforceable, it will not affect the validity of the balance of the Agreement, which shall remain valid and enforceable according to its terms.
|
profast-1.0.7/NOTICE.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
NOTICE
|
|
2
|
+
Copyright © 2023 Alliance for Energy Innovation, LLC
|
|
3
|
+
These data were produced by the Alliance for Energy Innovation, LLC (Contractor) under Contract No. DE-AC36-08GO28308 with the U.S. Department of Energy (DOE). During the period of commercialization or such other time period specified by the DOE, the Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this data to reproduce, prepare derivative works, and perform publicly and display publicly, by or on behalf of the Government. Subsequent to that period the Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this data to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. The specific term of the license can be identified by inquiry made to the Contractor or DOE. NEITHER CONTRACTOR, THE UNITED STATES, NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY DATA, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: ProFAST
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
4
4
|
Summary: Production Financial Analysis Scenario Tool
|
|
5
|
-
Author-email: Jamie Kee <Jamie.Kee@
|
|
5
|
+
Author-email: Jamie Kee <Jamie.Kee@nlr.gov>, Michael Penev <Michael.Penev@nlr.gov>
|
|
6
6
|
License: END USER SOFTWARE LICENSE AGREEMENT
|
|
7
7
|
|
|
8
|
-
This License Agreement (“Agreement”) is between the Alliance for
|
|
8
|
+
This License Agreement (“Agreement”) is between the Alliance for Energy Innovation, LLC (“Alliance”), the manager and operator of the National Laboratory of the Rockies (“NLR”) for the U.S. Department of Energy (the “DOE”) and you (“Licensee”) hereinafter “Party” or collectively the “Parties.” By downloading, accessing, or using the Software described hereunder, you agree to be bound by the terms of this Agreement.
|
|
9
9
|
|
|
10
10
|
IF YOU ARE ENTERING INTO THIS AGREEMENT WITHIN THE SCOPE OF YOUR EMPLOYMENT OR IN CONNECTION WITH YOUR ENGAGEMENT AS AN INDEPENDENT CONTRACTOR, THEN THE TERM “LICENSEE” INCLUDES YOUR EMPLOYER OR PRINCIPAL CONTRACTOR, AS APPLICABLE, AND YOU REPRESENT AND WARRANT TO ALLIANCE THAT YOU ARE AUTHORIZED TO ACCEPT THIS AGREEMENT ON SUCH EMPLOYER’S OR PRINCIPAL CONTRACTOR’S BEHALF.
|
|
11
11
|
|
|
12
12
|
1. License Grant.
|
|
13
|
-
Alliance hereby grants Licensee a royalty-free, nonexclusive, nontransferable, limited license for the computer software program “ProFAST (Production Financial Analysis Scenario Tool)” (
|
|
13
|
+
Alliance hereby grants Licensee a royalty-free, nonexclusive, nontransferable, limited license for the computer software program “ProFAST (Production Financial Analysis Scenario Tool)” (NLR Software Record no. SWR-23-88) in executable format, together with any documentation provided by Alliance which relates to its functional, operational or performance characteristics, as made available to Licensee via https://www.github.com/natlabrockies/profast, and as modified from time to time (“Software”) to install, copy, and run the Software for noncommercial, internal research purposes only.
|
|
14
14
|
1.1. Licensee may not disclose Software source code or any executable code generated therefrom to any third party.
|
|
15
15
|
1.2. Licensee may not translate, decompile, reverse engineer, disassemble or otherwise attempt to create a human-readable version of the Software to the extent supplied in object code format.
|
|
16
16
|
1.3. Any copies of the Software made by Licensee shall be subject to the terms of this Agreement.
|
|
@@ -19,23 +19,23 @@ License: END USER SOFTWARE LICENSE AGREEMENT
|
|
|
19
19
|
|
|
20
20
|
NOTICE
|
|
21
21
|
|
|
22
|
-
Copyright © 2024 Alliance for
|
|
22
|
+
Copyright © 2024 Alliance for Energy Innovation, LLC, Inc. All Rights Reserved
|
|
23
23
|
|
|
24
|
-
This computer software was produced by the Alliance for
|
|
24
|
+
This computer software was produced by the Alliance for Energy Innovation, LLC (Contractor) under Contract No. DE-AC36-08GO28308 with the U.S. Department of Energy (DOE). During the period of commercialization or such other time period specified by the DOE, the Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this data to reproduce, prepare derivative works, and perform publicly and display publicly, by or on behalf of the Government. Subsequent to that period the Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this data to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. The specific term of the license can be identified by inquiry made to the Contractor or DOE. NEITHER THE UNITED STATES NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY DATA, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
|
|
25
25
|
|
|
26
|
-
1.6. Licensee agrees to credit the DOE,
|
|
26
|
+
1.6. Licensee agrees to credit the DOE, NLR, and Alliance in any publication or public presentation that results from use of the Software. However, the names of NLR, DOE, or Alliance may not be used to endorse or promote products derived from this software without specific prior written permission.
|
|
27
27
|
1.7. Alliance makes no guarantee of accessibility or ongoing availability of the Repository or of the Software. Alliance may revoke Licensee’s access or remove any or all portions of the Software from the Repository at any time and for any reason (or for no reason). Licensee agrees that Alliance has no obligation to provide access to the Repository or provide the Software.
|
|
28
28
|
|
|
29
29
|
2. Maintenance or Support. Licensee assumes sole responsibility for the installation, use and results obtained from use of the Software. Alliance shall be under no obligation whatsoever to: (i) provide maintenance or support for Software; or (ii) to notify Licensee of bug fixes, patches, or upgrades to Software (if any). If, in its sole discretion, Alliance makes a Software bug fix, patch or upgrade available to Licensee and Alliance does not separately enter into a written license agreement with Licensee relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement.
|
|
30
30
|
3. United States Government Rights. The Software was developed under funding from the DOE, and the United States Government retains certain rights as follows: For five (5) years after the date permission to assert copyright is obtained from the DOE, and during any subsequent five (5) year renewals, the United States Government is granted for itself and others acting on its behalf a non-exclusive, paid-up, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, perform publicly and display publicly. Subsequent to that period or any extension granted, the Government is granted for itself and others acting on its behalf, a nonexclusive, paid-up, irrevocable worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, perform publicly and display publicly, and to permit others to do so.
|
|
31
|
-
4. Warranty Disclaimer. THE SOFTWARE IS SUPPLIED “AS IS” WITHOUT WARRANTY OF ANY KIND. ALLIANCE,
|
|
32
|
-
5. Limitation of Liability. IN NO EVENT WILL ALLIANCE,
|
|
31
|
+
4. Warranty Disclaimer. THE SOFTWARE IS SUPPLIED “AS IS” WITHOUT WARRANTY OF ANY KIND. ALLIANCE, NLR, THE UNITED STATES GOVERNMENT, DOE, AND THEIR EMPLOYEES, OFFICERS AND AGENTS: (i) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (ii) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF SOFTWARE, (iii) DO NOT REPRESENT THAT USE OF SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, AND (iv) DO NOT WARRANT THAT THE OPERATION OF SOFTWARE WILL BE UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED.
|
|
32
|
+
5. Limitation of Liability. IN NO EVENT WILL ALLIANCE, NLR, DOE OR THE UNITED STATES GOVERNMENT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE (INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS, LOSS OF DATA, LOSS OF USE, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES OR BUSINESS INTERRUPTION) FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF ALLIANCE, NLR, DOE OR THE UNITED STATES GOVERNMENT IS MADE AWARE OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES.
|
|
33
33
|
6. Indemnity. Licensee shall indemnify, defend, and hold harmless Alliance, the DOE, the U.S. Government, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with Licensee’s use of the Software pursuant to this Agreement. Licensee shall pay all costs incurred by Alliance, the DOE and the U.S. Government in enforcing this provision, including reasonable attorney fees. Licensee shall comply with all applicable laws and regulations (including privacy laws and regulations) having application to or governing its use and/or operation of the Software and agrees to indemnify and hold DOE, Alliance and the U.S. Government harmless from and against any claims, damages, losses or obligations suffered or incurred by Alliance directly or indirectly arising from its failure to so comply.
|
|
34
34
|
7. Term and Termination. The license granted to Licensee under this Agreement shall continue unless terminated earlier in accordance with this Agreement. Alliance shall have the right to terminate this license in its sole discretion at any time and for any reason (or for no reason) upon notice to Licensee. If Licensee breaches any term of this Agreement, and fails to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Licensee may terminate this Agreement without cause upon thirty (30) days written notice to Alliance. Upon termination of the Agreement, Licensee shall immediately cease using the Software, destroy all copies of the Software, and provide Alliance with written certification of Licensee’s compliance with the foregoing. Notwithstanding any provision of this Agreement to the contrary, Sections 1.5, 1.6, and 3 through 9 shall survive termination of this Agreement.
|
|
35
35
|
8. Export Controls. Licensee shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of Software, related technical data and direct products thereof, including, without limitation, the Export Administration Regulations.
|
|
36
|
-
9. General. This Agreement, and the rights and liabilities of the Parties with respect to this Agreement and its subject matter, shall be governed by the laws of the State of Colorado, without reference to the principles of conflicts of laws thereof. Any dispute arising out of or relating to this Agreement or its subject matter not settled by the Parties may be resolved only by the courts of the State of Colorado, or if subject matter jurisdiction exists, by the United States federal courts, with venue in the County of Denver (in the case of state court) or in the U.S. District Court for the District of Colorado (in the case of federal court). Each of the Parties hereby consents to the jurisdiction of such courts over it in any action involving any such dispute. Each of the Parties agree not to commence or maintain a legal proceeding involving any such dispute in any forum except a court of the State of Colorado located in Denver County or the United States District Court for the District of Colorado (other than to enforce a judgment obtained in such courts) and agrees not to contest the venue of any action involving any such dispute in the County of Denver or the District of Colorado, as the case may be, nor to assert in any such court the doctrine of forum non conveniens, or the like. Any modification or amendment of this Agreement must be in writing signed by a duly authorized representative of each Party. This Agreement is binding upon and shall inure to the benefit of Alliance, its successors and assignees and therefore may be assigned to a successor operator of
|
|
36
|
+
9. General. This Agreement, and the rights and liabilities of the Parties with respect to this Agreement and its subject matter, shall be governed by the laws of the State of Colorado, without reference to the principles of conflicts of laws thereof. Any dispute arising out of or relating to this Agreement or its subject matter not settled by the Parties may be resolved only by the courts of the State of Colorado, or if subject matter jurisdiction exists, by the United States federal courts, with venue in the County of Denver (in the case of state court) or in the U.S. District Court for the District of Colorado (in the case of federal court). Each of the Parties hereby consents to the jurisdiction of such courts over it in any action involving any such dispute. Each of the Parties agree not to commence or maintain a legal proceeding involving any such dispute in any forum except a court of the State of Colorado located in Denver County or the United States District Court for the District of Colorado (other than to enforce a judgment obtained in such courts) and agrees not to contest the venue of any action involving any such dispute in the County of Denver or the District of Colorado, as the case may be, nor to assert in any such court the doctrine of forum non conveniens, or the like. Any modification or amendment of this Agreement must be in writing signed by a duly authorized representative of each Party. This Agreement is binding upon and shall inure to the benefit of Alliance, its successors and assignees and therefore may be assigned to a successor operator of NLR for the United States Government. This Agreement represents the entire understanding of the Parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. This license does not constitute an endorsement of Licensee’s products and/or services, if any, and Licensee shall not use the names, logos or brands of Alliance, NLR or DOE without the express written consent of Alliance, or DOE as applicable. If any part of this Agreement is found void and unenforceable, it will not affect the validity of the balance of the Agreement, which shall remain valid and enforceable according to its terms.
|
|
37
37
|
|
|
38
|
-
Requires-Python: <3.
|
|
38
|
+
Requires-Python: <3.16,>=3.8
|
|
39
39
|
Description-Content-Type: text/markdown
|
|
40
40
|
License-File: LICENSE
|
|
41
41
|
License-File: NOTICE.txt
|
|
@@ -48,19 +48,21 @@ Requires-Dist: plotly
|
|
|
48
48
|
Requires-Dist: pyarrow
|
|
49
49
|
Requires-Dist: pytest
|
|
50
50
|
Requires-Dist: xlwings
|
|
51
|
+
Requires-Dist: pyyaml-include
|
|
52
|
+
Dynamic: license-file
|
|
51
53
|
|
|
52
54
|
# ProFAST
|
|
53
55
|
The Production Financial Analysis Scenario Tool (ProFAST) is the python version of H2FAST. ProFAST provides a quick and convenient in-depth financial analysis for production systems and services based on Generally Accepted Accounting Principles (GAAP) methodology.
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
The underlying algorithm used in ProFAST comes from the Excel-based [H2FAST](https://www.nlr.gov/hydrogen/h2fast) [SWR-15-06](https://www.osti.gov/biblio/code-106823) developed by Michael Penev at the National Laboratory of the Rockies, who also developed the initial code base. Primary development and maintenance of the ProFAST package was performed by Jamie Kee at the National Laboratory of the Rockies.
|
|
56
58
|
|
|
57
|
-
<img src="https://www.
|
|
59
|
+
<img src="https://www.nlr.gov/images/libraries/hydrogen-images/h2fast-icon.png?sfvrsn=fbaefec7_1" alt="H2FAST Logo" style="width:100px;"/>
|
|
58
60
|
|
|
59
61
|
# NOTICE
|
|
60
62
|
[NOTICE.txt](NOTICE.txt)
|
|
61
63
|
|
|
62
|
-
Copyright © 2023 Alliance for
|
|
63
|
-
These data were produced by the Alliance for
|
|
64
|
+
Copyright © 2023 Alliance for Energy Innovation, LLC
|
|
65
|
+
These data were produced by the Alliance for Energy Innovation, LLC (Contractor) under Contract No. DE-AC36-08GO28308 with the U.S. Department of Energy (DOE). During the period of commercialization or such other time period specified by the DOE, the Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this data to reproduce, prepare derivative works, and perform publicly and display publicly, by or on behalf of the Government. Subsequent to that period the Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this data to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. The specific term of the license can be identified by inquiry made to the Contractor or DOE. NEITHER CONTRACTOR, THE UNITED STATES, NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY DATA, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
|
|
64
66
|
|
|
65
67
|
# LICENSE
|
|
66
68
|
[LICENSE](LICENSE)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
3
|
+
version_info = sys.version_info
|
|
4
|
+
major_versions = [3]
|
|
5
|
+
minor_versions = [8,9,10,11,12,13,14,15]
|
|
6
|
+
if version_info.major not in major_versions and version_info.minor not in minor_versions:
|
|
7
|
+
raise (ImportError(f"ProFAST is not currenly available for your Python version ({version_info[0]}.{version_info[1]}.{version_info[2]}). ProFAST is only compatible with Python 3.8-3.15"))
|
|
8
|
+
|
|
9
|
+
if version_info.minor == 8:
|
|
10
|
+
from .pyc_files.ProFAST_308 import ProFAST as Pro_FAST
|
|
11
|
+
elif version_info.minor == 9:
|
|
12
|
+
from .pyc_files.ProFAST_309 import ProFAST as Pro_FAST
|
|
13
|
+
elif version_info.minor == 10:
|
|
14
|
+
from .pyc_files.ProFAST_310 import ProFAST as Pro_FAST
|
|
15
|
+
elif version_info.minor == 11:
|
|
16
|
+
from .pyc_files.ProFAST_311 import ProFAST as Pro_FAST
|
|
17
|
+
elif version_info.minor == 12:
|
|
18
|
+
from .pyc_files.ProFAST_312 import ProFAST as Pro_FAST
|
|
19
|
+
elif version_info.minor == 13:
|
|
20
|
+
from .pyc_files.ProFAST_313 import ProFAST as Pro_FAST
|
|
21
|
+
elif version_info.minor == 14:
|
|
22
|
+
from .pyc_files.ProFAST_314 import ProFAST as Pro_FAST
|
|
23
|
+
elif version_info.minor == 15:
|
|
24
|
+
from .pyc_files.ProFAST_315 import ProFAST as Pro_FAST
|
|
25
|
+
|
|
26
|
+
from .profast_wrapper import ProFastW as ProFAST
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import ProFAST
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
def setup_pf(h2s_size_days = 10):
|
|
5
|
+
pf = ProFAST.ProFAST("central_grid_electrolysis_PEM")
|
|
6
|
+
h2s_capex = 25.0 #[$/kg-H2]
|
|
7
|
+
hydrogen_storage_capacity_kg = pf.vals['capacity']*h2s_size_days
|
|
8
|
+
hydrogen_storage_capital_cost = hydrogen_storage_capacity_kg*h2s_capex
|
|
9
|
+
|
|
10
|
+
pf.add_capital_item(
|
|
11
|
+
"H2 Storage",
|
|
12
|
+
hydrogen_storage_capital_cost,
|
|
13
|
+
"MACRS",
|
|
14
|
+
7,
|
|
15
|
+
[0.],
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
return pf
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def add_electrolyzer_itc(pf, pem_itc = 0.15):
|
|
22
|
+
|
|
23
|
+
pem_itc = 0.15 # 15% ITC
|
|
24
|
+
pem_capital_cost = pf.capital_items.get('Installed Capital',0).cost
|
|
25
|
+
electrolyzer_itc_usd = pem_capital_cost*pem_itc
|
|
26
|
+
pf.add_capital_incentive(
|
|
27
|
+
'Electrolyzer ITC',
|
|
28
|
+
electrolyzer_itc_usd,
|
|
29
|
+
)
|
|
30
|
+
return pf
|
|
31
|
+
|
|
32
|
+
def add_hydrogen_storage_itc(pf, h2s_itc = 0.30):
|
|
33
|
+
h2s_itc = 0.3
|
|
34
|
+
hydrogen_storage_capital_cost = pf.capital_items.get("H2 Storage",0).cost
|
|
35
|
+
hydrogen_storage_itc_usd = hydrogen_storage_capital_cost*h2s_itc
|
|
36
|
+
|
|
37
|
+
pf.add_capital_incentive(
|
|
38
|
+
'H2 Storage ITC',
|
|
39
|
+
hydrogen_storage_itc_usd,
|
|
40
|
+
)
|
|
41
|
+
return pf
|
|
42
|
+
|
|
43
|
+
if __name__ == "__main__":
|
|
44
|
+
# --- NO ITC ---
|
|
45
|
+
pf = setup_pf()
|
|
46
|
+
sol = pf.solve_price()
|
|
47
|
+
print(f"LCOH with no ITC: ${sol['price']:.2f}/kg")
|
|
48
|
+
|
|
49
|
+
# --- ELECTROLYZER ITC ONLY ---
|
|
50
|
+
pf = setup_pf()
|
|
51
|
+
pf = add_electrolyzer_itc(pf)
|
|
52
|
+
sol = pf.solve_price()
|
|
53
|
+
print(f"LCOH with Electrolyzer ITC: ${sol['price']:.2f}/kg")
|
|
54
|
+
|
|
55
|
+
# --- HYDROGEN STORAGE ITC ONLY ---
|
|
56
|
+
pf = setup_pf()
|
|
57
|
+
pf = add_hydrogen_storage_itc(pf)
|
|
58
|
+
sol = pf.solve_price()
|
|
59
|
+
print(f"LCOH with Hydrogen Storage ITC: ${sol['price']:.2f}/kg")
|
|
60
|
+
|
|
61
|
+
# --- BOTH ITC ---
|
|
62
|
+
pf = setup_pf()
|
|
63
|
+
pf = add_hydrogen_storage_itc(pf)
|
|
64
|
+
pf = add_electrolyzer_itc(pf)
|
|
65
|
+
sol = pf.solve_price()
|
|
66
|
+
print(f"LCOH with Electrolyzer and Hydrogen Storage ITC: ${sol['price']:.2f}/kg")
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
from importlib_resources import files
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
import numpy as np
|
|
5
|
+
from ProFAST import Pro_FAST
|
|
6
|
+
from ProFAST.tools.utilities import write_yaml, load_yaml, rename_dict_keys
|
|
7
|
+
from ProFAST.tools import convert_pf_to_dict, populate_profast, make_price_breakdown, run_profast
|
|
8
|
+
import matplotlib.pyplot as plt
|
|
9
|
+
import matplotlib as mpl
|
|
10
|
+
|
|
11
|
+
class ProFastW(Pro_FAST):
|
|
12
|
+
|
|
13
|
+
def __init__(self,case=None):
|
|
14
|
+
if case is not None:
|
|
15
|
+
if ".yaml" in case:
|
|
16
|
+
super().__init__(None)
|
|
17
|
+
self.load_yaml(case)
|
|
18
|
+
else:
|
|
19
|
+
super().__init__(case)
|
|
20
|
+
else:
|
|
21
|
+
super().__init__(case)
|
|
22
|
+
self.one_time_capital_incentives = {}
|
|
23
|
+
self.years_of_operation = []
|
|
24
|
+
|
|
25
|
+
def make_price_breakdown(self):
|
|
26
|
+
pf_config = self.export()
|
|
27
|
+
sol, summary, cost_breakdown = run_profast(self)
|
|
28
|
+
price_breakdown, lco_check = make_price_breakdown(cost_breakdown, pf_config)
|
|
29
|
+
assert sol['price']==lco_check
|
|
30
|
+
|
|
31
|
+
return price_breakdown
|
|
32
|
+
|
|
33
|
+
def add_capital_incentive(self, name:str, value: float, **kwargs):
|
|
34
|
+
valid_kwarg_keys = ["depr_type", "depr_period", "depreciable"]
|
|
35
|
+
entry = {"value":value}
|
|
36
|
+
|
|
37
|
+
if name in self.one_time_capital_incentives:
|
|
38
|
+
raise ValueError(
|
|
39
|
+
f"{name} capital incentive already exists. "
|
|
40
|
+
"Please specify a different name or edit the incentive using pf.edit_capital_incentive()"
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
def type_check(name,value,types):
|
|
44
|
+
if not isinstance(value,types):
|
|
45
|
+
raise ValueError(f"Parameter: '{name}' cannot be of type {type(value)}. Type must be one of {types}")
|
|
46
|
+
def check_in_list(name,value,list_vals):
|
|
47
|
+
if value not in list_vals:
|
|
48
|
+
raise ValueError(f"Parameter: '{name}' needs to be one of the following: {list_vals}")
|
|
49
|
+
|
|
50
|
+
type_check('value',value,(int,np.floating,float))
|
|
51
|
+
if bool(kwargs):
|
|
52
|
+
invalid_keys = [k for k in kwargs.keys() if k not in valid_kwarg_keys]
|
|
53
|
+
if len(invalid_keys)>0:
|
|
54
|
+
msg = (
|
|
55
|
+
f"Invalid inputs {invalid_keys} provided. Valid inputs are {valid_kwarg_keys}."
|
|
56
|
+
)
|
|
57
|
+
raise ValueError(msg)
|
|
58
|
+
|
|
59
|
+
if self.vals["one time cap inct"]["value"]>0:
|
|
60
|
+
specified_keys = [k for k in valid_kwarg_keys if k in kwargs]
|
|
61
|
+
mismatch_keys = [k for k in specified_keys if kwargs[k]!=self.vals["one time cap inct"][k]]
|
|
62
|
+
if len(mismatch_keys)>0:
|
|
63
|
+
msg = (
|
|
64
|
+
f"{mismatch_keys} were given different values across the capital incentives. "
|
|
65
|
+
f"Please ensure that {valid_kwarg_keys} parameters are the same for all capital incentives."
|
|
66
|
+
f"Update capital incentive parameters using pf.vals['one time cap inct'][param]=val"
|
|
67
|
+
)
|
|
68
|
+
raise ValueError(msg)
|
|
69
|
+
|
|
70
|
+
depr_type = self.vals['one time cap inct'].get('depr type',"MACRS")
|
|
71
|
+
|
|
72
|
+
if 'depr_type' in kwargs:
|
|
73
|
+
type_check('depr_type',kwargs['depr_type'], str)
|
|
74
|
+
check_in_list('depr_type',kwargs['depr type'], ["MACRS", "Straight line"])
|
|
75
|
+
|
|
76
|
+
self.vals['one time cap inct'].update({'depr type':kwargs['depr_type']})
|
|
77
|
+
|
|
78
|
+
depr_type = kwargs.get('depr type','MACRS')
|
|
79
|
+
|
|
80
|
+
if 'depr_period' in kwargs:
|
|
81
|
+
type_check('depr_period',kwargs['depr_period'], int)
|
|
82
|
+
if depr_type=='MACRS':
|
|
83
|
+
check_in_list('depr_period',kwargs['depr_period'], [3, 5, 7, 10, 15, 20])
|
|
84
|
+
self.vals['one time cap inct'].update({'depr period':kwargs['depr_period']})
|
|
85
|
+
|
|
86
|
+
if 'depreciable' in kwargs:
|
|
87
|
+
type_check('depreciable',kwargs['depreciable'],bool)
|
|
88
|
+
self.vals['one time cap inct'].update({'depreciable':kwargs['depreciable']})
|
|
89
|
+
|
|
90
|
+
entry.update(kwargs)
|
|
91
|
+
|
|
92
|
+
self.one_time_capital_incentives[name] = entry
|
|
93
|
+
itc_tot = self.vals['one time cap inct']['value'] + value
|
|
94
|
+
self.vals['one time cap inct'].update({'value':itc_tot})
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def edit_capital_incentive(self,name: str, value: dict):
|
|
98
|
+
for key, val in value.items():
|
|
99
|
+
if key not in ["value","depr_type", "depr_period", "depr type", "depr period", "depreciable"]: # Check if it is a valid value
|
|
100
|
+
raise Exception(f"{key} is not a valid value to edit!")
|
|
101
|
+
if name not in self.one_time_capital_incentives: # Check if the incentive name exists
|
|
102
|
+
raise Exception(f"{name} does not exist!")
|
|
103
|
+
|
|
104
|
+
self.one_time_capital_incentives[name].update({key.replace("_"," "):val})
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
itc_vals = [v['value'] for k,v in self.one_time_capital_incentives.items()]
|
|
108
|
+
self.vals['one time cap inct'].update({'value':sum(itc_vals)})
|
|
109
|
+
|
|
110
|
+
def remove_capital_incentive(self, name):
|
|
111
|
+
removed_incentive = self.one_time_capital_incentives.pop(name)
|
|
112
|
+
|
|
113
|
+
itc_vals = [v['value'] for k,v in self.one_time_capital_incentives.items()]
|
|
114
|
+
self.vals['one time cap inct'].update({'value':sum(itc_vals)})
|
|
115
|
+
|
|
116
|
+
def load_json(self,case=""):
|
|
117
|
+
if ".json" in case:
|
|
118
|
+
case = case.replace(".json","")
|
|
119
|
+
self.clear_values("all")
|
|
120
|
+
if os.path.isfile(case):
|
|
121
|
+
f = open(case)
|
|
122
|
+
elif os.path.isfile(files("ProFAST.resources").joinpath(f"{case}.json")):
|
|
123
|
+
f = open(files("ProFAST.resources").joinpath(f"{case}.json"))
|
|
124
|
+
else:
|
|
125
|
+
raise ValueError(f'File location "{case}.json" not found')
|
|
126
|
+
# f = open(f'{self.__location__}/../resources/{case}.json')
|
|
127
|
+
data = json.load(f)
|
|
128
|
+
json_key_mapper = {
|
|
129
|
+
"variables":"params",
|
|
130
|
+
"capital item": "capital_items",
|
|
131
|
+
"fixed cost": "fixed_costs",
|
|
132
|
+
"feedstock": "feedstocks",
|
|
133
|
+
"coproduct": "coproducts",
|
|
134
|
+
"incentive":"incentives"
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
pf_config = {}
|
|
138
|
+
for entry_type, entry_items in data.items():
|
|
139
|
+
if isinstance(entry_items,list):
|
|
140
|
+
entries = {}
|
|
141
|
+
for eitem in entry_items:
|
|
142
|
+
name = eitem.pop("name")
|
|
143
|
+
eitem = rename_dict_keys(eitem,"depr period","depr_period")
|
|
144
|
+
eitem = rename_dict_keys(eitem,"depr type","depr_type")
|
|
145
|
+
entries[name] = eitem
|
|
146
|
+
pf_config[json_key_mapper[entry_type]] = entries
|
|
147
|
+
elif isinstance(entry_items,dict):
|
|
148
|
+
pf_config[json_key_mapper[entry_type]] = entry_items
|
|
149
|
+
|
|
150
|
+
populate_profast(pf_config,self)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def load_yaml(self, filepath):
|
|
154
|
+
input_params = load_yaml(filepath)
|
|
155
|
+
populate_profast(input_params,self)
|
|
156
|
+
|
|
157
|
+
def export(self):
|
|
158
|
+
pf_dict = convert_pf_to_dict(self)
|
|
159
|
+
return pf_dict
|
|
160
|
+
|
|
161
|
+
def to_yaml(self,filepath):
|
|
162
|
+
pf_dict = convert_pf_to_dict(self)
|
|
163
|
+
write_yaml(filepath,pf_dict)
|
|
164
|
+
|
|
165
|
+
def calculate_years_of_operation(self):
|
|
166
|
+
operation_start_year = self.vals['analysis start year'] + (self.vals['installation months'] / 12)
|
|
167
|
+
if self.vals['operating life']>1:
|
|
168
|
+
self.years_of_operation = np.arange(
|
|
169
|
+
int(operation_start_year), int(operation_start_year + self.vals['operating life']), 1
|
|
170
|
+
).tolist()
|
|
171
|
+
else:
|
|
172
|
+
self.years_of_operation=[int(operation_start_year)]
|
|
173
|
+
|
|
174
|
+
def plot_price_breakdown(self,fileout="", show_plot=True):
|
|
175
|
+
price_breakdown = self.make_price_breakdown()
|
|
176
|
+
lco_str = "LCO{}".format(self.vals["commodity"]["name"][0])
|
|
177
|
+
lco_units = "$/{}".format(self.vals["commodity"]["unit"])
|
|
178
|
+
lco_total = price_breakdown.pop(f"{lco_str}: Total ({lco_units})")
|
|
179
|
+
|
|
180
|
+
if len(price_breakdown)<=10:
|
|
181
|
+
colors = mpl.colormaps['tab10'].colors
|
|
182
|
+
elif len(price_breakdown)>10 and len(price_breakdown)<=20:
|
|
183
|
+
colors = mpl.colormaps['tab20'].colors
|
|
184
|
+
elif len(price_breakdown)>20:
|
|
185
|
+
colors = mpl.colormaps['turbo'](np.linspace(0,1,len(price_breakdown)))
|
|
186
|
+
|
|
187
|
+
price_items = [k for k,v in price_breakdown.items() if v>0]
|
|
188
|
+
longest_string = max([len(k) for k in price_items])
|
|
189
|
+
min_val = min([price_breakdown[k] for k in price_items])
|
|
190
|
+
fs = 10
|
|
191
|
+
min_text_width = longest_string*fs/72
|
|
192
|
+
min_text_height = min([10,int(np.ceil((lco_total/min_val)*fs/72))])
|
|
193
|
+
|
|
194
|
+
fig, ax = plt.subplots(figsize=(int(np.ceil(min_text_width)), min_text_height))
|
|
195
|
+
if not hasattr(ax, 'side_label_count'):
|
|
196
|
+
ax.side_label_count = 0
|
|
197
|
+
start_val = 0
|
|
198
|
+
bw = 5.0
|
|
199
|
+
x_val = 5.0
|
|
200
|
+
for item,bar_color in zip(price_items,colors):
|
|
201
|
+
item_label = item.replace(lco_str,"").replace(lco_units,"").strip("(): ")
|
|
202
|
+
# label_with_val = f"{lco_str} {item_label}: {price_breakdown[item]:.3f} ({lco_units})"
|
|
203
|
+
label_with_val = f"{item_label}: {price_breakdown[item]:.3f} ({lco_units})"
|
|
204
|
+
p1 = ax.bar(
|
|
205
|
+
x_val,
|
|
206
|
+
price_breakdown[item],
|
|
207
|
+
width=bw,
|
|
208
|
+
label=item_label,
|
|
209
|
+
bottom=start_val,
|
|
210
|
+
alpha=0.5,
|
|
211
|
+
color=bar_color,
|
|
212
|
+
)
|
|
213
|
+
if (price_breakdown[item]*10/lco_total)<0.25:
|
|
214
|
+
|
|
215
|
+
bar_mid = start_val + price_breakdown[item]/2
|
|
216
|
+
|
|
217
|
+
ax.annotate(
|
|
218
|
+
label_with_val,
|
|
219
|
+
xy=(7.5,bar_mid),
|
|
220
|
+
xytext=(7.5,bar_mid+0.1*ax.side_label_count),
|
|
221
|
+
xycoords='data',
|
|
222
|
+
arrowprops=dict(arrowstyle="->", lw=1, alpha=0.3),
|
|
223
|
+
va='center',
|
|
224
|
+
ha='left',
|
|
225
|
+
color=bar_color
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
ax.side_label_count += 1
|
|
229
|
+
else:
|
|
230
|
+
ax.bar_label(
|
|
231
|
+
p1,
|
|
232
|
+
labels=[label_with_val],
|
|
233
|
+
label_type="center",
|
|
234
|
+
fontsize = fs,
|
|
235
|
+
)
|
|
236
|
+
ax.side_label_count = 0
|
|
237
|
+
|
|
238
|
+
start_val += price_breakdown[item]
|
|
239
|
+
ax.set_ylabel(f"Levelized cost of {self.vals['commodity']['name']} ({lco_str} in {lco_units})",fontsize=fs)
|
|
240
|
+
ax.set_xticks(ticks=[x_val], labels=[''])
|
|
241
|
+
txt = ax.annotate(
|
|
242
|
+
f"{lco_str} {lco_total:.3f} {lco_units}",
|
|
243
|
+
xy=(x_val, lco_total),
|
|
244
|
+
xycoords='data',
|
|
245
|
+
horizontalalignment="center",
|
|
246
|
+
verticalalignment="bottom",
|
|
247
|
+
fontweight="bold",
|
|
248
|
+
fontsize = fs,
|
|
249
|
+
)
|
|
250
|
+
ax.spines[['right', 'top']].set_visible(False)
|
|
251
|
+
if fileout != "":
|
|
252
|
+
fig.savefig(fileout,bbox_inches='tight')
|
|
253
|
+
if show_plot:
|
|
254
|
+
plt.show()
|
|
255
|
+
else:
|
|
256
|
+
plt.close()
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
[]
|
|
260
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|