Created
February 10, 2015 23:22
-
-
Save gcasey/576af9225ae5f85e6ae1 to your computer and use it in GitHub Desktop.
set timesteps for port
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setOutputTimesteps ( algorithm , timesteps ): | |
"helper routine to set timestep information" | |
executive = algorithm . GetExecutive () | |
outInfo = executive . GetOutputInformation (0) | |
outInfo.Remove ( executive.TIME_STEPS () ) | |
for timestep in timesteps : | |
outInfo . Append ( executive . TIME_STEPS () , timestep ) | |
outInfo . Remove ( executive . TIME_RANGE () ) | |
outInfo . Append ( executive . TIME_RANGE () , timesteps [0]) | |
outInfo . Append ( executive . TIME_RANGE () , timesteps [ -1]) | |
def getInputTimesteps( algorithm, portindex): | |
"helper routine to set timestep information" | |
executive = algorithm . GetExecutive () | |
inInfo = executive . GetInputInformation (0, portindex) | |
return inInfo.Get(executive.TIME_STEPS()) | |
myrange = getInputTimesteps(self, pcport) | |
setOutputTimesteps(self, myrange) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment