From 2169d89e6a0e2e4dae6f0e4691f84c6ce41833d9 Mon Sep 17 00:00:00 2001 From: bayc Date: Thu, 8 Aug 2024 16:34:33 -0600 Subject: [PATCH] remove yamlinclude import --- tests/greenheart/hopp_tools_test.py | 11 ++++++----- .../test_hydrogen/test_greenheart_system.py | 7 +------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/greenheart/hopp_tools_test.py b/tests/greenheart/hopp_tools_test.py index b14dacde2..3c96b5e10 100644 --- a/tests/greenheart/hopp_tools_test.py +++ b/tests/greenheart/hopp_tools_test.py @@ -7,11 +7,11 @@ import matplotlib.pyplot as plt import yaml import re -from yamlinclude import YamlIncludeConstructor -YamlIncludeConstructor.add_to_loader_class(loader_class=yaml.FullLoader, base_dir='/your/conf/dir') - +# from yamlinclude import YamlIncludeConstructor +# YamlIncludeConstructor.add_to_loader_class(loader_class=yaml.FullLoader, base_dir='/your/conf/dir') # HOPP functionss +from hopp.utilities import load_yaml from greenheart.to_organize.H2_Analysis.hopp_for_h2 import hopp_for_h2 from hopp.simulation.technologies.sites import SiteInfo from greenheart.to_organize.H2_Analysis.simple_dispatch import SimpleDispatch @@ -88,8 +88,9 @@ def set_turbine_model(turbine_model, scenario, parent_path, floris_dir): ################################ turbine_file = floris_dir + 'floris_input' + turbine_model + '_' + site_number + '.yaml' - with open(turbine_file, 'r') as f: - floris_config = yaml.load(f, yaml.FullLoader) + floris_config = load_yaml(turbine_file) + # with open(turbine_file, 'r') as f: + # floris_config = yaml.load(f, yaml.FullLoader) # floris_config = yaml.load(f, yaml.SafeLoader) nTurbs = len(floris_config['farm']['layout_x']) # turbine_type = floris_config['farm']['turbine_type'][0] diff --git a/tests/greenheart/test_hydrogen/test_greenheart_system.py b/tests/greenheart/test_hydrogen/test_greenheart_system.py index b1c136c86..4a50586bd 100644 --- a/tests/greenheart/test_hydrogen/test_greenheart_system.py +++ b/tests/greenheart/test_hydrogen/test_greenheart_system.py @@ -8,18 +8,13 @@ from hopp.utilities.keys import set_nrel_key_dot_env set_nrel_key_dot_env() -import yaml -from yamlinclude import YamlIncludeConstructor - from pathlib import Path from ORBIT.core.library import initialize_library + dirname = os.path.dirname(__file__) orbit_library_path = os.path.join(dirname, "input_files/") -YamlIncludeConstructor.add_to_loader_class(loader_class=yaml.FullLoader, base_dir=os.path.join(orbit_library_path, 'floris/')) -YamlIncludeConstructor.add_to_loader_class(loader_class=yaml.FullLoader, base_dir=os.path.join(orbit_library_path, 'turbines/')) - initialize_library(orbit_library_path) class TestSimulationWind(unittest.TestCase):