Skip to content

Removed hard-coded logic for electrolyzer replacement schedule#555

Merged
johnjasa merged 12 commits intoNatLabRockies:developfrom
elenya-grant:all_tech_refurb
Mar 3, 2026
Merged

Removed hard-coded logic for electrolyzer replacement schedule#555
johnjasa merged 12 commits intoNatLabRockies:developfrom
elenya-grant:all_tech_refurb

Conversation

@elenya-grant
Copy link
Collaborator

@elenya-grant elenya-grant commented Feb 26, 2026

Removed hard-coded logic for electrolyzer replacement schedule

Removed the hard-coded logic within the finance models and H2IntegrateModel that was specific to connecting the replacement schedule from the technology to a finance model if a technology name included "electrolyzer". Now - the replacement schedule is passed to the finance models for all technologies.

Note: This is ready for an in-depth review, but I have noted some specific questions for reviewers in Section 2 under "Type of Reviewer Feedback Requested"

Since technology-specific finance models do not expect the electrolyzer replacement schedule to be connected, there is some added logic to handle tech-specific finance models (before, the logic was not explicit and relied on whether the commodity_stream for a finance subgroup was None. This logic has been replaced with more explicit logic. Additionally, since this logic is handled/defined at the subgroup-level, it is not possible to have a finance subgroup that includes finance_groups that have a mix of technology-specific and finance specific models (this has always been the case). Further information on this is described in Section 5. But - I added in an error message to catch this case if it were to pop up.

This also required updating the feedstock cost model to output a replacement schedule. An alternative to adding this output to the feedstock cost model would be to add in logic to connect_technologies that checks if 'feedstock' is in the technology name (this alternative approach was the route taken for transport technologies).

I also added a documentation page about the technology naming convention in H2I to communicate what naming convention is requires so that the logic within H2I functions as expected.

Section 1: Type of Contribution

  • Feature Enhancement
    • Framework
    • New Model
    • Updated Model
    • Tools/Utilities
    • Other (please describe):
  • Bug Fix
  • Documentation Update
  • CI Changes
  • Other (please describe):

Section 2: Draft PR Checklist

  • Open draft PR
  • Describe the feature that will be added
  • Fill out TODO list steps
  • Describe requested feedback from reviewers on draft PR
  • [-] Complete Section 7: New Model Checklist (if applicable)

TODO

  • Add test that error is thrown if combining technology-specific finance model and system-level finance model in a finance subgroup.

Type of Reviewer Feedback Requested (on Draft PR)

Structural feedback:

Implementation feedback:

  • Should the feedstock cost model have an output of replacement_schedule or should we introduce logic into connect_technologies so that technologies with feedstock in the name do not have the replacement schedule passed to the finance model? This logic would maybe have to be duplicated in the finance models if so. I like the current implementation since it reduces the amount of naming-specific logic in the code base.
  • Similar question to above, but relating to the transport models. The logic for the transport model is to not connect the replacement schedule to the finance model if "transport" is in the tech name. Since theres only two transport models that can be defined in the tech config, this felt like the best way to do it (rather than add replacement_schedule as an output to both transport models).

Other feedback:

  • Should the naming convention for the electricity producing techs and the naming convention for default commodities streams (defined in the default_techs_to_commodities dictionary in H2IntegrateModel.create_finance_model()) be described in the docs/user_guide/expected_naming_convention.md doc page?

Section 3: General PR Checklist

  • PR description thoroughly describes the new feature, bug fix, etc.
  • Added tests for new functionality or bug fixes
  • Tests pass (If not, and this is expected, please elaborate in the Section 6: Test Results)
  • Documentation
    • Docstrings are up-to-date
    • Related docs/ files are up-to-date, or added when necessary
    • Documentation has been rebuilt successfully
    • [-] Examples have been updated (if applicable)
  • CHANGELOG.md has been updated to describe the changes made in this PR

Section 3: Related Issues

This is somewhat related to Issue #485

Section 4: Impacted Areas of the Software

Section 4.1: New Files

  • docs/user_guide/expected_naming_convention.md: new doc page that explains what naming convention is needed for technologies in H2I so that it functions properly

Section 4.2: Modified Files

  • h2integrate/finances/profast_base.py - ProFastBase: removed logic around electrolyzer replacement schedule, added input for all replacement schedule for all technologies, and updated replacement schedule calculation to use inputs['replacement_schedule_{tech}'] instead of time between replacement.
  • examples/08_wind_electrolyzer/user_finance_model/simple_lco.py: added input of technology replacement schedules
  • h2integrate/finances/numpy_financial_npv.py - NumpyFinancialNPV: removed logic around electrolyzer replacement schedule, added input for all replacement schedule for all technologies, and updated replacement schedule calculation to use inputs['replacement_schedule_{tech}'] instead of time between replacement.
  • h2integrate/core/feedstocks.py: added replacement_schedule output to FeedstockCostModel
  • h2integrate/core/h2integrate_model.py:
    • create_finance_model():
      • added system_finance_model key to the finance_subgroups dictionary. This is a boolean that is True if the finance model is system-level and False if the finance model is tech-specific.
      • added a counter variable n_tech_finances_in_group that is equal to the number of technology-specific finance models within a finance subgroup. This is used so that later on, we can throw an error message if someone has a mix of technology-specific finance models and system-level finance models within one finance subgroup.
    • connect_technologies()
      • Removed elif statement for elif "storage" in source_tech and elif "storage" in dest_tech because it was the same logic that is done in the else statement and was therefore unnecessary.
      • Connecting techs to finance models: Replaced logic of if commodity_stream is not None to if is_system_finance_model which is pulled from the finance_subgroups attribute that is created in create_finance_model()
      • Connecting techs to finance models: Added logic when looping through technologies to connect technology replacement schedule to the finance model if is_system_finance_model is True and tech_name does not include "transport".
      • Connecting techs to finance models: Added a check if the technology is 'cable' or 'pipe' since those are protected transport item names. This change was not necessary for this PR, but if someone had put 'cable' or 'pipe' in the technologies for a finance subgroup, there would've been an error (but now there won't be an error! yay!)
  • h2integrate/core/test/test_framework.py: added new test, test_invalid_finance_group_combination, for error message added

