Skip to content

Commit 87f6930

Browse files
committed
add validated yaml loading functions to top-level
1 parent 4c2f7b4 commit 87f6930

20 files changed

Lines changed: 47 additions & 38 deletions

File tree

docs/demand/demand_demo.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ We initialize and setup the H2I model
7474
from pathlib import Path
7575
from matplotlib import pyplot as plt
7676
77-
from h2integrate import H2IntegrateModel, EXAMPLE_DIR
78-
from h2integrate.core.inputs.validation import load_tech_yaml, load_plant_yaml, load_driver_yaml
77+
from h2integrate import H2IntegrateModel, EXAMPLE_DIR, load_tech_yaml, load_plant_yaml, load_driver_yaml
7978
8079
ex_dir = EXAMPLE_DIR / "13_dispatch_for_electrolyzer"
8180
tech_config = load_tech_yaml(ex_dir / "tech_config.yaml")

docs/misc_resources/turbine_models_library_preprocessing.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ import os
3737
3838
import numpy as np
3939
40-
from h2integrate import H2IntegrateModel, EXAMPLE_DIR, load_yaml, write_readable_yaml
41-
from h2integrate.core.inputs.validation import load_tech_yaml
40+
from h2integrate import H2IntegrateModel, EXAMPLE_DIR, load_yaml, write_readable_yaml, load_tech_yaml
4241
from h2integrate.preprocess.wind_turbine_file_tools import export_turbine_to_pysam_format
4342
```
4443

docs/user_guide/design_of_experiments_in_h2i.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,9 @@ Next, we'll import the required models and functions to complete run a successfu
154154
# Import necessary methods and packages
155155
from pathlib import Path
156156
157+
from h2integrate import H2IntegrateModel, load_driver_yaml, write_yaml
157158
from h2integrate.core.file_utils import check_file_format_for_csv_generator, load_yaml
158159
from h2integrate.core.dict_utils import update_defaults
159-
from h2integrate import H2IntegrateModel
160-
from h2integrate.core.inputs.validation import load_driver_yaml, write_yaml
161160
```
162161

163162
##### Setup and first attempt

docs/user_guide/run_size_modes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ Then, any `feedstock_sizing_function` or `feedstock_sizing_function` that the co
6363
from pathlib import Path
6464
6565
import numpy as np
66+
67+
from h2integrate import H2IntegrateModel, load_tech_yaml, load_driver_yaml, load_plant_yaml
6668
from h2integrate.core.utilities import merge_shared_inputs
6769
from h2integrate.core.model_baseclasses import ResizeablePerformanceModelBaseClass, ResizeablePerformanceModelBaseConfig
68-
from h2integrate import H2IntegrateModel
69-
from h2integrate.core.inputs.validation import load_tech_yaml, load_driver_yaml, load_plant_yaml
7070
7171
7272
# Set a root directory for file loading

examples/13_dispatch_for_electrolyzer/run_dispatch_for_electrolyzer.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
from pathlib import Path
22

3-
from h2integrate import EXAMPLE_DIR, H2IntegrateModel
4-
from h2integrate.core.inputs.validation import load_tech_yaml, load_plant_yaml, load_driver_yaml
3+
from h2integrate import (
4+
EXAMPLE_DIR,
5+
H2IntegrateModel,
6+
load_tech_yaml,
7+
load_plant_yaml,
8+
load_driver_yaml,
9+
)
510

611

712
this_dir = EXAMPLE_DIR / "13_dispatch_for_electrolyzer"

examples/25_sizing_modes/run_size_modes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import numpy as np
44

5-
from h2integrate import H2IntegrateModel
5+
from h2integrate import H2IntegrateModel, load_tech_yaml, load_plant_yaml, load_driver_yaml
66
from h2integrate.core.utilities import merge_shared_inputs
7-
from h2integrate.core.inputs.validation import load_tech_yaml, load_plant_yaml, load_driver_yaml
87
from h2integrate.core.model_baseclasses import (
98
ResizeablePerformanceModelBaseClass,
109
ResizeablePerformanceModelBaseConfig,

examples/test/test_all_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ def test_hybrid_energy_plant_example(subtests, temp_copy_of_example):
748748
"example_folder,resource_example_folder", [("13_dispatch_for_electrolyzer", None)]
749749
)
750750
def test_electrolyzer_demand(subtests, temp_copy_of_example):
751-
from h2integrate.core.inputs.validation import load_tech_yaml, load_plant_yaml, load_driver_yaml
751+
from h2integrate import load_tech_yaml, load_plant_yaml, load_driver_yaml
752752

753753
example_folder = temp_copy_of_example
754754

@@ -1654,9 +1654,9 @@ def test_csvgen_design_of_experiments(subtests, temp_copy_of_example):
16541654
model = H2IntegrateModel(example_folder / "20_solar_electrolyzer_doe.yaml")
16551655
assert "There may be issues with the csv file csv_doe_cases.csv" in str(excinfo.value)
16561656

1657+
from h2integrate import write_yaml, load_driver_yaml
16571658
from h2integrate.core.dict_utils import update_defaults
16581659
from h2integrate.core.file_utils import check_file_format_for_csv_generator
1659-
from h2integrate.core.inputs.validation import write_yaml, load_driver_yaml
16601660

16611661
# load the driver config file
16621662
driver_config = load_driver_yaml("driver_config.yaml")

h2integrate/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
# isort: off
1111
from h2integrate.core.h2integrate_model import H2IntegrateModel
1212
from h2integrate.core.file_utils import load_yaml, write_readable_yaml, write_yaml
13+
from h2integrate.core.inputs.validation import load_driver_yaml, load_plant_yaml, load_tech_yaml

h2integrate/converters/ammonia/test/test_ammonia_synloop_model.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55
import openmdao.api as om
66
from pytest import fixture
77

8-
from h2integrate import EXAMPLE_DIR, H2IntegrateModel
9-
from h2integrate.core.inputs.validation import load_tech_yaml, load_plant_yaml, load_driver_yaml
8+
from h2integrate import (
9+
EXAMPLE_DIR,
10+
H2IntegrateModel,
11+
load_tech_yaml,
12+
load_plant_yaml,
13+
load_driver_yaml,
14+
)
1015
from h2integrate.converters.ammonia.ammonia_synloop import AmmoniaSynLoopPerformanceModel
1116

1217

h2integrate/converters/hopp/test/test_hopp_caching.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import openmdao.api as om
77
from pytest import fixture
88

9-
from h2integrate import EXAMPLE_DIR
10-
from h2integrate.core.inputs.validation import load_tech_yaml, load_plant_yaml
9+
from h2integrate import EXAMPLE_DIR, load_tech_yaml, load_plant_yaml
1110
from h2integrate.converters.hopp.hopp_wrapper import HOPPComponent
1211

1312

0 commit comments

Comments
 (0)