From 8187217638b3d86c2481102086fff3981a5f9882 Mon Sep 17 00:00:00 2001 From: John Jasa Date: Mon, 6 Apr 2026 14:39:43 -0600 Subject: [PATCH 1/4] Removed remaining naming dependencies --- docs/_toc.yml | 1 - docs/user_guide/expected_naming_convention.md | 39 ------------------- h2integrate/core/h2integrate_model.py | 18 ++++++--- 3 files changed, 13 insertions(+), 45 deletions(-) delete mode 100644 docs/user_guide/expected_naming_convention.md diff --git a/docs/_toc.yml b/docs/_toc.yml index d13a58d93..5a1a3dd5e 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -12,7 +12,6 @@ parts: chapters: - file: user_guide/model_overview - file: user_guide/how_to_set_up_an_analysis - - file: user_guide/expected_naming_convention - file: user_guide/connecting_technologies - file: user_guide/defining_sites_and_resources - file: user_guide/design_optimization_in_h2i diff --git a/docs/user_guide/expected_naming_convention.md b/docs/user_guide/expected_naming_convention.md deleted file mode 100644 index 447e57297..000000000 --- a/docs/user_guide/expected_naming_convention.md +++ /dev/null @@ -1,39 +0,0 @@ -# Expected Technology Naming Convention in H2I - -Some logic within H2I relies on expected naming conventions of technologies in the technology configuration file. The following details the naming convention required for H2I to run properly. - -```yaml -technologies: - tech_name_A: #these are the keys with specific required naming convention - performance_model: - model: - cost_model: - model: - model_inputs: - performance_parameters: -``` - -- if using the `GenericCombinerPerformanceModel` as the technology performance model, the technology name must include the name `combiner`. Some examples of valid technology names are: - + 'combiner' - + 'combiner_1' - + 'electricity_combiner' - + 'hydrogen_combiner_2' -- if using the `GenericSplitterPerformanceModel` as the technology performance model, the technology name must include the name `splitter`. Some examples of valid technology names are: - + 'splitter' - + 'splitter_1' - + 'electricity_splitter' - + 'hydrogen_splitter_2' -- if using the `FeedstockPerformanceModel` as the technology performance model and the `FeedstockCostModel` as the technology cost model, the technology name must include the name `feedstock`. Some examples of valid technology names are: - + 'feedstock' - + 'water_feedstock' - + 'feedstock_iron_ore' - + 'natural_gas_feedstock_tank' -- If a transport component is defined in the technology configuration file (most likely to transport commodities that cannot be transported by 'pipe' or 'cable'), the technology name must include the name `transport`. Some examples of valid technology names are: - + 'transport' - + 'lime_transport' - + 'transport_iron_ore' - + 'reformer_catalyst_transport_tube' - -```{note} -These naming convention limitations are known and you can track them in this issue: https://github.com/NatLabRockies/H2Integrate/issues/374 -``` diff --git a/h2integrate/core/h2integrate_model.py b/h2integrate/core/h2integrate_model.py index ba1569c91..e6f14bc1b 100644 --- a/h2integrate/core/h2integrate_model.py +++ b/h2integrate/core/h2integrate_model.py @@ -1232,12 +1232,20 @@ def connect_technologies(self): f"finance_subgroup_{group_id}.capacity_factor", ) + # Model classes that do not contribute costs to the finance stackup + no_cost_models = { + "GenericSplitterPerformanceModel", + "GenericCombinerPerformanceModel", + "GasStreamCombinerPerformanceModel", + "CablePerformanceModel", + "PipePerformanceModel", + } + # Only connect technologies that are included in the finance stackup for tech_name in tech_configs.keys(): - # For now, assume splitters and combiners do not add any costs - if "splitter" in tech_name or "combiner" in tech_name: - continue - if tech_name == "cable" or tech_name == "pipe": + # Skip technologies whose models doesn't add costs + perf_model = tech_configs[tech_name].get("performance_model").get("model") + if perf_model in no_cost_models: continue self.plant.connect( @@ -1255,7 +1263,7 @@ def connect_technologies(self): f"finance_subgroup_{group_id}.cost_year_{tech_name}", ) - if is_system_finance_model and "transport" not in tech_name: + if is_system_finance_model: # connect replacement schedule to system-level finance models self.plant.connect( f"{tech_name}.replacement_schedule", From e18a6fa4a3d31a9bdc315ae9e8bb66a39efb7088 Mon Sep 17 00:00:00 2001 From: John Jasa Date: Mon, 6 Apr 2026 15:47:19 -0600 Subject: [PATCH 2/4] Added to changelog and fixed CI issue --- CHANGELOG.md | 1 + h2integrate/core/h2integrate_model.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64d15e4c5..073bd92a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - Added a storage performance baseclass model `StoragePerformanceBase` and updated the other storage performance models to inherit it [PR 624](https://github.com/NatLabRockies/H2Integrate/pull/624) - Modified the calc tilt angle function for pysam solar to support latitudes in the southern hemisphere [PR 646](https://github.com/NatLabRockies/H2Integrate/pull/646) - Added oxygen production metrics and as outputs to `ECOElectrolyzerPerformanceModel` [PR 642](https://github.com/NatLabRockies/H2Integrate/pull/642) +- Removed the last of the logic that was based on technology names rather than model classes [PR 654](https://github.com/NatLabRockies/H2Integrate/pull/654) ## 0.7.1 [March 13, 2026] diff --git a/h2integrate/core/h2integrate_model.py b/h2integrate/core/h2integrate_model.py index e6f14bc1b..3a3b057a4 100644 --- a/h2integrate/core/h2integrate_model.py +++ b/h2integrate/core/h2integrate_model.py @@ -1241,6 +1241,10 @@ def connect_technologies(self): "PipePerformanceModel", } + no_replacement_schedule_models = { + "IronTransportPerformanceComponent", + } + # Only connect technologies that are included in the finance stackup for tech_name in tech_configs.keys(): # Skip technologies whose models doesn't add costs @@ -1263,7 +1267,7 @@ def connect_technologies(self): f"finance_subgroup_{group_id}.cost_year_{tech_name}", ) - if is_system_finance_model: + if is_system_finance_model and perf_model not in no_replacement_schedule_models: # connect replacement schedule to system-level finance models self.plant.connect( f"{tech_name}.replacement_schedule", From f3f54a23a61d7cf98325532d1fcfda1a2554fac6 Mon Sep 17 00:00:00 2001 From: John Jasa Date: Tue, 7 Apr 2026 10:09:37 -0600 Subject: [PATCH 3/4] PR feedback --- h2integrate/core/h2integrate_model.py | 19 +++++-------------- h2integrate/core/inputs/tech_schema.yaml | 2 +- h2integrate/core/supported_models.py | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/h2integrate/core/h2integrate_model.py b/h2integrate/core/h2integrate_model.py index 3a3b057a4..574ce1f49 100644 --- a/h2integrate/core/h2integrate_model.py +++ b/h2integrate/core/h2integrate_model.py @@ -9,7 +9,11 @@ from h2integrate.core.utilities import create_xdsm_from_config from h2integrate.core.file_utils import get_path, find_file, load_yaml from h2integrate.finances.finances import AdjustedCapexOpexComp -from h2integrate.core.supported_models import supported_models +from h2integrate.core.supported_models import ( + no_cost_models, + supported_models, + no_replacement_schedule_models, +) from h2integrate.core.inputs.validation import load_tech_yaml, load_plant_yaml, load_driver_yaml from h2integrate.core.pose_optimization import PoseOptimization from h2integrate.postprocess.sql_to_csv import convert_sql_to_csv_summary @@ -1232,19 +1236,6 @@ def connect_technologies(self): f"finance_subgroup_{group_id}.capacity_factor", ) - # Model classes that do not contribute costs to the finance stackup - no_cost_models = { - "GenericSplitterPerformanceModel", - "GenericCombinerPerformanceModel", - "GasStreamCombinerPerformanceModel", - "CablePerformanceModel", - "PipePerformanceModel", - } - - no_replacement_schedule_models = { - "IronTransportPerformanceComponent", - } - # Only connect technologies that are included in the finance stackup for tech_name in tech_configs.keys(): # Skip technologies whose models doesn't add costs diff --git a/h2integrate/core/inputs/tech_schema.yaml b/h2integrate/core/inputs/tech_schema.yaml index b85ac3294..8e06e5544 100644 --- a/h2integrate/core/inputs/tech_schema.yaml +++ b/h2integrate/core/inputs/tech_schema.yaml @@ -52,5 +52,5 @@ properties: type: object description: Financial model details (optional) additionalProperties: true - required: [] + required: [performance_model, cost_model] required: [name, description, technologies] diff --git a/h2integrate/core/supported_models.py b/h2integrate/core/supported_models.py index d559b0e05..3fbb1ed6b 100644 --- a/h2integrate/core/supported_models.py +++ b/h2integrate/core/supported_models.py @@ -308,3 +308,25 @@ "SimpleGasConsumerCost": SimpleGasConsumerCost, "GasStreamCombinerPerformanceModel": GasStreamCombinerPerformanceModel, } + + +# This next section is to demarcate specific models that belong to certain categories that are +# relevant for processing in the model stackup. Right now, these designations are +# used in `h2integrate_model.py`. + + +# Model classes that do not contribute costs to the finance stackup because they are essentially +# internal-only models that aren't categorized as a specific technology (e.g. a generic combiner +# or splitter, or a model that is only used for performance modeling within another model and +# doesn't have an independent cost model). +no_cost_models = { + "GenericSplitterPerformanceModel", + "GenericCombinerPerformanceModel", + "GasStreamCombinerPerformanceModel", + "CablePerformanceModel", + "PipePerformanceModel", +} + +no_replacement_schedule_models = { + "IronTransportPerformanceComponent", +} From 65fada509b73bb460e30d78601da58a354dd3fd6 Mon Sep 17 00:00:00 2001 From: John Jasa Date: Tue, 7 Apr 2026 10:22:49 -0600 Subject: [PATCH 4/4] Fixed schema reqs --- h2integrate/core/inputs/tech_schema.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h2integrate/core/inputs/tech_schema.yaml b/h2integrate/core/inputs/tech_schema.yaml index 8e06e5544..a25530379 100644 --- a/h2integrate/core/inputs/tech_schema.yaml +++ b/h2integrate/core/inputs/tech_schema.yaml @@ -52,5 +52,5 @@ properties: type: object description: Financial model details (optional) additionalProperties: true - required: [performance_model, cost_model] + required: [performance_model] required: [name, description, technologies]