Section 5: Additional Supporting Information

it is not possible to have a finance subgroup that includes finance_groups that have a mix of technology-specific and finance specific models.

Suppose we have a technology-specific finance model for the steel technology and a system-level finance model named profast_model (as is the case in Example 1). If a user tried to run both of these finance models as shown below:

finance_subgroups:
  steel:
    commodity: steel
    finance_groups: ['steel', 'profast_model']
    technologies: [steel]

there would be an error (this PR now includes a more verbose error than the error that would've occurred when trying to run H2I).

The user should instead define two finance subgroups, one per finance model.

finance_subgroups:
  steel:
    commodity: steel
    finance_groups: ['steel']
    technologies: [steel]
  steel_profast:
    commodity: steel
    finance_groups: ['profast_model']
    technologies: [steel]

This error does not come up if finance models defined in the finance_groups for a specific finance subgroup are either all tech-specific finance models OR all system-level finance models (see example 8).

Section 6: Test Results, if applicable

@elenya-grant elenya-grant added framework finance Items specifically related to financial models ready for review This PR is ready for input from folks labels Feb 26, 2026
Copy link
Collaborator

@jaredthomas68 jaredthomas68 left a comment

Choose a reason for hiding this comment

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

This looks pretty good to me. Thanks for continuing to generalize and reduce tech-specific logic. My main thoughts are as follows:

  1. Let's allow for costs for transport techs (needed in current project)
  2. I don't love having costs or replacement schedule in feedstocks, but if the user does not need to do anything with them then I think it is ok if keeps things more general.

Copy link
Collaborator

@jaredthomas68 jaredthomas68 left a comment

Choose a reason for hiding this comment

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

Looks good to me now

Copy link
Collaborator

@johnjasa johnjasa left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! It's really nice to see things come together in a standardized way. I pushed up some changes, have some non-blocking questions, and have bigger picture questions for you:

Given where we're at with the finance models, would it make sense to adapt the steel and ammonia examples to not use tech-specific finance models? We initially coded it this way to match the prior GreenHEART implementation, but I don't think it's strictly necessary. If we do that, are tech specific finance models still useful? I'm wondering if we can simplify the codebase and the internal logic by removing that capability, but I wouldn't want to remove it if you see it as a worthwhile capability. I imagine it is worthwhile, but more want to get your take on it given how much you've been working in and around the finance models.

from h2integrate.core.h2integrate_model import H2IntegrateModel


os.chdir(Path(__file__).parent)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mostly for my curiosity, why is this part needed? Are you running this script outside of the directory? Is the limitation that we need to be in a certain directory to run parts of H2I well-documented in an issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not necessary but most of the examples only work if we change the cwd to the example folder. Aka - most examples are set-up to be run like:

cd examples/01_onshore_steel_mn
python run_onshore_steel_mn.py

That's why all the tests in test_all_examples change the cwd to the folder of the example its testing

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it. I guess more of my question is should we change the behavior of the examples so that this is not necessary? And to make an issue to track that if it is the case. I couldn't find one right off. If you don't think it's helpful to change this behavior, please say so!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can revert this change - I just made it because I was using that example to debug and was sick of restoring the changes I make to the file

Copy link
Collaborator

Choose a reason for hiding this comment

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

I vote revert and make an issue about not being able to run examples unless in the cwd!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks team, no need to revert, I've made an issue here: #563

Comment on lines +856 to +861
# tech specific finance models are created in create_technologies()
# and do not need to be included in the general finance models.
# set commodity_stream to None so that inputs needed for system-level
# finance models are not connected to tech-specific finance models.
finance_subgroups[subgroup_name].update({"commodity_stream": None})
# finance_subgroups[subgroup_name].update({"commodity_stream": None})
finance_subgroups[subgroup_name].update({"system_finance_model": False})
Copy link
Collaborator

Choose a reason for hiding this comment

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

A point I'm noting here and it's relevant in a few places in the code: in some locations you say "system finance model" and in others "general finance model". Are these the same thing? I believe so. I'd suggest being consistent on the naming, and maybe even suggest using is_system_finance_model as the key (add is_) to make it clear it's a boolean, not an object or something else

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes - system finance model and general finance model are the same. I can update the variables and comments to all use system finance model (unless you prefer general over system) and I'll update that new key to be "is_system_finance_model" instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like system finance model, thanks for the bool change too!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is done!

@johnjasa johnjasa merged commit 4b2ceaf into NatLabRockies:develop Mar 3, 2026
5 checks passed
RHammond2 added a commit that referenced this pull request Mar 3, 2026
* Ammonia Synloop: Units fix and small changes (#518)

* updated electricity units in synloop

* added feedstock consumption profiles and updated cost model to use capacity input

* added tests/subtests for ammonia synloop

* udpated electricity units to kW

* fixed nitrogen purge gas calc (#520)

* Minor fix in post-processing to save capacity factors (#519)

* minor update to sql_to_csv to save capacity factors

* simplified logic handling capacity factor in postprocessing

* Apply suggestion from @johnjasa

---------

Co-authored-by: John Jasa <john.jasa@nrel.gov>

* Enable load following optimization dispatch with Pyomo (#407)

* include code from usage: pyomo [-h] [--version]
             {build-extensions,convert,download-extensions,help,install-extras,model-viewer,run,solve,test-solvers}
             ...

This is the main driver for the Pyomo optimization software.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

subcommands:
  {build-extensions,convert,download-extensions,help,install-extras,model-viewer,run,solve,test-solvers}
    build-extensions    Build compiled extension modules
    convert             Convert a Pyomo model to another format
    download-extensions
                        Download compiled extension modules
    help                Print help information.
    install-extras      Install "extra" packages that Pyomo can leverage.
    model-viewer        Run the Pyomo model viewer
    run                 Execute a command from the Pyomo bin (or Scripts)
                        directory.
    solve               Optimize a model
    test-solvers        Test Pyomo solvers

-------------------------------------------------------------------------
Pyomo supports a variety of modeling and optimization capabilities,
which are executed either as subcommands of 'pyomo' or as separate
commands.  Use the 'help' subcommand to get information about the
capabilities installed with Pyomo.  Additionally, each subcommand
supports independent command-line options.  Use the -h option to
print details for a subcommand.  For example, type

   pyomo solve -h

to print information about the `solve` subcommand. branch that needs to be saved for later

* include storage rule file

* Halfway there for pyomo opt

* Add first objective function

* Updated dispatch optimization framework - add hybrid dispatch rule

* Adding hybrid linking constraints and connecting variables in pyomo min operating costs framework

* Final structural changes

* Fix import statement

* Fix imports and setter method

* First draft of running code

* Update example

* test

* fix precommits

* Fixing merge errors

* Minor spelling changes

* Update example

* Update controller problem state method from Elenya

* Update example and changelog

* Clean up pyomo storage baseclass file

* Cleanups to feature/pyomo opt (#2)

* refactored DispatchProblemState

* updated tech config and removed pysam options file

* minor cleanups to DispatchProblemState

* minor updates to generic_converter_opt

* initial cleanups to hybrid_rule.py

* minor cleanups to pyomo_storage_rule_min_operating_cost

* extra small cleanups to generic_converter_opt

* added storage capacities as inputs to optimized controller

* updated use of n_control_window and n_horizon_window

* Enable heuristic dispatch to run with new pyomo changes

* Clean up added files and example

* Adding first tests - do not pass yet

* Update docs and rename example

* Align naming with develop branch

* Update Ex 02 and update pyomo_controllers with naming in develop

* updated other example tech configs

* ran precommit on some files

* precommit on pyomo_controllers.py

* Update test formatting

* Update pyomo storage rule for test

* Fix SOC linking bug

* Testing update - partial

* Make new test for optimized pyomo dispatch

* Update optimal controller test

* Update test with new site definition

* Update example for merging in develop

* Minor updates to optimized dispatch

* PR updates from comments

* Add last file after merge issue

* Update example

* Made plots slightly larger

* Update h2integrate/control/control_strategies/controller_opt_problem_state.py

Apply comment suggestions

Co-authored-by: John Jasa <john.jasa@nrel.gov>

* Update h2integrate/control/control_strategies/controller_opt_problem_state.py

Apply comment suggestions

Co-authored-by: John Jasa <john.jasa@nrel.gov>

* Update h2integrate/control/control_rules/hybrid_rule.py

Apply comment suggestions

Co-authored-by: John Jasa <john.jasa@nrel.gov>

* Cleaning up pyomo_controllers

* Updated docstrings and battery mentions

* Initial init docs string and example update

* Update note about incentivizing charging in objective function

* Update generation and load variable definitions

* Update docs/control/pyomo_controllers.md

Co-authored-by: kbrunik <102193481+kbrunik@users.noreply.github.com>

* Update doc strings for updated_initial_soc parameter

* Make time_weighting_factor and round_digits not hardcoded

* remove round_digits from pyomo_rule_baseclass

* Updating controller names

* Fixed name check for controllers

* Updated optimal controller test

* remove unused properties

* Update example to run with new class definitions

* Fix converter name in test

* Fix ruff formatting

* Update doc strings for pyomo model classes

* Rename files to be more consistent and descriptive

* Update comments in the init portions of dispatch for parameters

* Remove comment

* Add doc strings to optimized dispatch config

* Give more details about DispatchProblemState class

* Remove todo comments

* Update docs with more in-depth dispatch description

* Minor typo

* Minor pyomo docs updates

* Minor pyomo docs updates

* Updated pyomo dispatch figure

* Minor comments based on PR review

* PR feedback

---------

Co-authored-by: Jared Thomas <jaredthomas68@gmail.com>
Co-authored-by: bayc <christopher.j.bay@gmail.com>
Co-authored-by: kbrunik <102193481+kbrunik@users.noreply.github.com>
Co-authored-by: kbrunik <kbrunik@gmail.com>
Co-authored-by: John Jasa <johnjasa11@gmail.com>
Co-authored-by: elenya-grant <116225007+elenya-grant@users.noreply.github.com>
Co-authored-by: John Jasa <john.jasa@nrel.gov>

* Remove `ElectricitySumComp` (follow-on to 463) (#524)

* removed usage of ElectricitySumComp

* removed ElectricitySumComp

* updated test value in test_save_csv_all_results

* Linearized H2 Fuel Cell Model (#525)

* linearized fuel cell

* added fuel cell to supported models

* fix units and output all necessary outputs

* docs on docs

* Review feedback changes

* add h2 fuel cell to elec tech

* Update docs/technology_models/h2_fuel_cell.md

Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>

* Update h2integrate/converters/hydrogen/h2_fuel_cell.py

Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>

* Update docs/technology_models/h2_fuel_cell.md

Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>

* rename model to note linear performance

* docs

---------

Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>

* Standardized Performance Outputs: Generic Storage & Control (#493)

* added draft of performance model baseclass to set outputs

* updated wind models for standardized outputs

* minor cleanup to wind pysam

* minor cleanup to floris outputs

* updated outputs of hydroplant

* updated solar pv models for standardized outputs

* updated solar resource integration tests with updated solar model outputs

* added fraction_of_year_simulated attribute to performance baseclass

* updated tests for turbine preprocessing tools

* fixed variable naming in test_all_examples for wind and solar

* started updating electrolyzer model outputs

* minor bugfix to test_sql_timeseries_to_csv for example 2

* fixed save_case_timeseries_as_csv

* update to sql_to_csv function just in case

* added attribute check in PerformanceModelBaseClass

* typo bugfix in refurb period calc in electrolyzer model

* added test for solar performance baseclass

* added solar test to check that all outputs are set in parent class

* commented out unused variables in new solar test

* generalized solar unit test so it can be easily used for other components

* updated natural gas plant

* started updating co2 models

* updated grid model

* updated asu model

* updated grid tests

* updated desal model

* updated co2 models and tests

* updated newest steel models

* started updating methanol models but not tested

* made it so ResizablePerformanceModelBaseClass inherits PerformanceModelBaseClass

* updated electrolyzer model and ammonia synloop model

* updated simple ammonia model

* updated hopp wrapper

* updated steel.py

* updated iron mine and dri models

* updated geoh2 models

* updated battery

* added todo comments to storage models

* added unit tests to check that outputs are populated

* working on updating combiners and h2imodel

* updated electrolyzer so test values dont change and other bugfixes so examples run

* updated how_to_set_up_an_analysis.md

* removed init file from new hydro power test folder

* updated remaining failing tests

* updated example 28 and iron_wrapper

* updated capacity factor strings in run_size_modes files

* removed commented out outputs

* updated changelog

* removed duplicate inheritance of PerformanceModelBaseClass in electrolyzer performance baseclass

* updated pysam battery outputs

* updated annual outputs to properly account for fraction of year simulated

* moved commodity defn to initialize

* updates based on reviewer feedback

* updated generic storage models and simple controllers

* bugfix in simple_storage_autosizing

* updated test for post-processing timeseries

* added subtest for ex 12

* updated ex 12 test values

* removed commented out code

* updated changelog

* added some comments to generic storage performance models

* added more inline and docstring comments

* Minor refactoring changes for clarity

* updated docstring in generic storage

* updated variable name in simple storage autosizing

* added charge rate and capacity inputs to simple generic storage

* removed capacity as input to simple_generic_storage

* update config names for commodity_name, commodity_units and commodity_storage_units

* updated ex 9

* minor updates based on feedback

* updated changelog

* updated inline comment in simple_generic_storage

---------

Co-authored-by: John Jasa <johnjasa11@gmail.com>

* Rename examples to avoid clash (#528)

* moved example and added test

* Simplified test

* Standard Combiner Outputs (follow-on to 463) (#501)

* updated combiner to have standard outputs

* updated h2imodel for connecting techs to the combiner

* added inline comments to generic combiner

* added integration test for generic combiner

* updated commodity_units to commodity_rate_units

* fixed issue from merge causing errors

* updated commodity_units to commodity_rate_units in splitter

* updated combiner inputs in a test

* adding docstring and docs about combiner

---------

Co-authored-by: John Jasa <johnjasa11@gmail.com>

* Update mcm dependency (#530)

* made saving figures and outputs a config option for co2 models

* updated oae to have save plots be optional

* update mcm dependency to pip

* revert environment.yml change

* fix merge issue

---------

Co-authored-by: elenya-grant <116225007+elenya-grant@users.noreply.github.com>

* Update CO2 model documentation (#533)

* made saving figures and outputs a config option for co2 models

* updated oae to have save plots be optional

* update mcm dependency to pip

* revert environment.yml change

* fix merge issue

* update docs

* update ci

---------

Co-authored-by: elenya-grant <116225007+elenya-grant@users.noreply.github.com>

* Iron: Example with independently sized mine and iron/steel plant (#433)

* added in-progress refactored iron winning models

* updated natural gas dri performance model

* updated docs in ng iron performance model

* updated iron cost model

* updated coefficient paths for rosner iron plant models

* updated example 21 and fixed bugs that were found

* minor updates to dri cost and perf models

* added basic tests for new dri models

* removed notes from rosner dri test

* double checked water costs and unit conversions and cleaned up some small things

* renamed ng iron reduction models and configs

* renamed ng iron dri files

* updated iron example tech config

* added h2 dri cost and performance models

* added h2 dri models to supported models

* update test values for wombat version bump

* update unit test

* update docstrings

* update feedstocks to be per ton pig iron

* refactored DRI performance and cost models to share baseclass

* updated electricity to not double count

* added test for performance with limited feedstock availability

* eaf wip

* steel tests wip

* undo align

* minor update on handling negative exponents in steel eaf cost model

* added carbon and lime to pipe

* update rosner eaf test

* draft update to iron example

* updated iron example to include steel eaf

* updated doc page and changelog

* added small test for example 21

* Fix run_iron.py to actually compare old and new

* Comparing old and new models

* Old and new models matched up

* Cleaning up PR

* Less goofy plant config and other cleanup

* Going back to old coefficients with electricity in processing cost

* Fixed tests, need to document

* updated example 21 so iron_ore_consumed is used for transport cost

* Some iron-related cleanup

* Fixing test

---------

Co-authored-by: elenya-grant <116225007+elenya-grant@users.noreply.github.com>
Co-authored-by: kbrunik <kbrunik@gmail.com>
Co-authored-by: John Jasa <johnjasa11@gmail.com>
Co-authored-by: kbrunik <102193481+kbrunik@users.noreply.github.com>

* Enhancement: Error out on duplicate configuration keys (#534)

* add duplicate key handling

* include all info in final error message and use load_yaml() in include()

* remove printing

* remove duplicate keys from floris v4 default template

* add more implementation details to the docstring

* update changelog

* place duplicate key error next to YAML loading

* add testing for duplicate keys

* provide further insight into design/implementation choices and clarify what is being passed through

* GeoH2: Arps decline curve (#454)

* WIP arps decline curve

* update decline curve

* update geoh2 and docstring

* update test

* update to be percent

* update documentation

* fix changelog

* Update h2integrate/converters/hydrogen/geologic/simple_natural_geoh2.py

Co-authored-by: Jonathan Martin <94018654+jmartin4u@users.noreply.github.com>

* Update h2integrate/converters/hydrogen/geologic/simple_natural_geoh2.py

Co-authored-by: Jonathan Martin <94018654+jmartin4u@users.noreply.github.com>

* precommit fix

* placeholder fix for lifetime simulation

* fix failing test units

* Fixing model name in example script

---------

Co-authored-by: Jonathan Martin <94018654+jmartin4u@users.noreply.github.com>
Co-authored-by: John Jasa <johnjasa11@gmail.com>
Co-authored-by: jmartin4 <jonathan.martin@nrel.gov>

* fix oae numpy (#535)

* fix oae numpy stuff

* actual fix

* Feedstock units update (#541)

* updated MMBtu to MMBtu/h

* updated naming for feedstock config inputs

* Re-organize "default" logic around `commodity_stream` and finance models (#536)

* moved tech-specific hard-coded logic to connect technologies to finance models from connect_technologies() to create_finance_model()

---------

Co-authored-by: kbrunik <102193481+kbrunik@users.noreply.github.com>

* Iron: Adding electrowinning capabilities (#432)

* Reading in Stinn input tables

* Sucessfully testing Stinn model

* Making humbert perf model

* Adding humbert/stinn cost model inputs only

* Progress on humbert cost

* Humbert Stinn complete, not debugged

* Debugging electrowinning

* Debugging ewinning

* Electrowinning cases running, need to add DRI case

* Cleanup of old trailing underscores

* Fix input csv names

* Integrate ewin example with feedstocks

* Moving functions out of h2i module and renumbering example

* Small fixes to PR

* start of unit test

* Testing example

* Expanding unit tests

* fix import

* Docstrings begun

* Docstrings plus a little reorg

* Everything but the docs page

* Finished documentation

* Split off humbert cost_model

* Config docstrings

* Refactoring iron ewinning calcs for clarity

* Addressing reviews

* site -> sites

* Updating test values

* Added autodoc to the electrowinning docs

* updated iron electrowinning tech config

* updated plant config for electrowinning example

* minor udpates to cost model

* minor updates to cost and performance models

* fixed initialization error in cost model

* removed duplicate costs and updated to use PerformanceModelBaseClass

* updated example test values

* Addressing elenya comments

* feedstocks wip

* updating integration

* classic units

* updated tech config to be compatible with develop

* merged changelog

* removed hard-coded cost numbers in compute() to config args with default values

* Minor cleanup

---------

Co-authored-by: Jonathan Martin <94018654+jmartin4nrel@users.noreply.github.com>
Co-authored-by: John Jasa <johnjasa11@gmail.com>
Co-authored-by: kbrunik <kbrunik@gmail.com>
Co-authored-by: kbrunik <102193481+kbrunik@users.noreply.github.com>
Co-authored-by: elenya-grant <116225007+elenya-grant@users.noreply.github.com>

* Consistently call `prob.get_val()` with units instead of `prob["<variable>"]` (#539)

* moved prob calls

* Fixing some tests

* Updated units for NG

* Updated based on PR feedback

* Generic transporter model (#540)

* added generic transporter and added to supported models

* updated generic transporter, added test, and updated iron example

* updated doc pages for generic transporter

* added error message to h2imodel for invalid tech names

* minor typo fix in feedstock documentation

* removed more components from pipe and updated iron examples

* Changed to using set notation for the reserved techs

---------

Co-authored-by: John Jasa <johnjasa11@gmail.com>

* Finance models to represent lifetime performance (#543)

* initial lifetime finance reorg with updated lcoh test values

* updated combiner output naming for capacity factor so combiners can be daisy-chained

* added new error message to check if a default commodity stream was not found

* fixed other failing tests

* updates to co2 models and new tests

* removed hard-codedl logic for handling co2

* minor fix on units input to ProFast

* cleaned up doc

* minor cleanups

* renamed variables in generic combiner

* minor other update to generic combiner

* minor cleanup

---------

Co-authored-by: John Jasa <johnjasa11@gmail.com>

* Maintenance: Test Revamp Phase 1 - Mild Refactor and Test Type Marking (#531)

* enable test coverage and update pytest settings

* add sort of working file cleanup fixture

* convert feedstock to pytest

* spacing

* convert utilities to pytest

* remove last unittest reference

* convert finance test to pytest

* fix import error and convert DOC to pytest

* use correct error for imports not found

* add infrastructure to have separate unit, regression, and integration tests

* refactor shared fixtures to conftest and mark doc with test type

* adopt enforcement of unit, regression, and test marking

* mark already modified files

* fix marker name gathering

* add docstring

* add documentation for test development and running

* convert oae test to pytest

* mark controller tests

* mark ammonia converter tests

* simplify fixtures and convert to pytest

* update docs for openmdao cleanup

* update fixtures and mark hopp tests

* remove generated output plots

* mark geologic h2 and handle temp data better

* update fixture usage and mark tests in h2

* update fixture structure and mark iron converter tests

* mark methanol tests

* mark natural gas tests

* mark nitrogen tests

* reorg solar fixtures and mark test types

* reorg steel converter fixtures and mark test types

* mark water power test types

* reorg wind converter models fixtures and mark test types

* mark  wind converter tools  test types

* remove repetitive .parent

* update temp directory usage and mark test types in frameworks

* refactor temp_dir to conftest

* mark recorder tests and use pytest temp dir factory

* mark supported models tests and use general temp_dir for utilities

* define temp_dir factory in top-level conftest and import everywhere else

* correct temp_dir refactor

* fix broken mcm tests and universalize package management

* mark new tests

* mark finance test types

* mark postprocessing tests and use temp_dir fixture

* mark preprocessing test types and use temp_dir

* refactor himawari tests to reduce repitive setup architecture and mark test type

* refactor himawari and open meteosat models to single parameterized test

* refactor nrel goes resource model to single parameterized test

* combine all resource model tests into single file and convert openmeteo historical to parameterized

* convert pv watts integration tests into single parameterized test

* move common resource fixtures to resource level conftest

* include which for solar vs win

* use site config setup for wind and mark wind resource tests

* refactor open meteo wind test to use generalized fixtures and mark test types

* apply ids and use timezone arg for plant

* mark resource utilities tests

* mark battery storage tests and unify test folders

* mark storage test types, use common fixtures, and parametrize common test routines

* mark tools test types

* mark transporter test types and reduce repetitive tests and fixtures

* mark pip tests

* mark examples test types

* ignore sqllite cache

* bump wombat version and remove remove test coverage options

* fix broken tests from lack of temp_dir updating

* mark newly merged tests

* mark missing integration test

* create fixture for temp_dir setup/teardown for example directories

* account for resource data and fix broken tests

* accept change from kbrunik for model vs technology language

Co-authored-by: kbrunik <102193481+kbrunik@users.noreply.github.com>

* add unit test example to docs and fix subtest comment

* add regression test example and integration test pointer

* add missing setup/teardown for meteosat nrel api

* update commodity units to commodity_rate_units

* mark newly merged test

* add code coverage workflow draft

* consolidate repetitive pytest session functionality

* account for differing resource year and file name resource year

* update resource year in integration test as well

* update naming

* remove redundant resource-year update and fix variable typo

* mark new tests

* Update docs/developer_guide/adding_a_new_technology.md

Co-authored-by: genevievestarke <103534902+genevievestarke@users.noreply.github.com>

* Update docs/developer_guide/adding_a_new_technology.md

Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>

* Update docs/developer_guide/adding_a_new_technology.md

Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>

* Update docs/developer_guide/adding_a_new_technology.md

Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>

* add in docs for temporary data retention

* remove unlink for redundant cleanup

* remove unused parameter

* mark finnicky test with xfail

* move testing docs to a separate page

* add shared fixture commentary

* add codecov token

* make relative reference

* update changelog

* add use a generic fenceposting comment to mark docs literalinclude bounds

---------

Co-authored-by: kbrunik <102193481+kbrunik@users.noreply.github.com>
Co-authored-by: John Jasa <johnjasa11@gmail.com>
Co-authored-by: genevievestarke <103534902+genevievestarke@users.noreply.github.com>
Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>

* Remove some doc warnings (#550)

* Beginning to address doc build warnings

* Removing duplicate kwarg docstrings

* updated ammonia model to need n2 and electricity inputs (#544)

Co-authored-by: John Jasa <johnjasa11@gmail.com>

* yamlfix all yaml files; add yamlfix to the pre-commit hook (#551)

* add yamlfix to the pre-commit

* yamlfix'd all yamls

* Update changelog

* Rolling back other pre-commit changes

* Excluded yamls needed for duplicate keys tests

* Excluded yamls needed for duplicate keys tests

* Switch to keep style for sequences

* Switch to keep style for sequences

* Apply suggestions from code review

Co-authored-by: Rob Hammond <13874373+RHammond2@users.noreply.github.com>

* Applying Rob's suggestions

* leave not on malfunctional config and reapply settings

---------

Co-authored-by: Rob Hammond <13874373+RHammond2@users.noreply.github.com>

* Enhancement: Automatically insert technology names in control strategy definitions (#558)

* add tech name to control parameters in setup

* remove obselete test and associate files

* handle no keys in control parameters and update testing

* Add a simple nuclear plant performance and cost model (#538)

* Added first pass at a simple nuclear model

* Adding nuclear doc page

* Added to changelog

* Doc cleanup

* Fixed OpEx calc for nuclear

* Simplifying nuclear test

* Addressing PR comments

* Marking tests

* Updates based on PR feedback

* Split out Pyomo Controllers to separate files (#549)

* split out pyomo control models

* added pyomo controller baseclass

* removed n_horizon_window from control strategies

* moved round_digits to pyomo base config

* other minor updates

* fixed failing tests

* Update changelog

---------

Co-authored-by: John Jasa <johnjasa11@gmail.com>

* Update Natural GeoH2 with Yearly CF (#552)

* reformat release updates

* bump version

* Added PR links to changelog

* Tech and system model figures (#554)

* tech and system model diagrams

* add comment about modularity and custom models

* Update docs/intro.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @bayc

Co-authored-by: Chris Bay <12664940+bayc@users.noreply.github.com>

* Apply suggestion from @bayc

Co-authored-by: Chris Bay <12664940+bayc@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Chris Bay <12664940+bayc@users.noreply.github.com>

* correct typo and unify figure specs

* typo correction

* update changelog

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Chris Bay <12664940+bayc@users.noreply.github.com>

* Removed hard-coded logic for electrolyzer replacement schedule (#555)

* draft

* updated finances to take in replacement schedules for all techs

* updated feedstock and added logic to prevent connecting replacement schedule for transport components

* added doc page about naming convention

* removed unnecessary elif statement in connect_technologies

* added test for new error message

* updated inline comments for finance models

* Minor refactor and cleanup for replacement cost vars

* updated naming for system finance model

* reverted change to ex 1 run file

---------

Co-authored-by: John Jasa <johnjasa11@gmail.com>

---------

Co-authored-by: elenya-grant <116225007+elenya-grant@users.noreply.github.com>
Co-authored-by: John Jasa <john.jasa@nrel.gov>
Co-authored-by: genevievestarke <103534902+genevievestarke@users.noreply.github.com>
Co-authored-by: Jared Thomas <jaredthomas68@gmail.com>
Co-authored-by: bayc <christopher.j.bay@gmail.com>
Co-authored-by: kbrunik <102193481+kbrunik@users.noreply.github.com>
Co-authored-by: kbrunik <kbrunik@gmail.com>
Co-authored-by: John Jasa <johnjasa11@gmail.com>
Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>
Co-authored-by: Jonathan Martin <94018654+jmartin4u@users.noreply.github.com>
Co-authored-by: jmartin4 <jonathan.martin@nrel.gov>
Co-authored-by: Jonathan Martin <94018654+jmartin4nrel@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Chris Bay <12664940+bayc@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

finance Items specifically related to financial models framework ready for review This PR is ready for input from folks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants