arras-energy / gridlabd

Arras Energy simulator
https://www.arras.energy/
BSD 3-Clause "New" or "Revised" License
6 stars 5 forks source link

Python block conflicts with weather #40

Open aivanova5 opened 2 years ago

aivanova5 commented 2 years ago

Problem description

Only relevant on docker deployment.

If using python block, the climate object can not be read if placed after the python block as follows:

#begin python
import sys
import datetime as dt
wayback = dict(hours=-1)
import pytz
starttime = (dt.datetime.now(pytz.timezone('US/Eastern'))+dt.timedelta(**wayback)).strftime('%Y-%m-%d %H:00:00')
#end

dule climate;
 #weather get NH-Concord_Municipal_Arpt.tmy3
 object climate
 {
     tmyfile "NH-Concord_Municipal_Arpt.tmy3";
     city "Concord NH";
     interpolate "LINEAR";
     on_commit "python:main.weather_commit";
 }

Error:

docker run -it -v $PWD:/tmp --name testsim1 slacgismo/gridlabd:develop gridlabd config.glm realtime.glm
Downloading NH-Concord_Municipal_Arpt.tmy3... done
ERROR    [INIT] : climate:0: weather file 'NH-Concord_Municipal_Arpt.tmy3' access failed
ERROR    [INIT] : init_by_deferral(): object climate:0 initialization failed
ERROR    [INIT] : model initialization failed
FATAL    [INIT] : shutdown after simulation stopped prematurely
FATAL    [INIT] : environment startup failed: No such file or directory

Expected behavior

No error regardless of where the climate object is placed.

System information

dchassin commented 1 year ago

@aivanova5, is this still a problem in develop?