NREL / PyDSS

Other
33 stars 19 forks source link

Error raised when there are no load shapes in the model #99

Open AadilLatif opened 2 years ago

AadilLatif commented 2 years ago

SInterval for all LoadShapes must be the same: []

AadilLatif commented 2 years ago

@daniel-thom NMSU is playing around with pydss and ran into this issue.

I implemented a tiny workaround to get the simulation going. QSTS with no profile does not make sense but we can be using the external profile manager so a little confused on what the path forward should be

if len(set(res)): if len(set(res)) != 1: raise InvalidConfiguration( f"SInterval for all LoadShapes must be the same: {res}" ) return res[0] else: return 1

daniel-thom commented 2 years ago

@AadilLatif Your fix would work. This function is only getting called in order to handle the load shape offset issue. A few months ago I added a simulation settings option to disable that behavior by default. Refer to https://github.com/NREL/PyDSS/pull/84/commits/14fd94714eb4de128eca40fc6c5eece9acdb6efd in the merge-gemini branch and settings.project.use_loadshape_offset_workaround. It makes the user opt in to working around this problem. That would avoid this problem altogether.

Perhaps we should merge whatever we need from that branch into master? My team has been impacted by that offset issue. We can always be sure to opt in to the workaround.