OCHRE
OCHRE copied to clipboard
PV Error
I've been trying to model a dwelling with PV and keep getting an error message.
Here is the code I've been using:
house = Dwelling(
start_time=dt.datetime(2023, 1, 1, 0, 0),
time_res=dt.timedelta(minutes=1),
duration=dt.timedelta(days=365),
hpxml_file =os.path.join(r'C:\Users\cstone\OneDrive - Advanced Energy\Desktop\Projects\Flexible_Demand\OCHRE\DR_Standards_Comparison_HP35_DR_PVBESS.xml'),
schedule_input_file=os.path.join(r'C:\Users\cstone\OneDrive - Advanced Energy\Desktop\Projects\Flexible_Demand\OCHRE\schedule.csv'),
weather_file=os.path.join(r'C:\Users\cstone\OneDrive - Advanced Energy\Desktop\Projects\Flexible_Demand\OCHRE\USA_NC_Raleigh-Durham.Intl.AP.723060_TMY3.epw'),
verbosity=9,
Equipment={
'PV': {
'capacity': 5,
'tilt': 20,
'azimuth': 180,
},
},
)
and here is the error I get:
2024-04-15 09:13:46.668712 - OCHRE at 2023-01-01 00:00:00: Initializing OCHRE (OCHRE v0.8.4)
WARNING: Skipping garage lighting, since no garage is modeled.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\cstone\AppData\Local\Programs\Python\Python311\Lib\site-packages\ochre\Dwelling.py", line 74, in __init__
schedule, location = load_schedule(properties, weather_station=weather_station, **house_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cstone\AppData\Local\Programs\Python\Python311\Lib\site-packages\ochre\utils\schedule.py", line 573, in load_schedule
df_weather, location = import_weather(**house_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cstone\AppData\Local\Programs\Python\Python311\Lib\site-packages\ochre\utils\schedule.py", line 308, in import_weather
create_sam_weather_file(df_sam, location, **kwargs)
File "C:\Users\cstone\AppData\Local\Programs\Python\Python311\Lib\site-packages\ochre\utils\schedule.py", line 126, in create_sam_weather_file
sam_weather_file = default_sam_weather_file.format(kwargs['main_sim_name'])
~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'main_sim_name'
How do I fix this error?
This is a known issue. It's been fixed in the dev branch. I'd recommend running with that branch. If you need to switch branches and already have ochre installed, I would run:
pip uninstall ochre-nrel
pip install git+https://github.com/NREL/OCHRE@dev
We'll have this fixed in the next release.
Fixed in v0.8.5