Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev/refactor' into dev/refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredthomas68 committed Aug 29, 2024
2 parents 084d961 + 2169d89 commit c94c1b6
Show file tree
Hide file tree
Showing 35 changed files with 67 additions and 8,828 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ log/
# needed for h2 test inputs: tests/analysis/results/
*_disp.txt

# Results
resource_files/wind
resource_files/solar
resource_files/grid
# Resource files (force add ones that are really needed in the repository)
hopp/simulation/resource_files/wind
hopp/simulation/resource_files/solar
hopp/simulation/resource_files/grid

.idea/*
.idea/workspace.xml
Expand Down
12 changes: 6 additions & 6 deletions alt_dev/run_alt.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def init_simulation_pv():

# Load in weather and price data files
solar_file = Path(
__file__).parent.parent / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"
__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"

# Combine the data into a site definition
site_info = SiteInfo(site_data, solar_resource_file=solar_file, grid_resource_file=grid_file)
Expand Down Expand Up @@ -151,8 +151,8 @@ def init_simulation_csp():

# Load in weather and price data files
solar_file = Path(
__file__).parent.parent / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"
__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"

# Combine the data into a site definition
site_info = SiteInfo(site_data, solar_resource_file=solar_file, grid_resource_file=grid_file)
Expand Down Expand Up @@ -228,8 +228,8 @@ def init_simulation_hybrid():

# Load in weather and price data files
solar_file = Path(
__file__).parent.parent / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"
__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"

# Combine the data into a site definition
site_info = SiteInfo(site_data, solar_resource_file=solar_file, grid_resource_file=grid_file)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion hopp/simulation/technologies/layout/flicker_mismatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _setup_irradiance(self):
pv_model.SystemDesign.gcr = .1
if self.solar_resource_data is None:
filename = str(self.lat) + "_" + str(self.lon) + "_psmv3_60_2012.csv"
weather_path = ROOT_DIR.parent / "resource_files" / "solar" / filename
weather_path = ROOT_DIR / "simulation" / "resource_files" / "solar" / filename
if not weather_path.is_file():
SolarResource(self.lat, self.lon, year=2012)
if not weather_path.is_file():
Expand Down
2 changes: 1 addition & 1 deletion hopp/simulation/technologies/resource/elec_prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, lat, lon, year, path_resource="", filepath=""):
self.path_resource = os.path.join(self.path_resource, 'grid')

if filepath == "":
home_dir = Path(__file__).parent.parent.parent.parent.parent.absolute()
home_dir = Path(__file__).parent.parent.parent.absolute()
filepath = os.path.join(
str(home_dir),
"resource_files",
Expand Down
2 changes: 1 addition & 1 deletion hopp/simulation/technologies/resource/solar_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(
lat: float,
lon: float,
year: int,
path_resource: Union[str, Path] = ROOT_DIR.parent / "resource_files",
path_resource: Union[str, Path] = ROOT_DIR / "simulation" / "resource_files",
filepath: Union[str, Path] ="",
use_api: bool = False,
**kwargs
Expand Down
2 changes: 1 addition & 1 deletion hopp/simulation/technologies/resource/wind_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(
lon: float,
year: int,
wind_turbine_hub_ht: float,
path_resource: Union[str, Path] = ROOT_DIR.parent / "resource_files",
path_resource: Union[str, Path] = ROOT_DIR / "simulation" / "resource_files",
filepath: Union[str, Path] ="",
source: str ="WTK",
use_api: bool = False,
Expand Down
5 changes: 2 additions & 3 deletions hopp/type_dec.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
import os.path

from hopp.utilities.log import hybrid_logger as logger

from hopp import ROOT_DIR
### Define general data types used throughout

hopp_path = Path(__file__).parent.parent
hopp_float_type = np.float64
hopp_int_type = np.int_

Expand Down Expand Up @@ -73,7 +72,7 @@ def resource_file_converter(resource_file: str) -> Union[Path, str]:
return ""

# Check the path relative to the hopp directory for the resource file and return if it exists
resource_file_path = str(hopp_path / resource_file)
resource_file_path = str(ROOT_DIR / "simulation" / resource_file)
resolved_path = convert_to_path(resource_file_path)
file_exists = os.path.isfile(resolved_path)
if file_exists:
Expand Down
4 changes: 2 additions & 2 deletions hopp/utilities/utils_for_tests.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from hopp import ROOT_DIR
from hopp.simulation.technologies.sites import SiteInfo, flatirons_site

DEFAULT_SOLAR_RESOURCE_FILE = ROOT_DIR.parent / "resource_files" / "solar" / "35.2018863_-101.945027_psmv3_60_2012.csv"
DEFAULT_WIND_RESOURCE_FILE = ROOT_DIR.parent / "resource_files" / "wind" / "35.2018863_-101.945027_windtoolkit_2012_60min_80m_100m.srw"
DEFAULT_SOLAR_RESOURCE_FILE = ROOT_DIR / "simulation" / "resource_files" / "solar" / "35.2018863_-101.945027_psmv3_60_2012.csv"
DEFAULT_WIND_RESOURCE_FILE = ROOT_DIR / "simulation" / "resource_files" / "wind" / "35.2018863_-101.945027_windtoolkit_2012_60min_80m_100m.srw"

def create_default_site_info(**kwargs):
return SiteInfo(
Expand Down
Loading

0 comments on commit c94c1b6

Please sign in to comment.