Skip to content

Commit

Permalink
remove yamlinclude import
Browse files Browse the repository at this point in the history
  • Loading branch information
bayc committed Aug 8, 2024
1 parent 1746643 commit 2169d89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
11 changes: 6 additions & 5 deletions tests/greenheart/hopp_tools_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
7 changes: 1 addition & 6 deletions tests/greenheart/test_hydrogen/test_greenheart_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2169d89

Please sign in to comment.