"""This script writes a control file with empty values. 
This script must be located in the same directory 
as HeatSource_control.csv. NOTE that executing this script
from Python shell (IDLE) will not identify __file__ correctly and will
result in an error. It must be executed from a command prompt. Your
options are to try to double click on this file and execute it 
using python.exe, or to open a command prompt and execute manually 
by typing: python -i path/to/this/script/HS9_Setup_Control_File.py"""

from heatsource9.ModelSetup.Inputs import Inputs
from os.path import abspath
from os.path import dirname
from os.path import join
from os.path import realpath

def getScriptPath():
    """Gets the path to the directory where the script is being executed from."""
    return abspath(join(dirname(realpath(__file__)), '.'))

model_dir = getScriptPath() + '/'
control_file = 'HeatSource_Control.csv'

# create an input object
inputs = Inputs(model_dir, control_file)

# Write a blank control file
inputs.parameterize_cf(overwrite=False)


Ejemplo n.º 2
0
from heatsource9.ModelSetup.Inputs import Inputs
from os.path import abspath
from os.path import dirname
from os.path import exists
from os.path import join
from os.path import realpath

def getScriptPath():
    """Gets the path to the directory where the script is being executed from."""
    return abspath(join(dirname(realpath(__file__)), '.'))

model_dir = getScriptPath() + '/'
control_file = 'HeatSource_Control.csv'

if not exists(join(model_dir,control_file)):
    raise Exception("HeatSource_Control.csv not found. \
    Move the executable or place the control file in \
    this directory: {0}.".format(model_dir))


inputs = Inputs(model_dir, control_file)

# Control file must already be parameterized
inputs.import_control_file()

# Write blank input files,
inputs.setup(use_timestamp=True, overwrite=False)


    """Gets the path to the directory where this script is
    being executed from."""
    return abspath(join(dirname(realpath(__file__)), '.'))


model_dir = getScriptPath() + '/'
control_file = 'HeatSource_Control.csv'
nodes_fc = model_dir + r"example_model.gdb\nodes"

if not exists(join(model_dir, control_file)):
    raise Exception("HeatSource_Control.csv not found. \
    Move the executable or place the control file in \
    this directory: {0}.".format(model_dir))

# create an input object
inputs = Inputs(model_dir, control_file)

# Setup control file and parameterize it
inputs.parameterize_cf(
    overwrite=False,
    usertxt="This model is an example model",
    name="example model",
    inputdir=model_dir + r"inputs/",
    outputdir=model_dir + r"outputs/",
    length=1.8,
    outputkm="all",
    datastart="05/06/2003",
    modelstart="07/01/2003",
    modelend="07/14/2003",
    dataend="09/21/2003",
    flushdays=1,
Ejemplo n.º 4
0
def getScriptPath():
    """Gets the path to the directory where this script is
    being executed from."""
    return abspath(join(dirname(realpath(__file__)), '.'))

model_dir = getScriptPath() + '/'
control_file = 'HeatSource_Control.csv'
nodes_fc = model_dir + r"example_model.gdb\nodes"

if not exists(join(model_dir,control_file)):
    raise Exception("HeatSource_Control.csv not found. \
    Move the executable or place the control file in \
    this directory: {0}.".format(model_dir))

# create an input object
inputs = Inputs(model_dir, control_file)

# Setup control file and parameterize it
inputs.parameterize_cf(overwrite=False,
                       usertxt = "This model is an example model",
                       name = "example model", 
                       inputdir = model_dir + r"inputs/", 
                       outputdir = model_dir + r"outputs/", 
                       length = 1.8, 
                       outputkm = "all", 
                       datastart = "05/06/2003", 
                       modelstart = "07/01/2003", 
                       modelend = "07/14/2003", 
                       dataend = "09/21/2003", 
                       flushdays = 1, 
                       offset = -7, 
from heatsource9.ModelSetup.Inputs import Inputs
from os.path import abspath
from os.path import dirname
from os.path import exists
from os.path import join
from os.path import realpath

def getScriptPath():
    """Gets the path to the directory where the script is being executed from."""
    return abspath(join(dirname(realpath(__file__)), '.'))

model_dir = getScriptPath() + '/'
control_file = 'HeatSource_Control.csv'

if not exists(join(model_dir,control_file)):
    raise Exception("HeatSource_Control.csv not found. \
    Move the executable or place the control file in \
    this directory: {0}.".format(model_dir))


inputs = Inputs(model_dir, control_file)

# Control file must already be parameterized
inputs.import_control_file()

# Write blank input files,
inputs.setup(use_timestamp=True, overwrite=False)


Ejemplo n.º 6
0
"""DO NOT DELETE THIS FILE. This script imports the heatsource module
and executes the model routines. This script must be located in the same
directory as HeatSource_control.csv. NOTE that executing this script
from Python shell (IDLE) will not identify __file__ correctly and will
result in an error. It must be executed from a command prompt. Your
options are to double click on this file and execute using python.exe,
use the batch command files (which point to these files), or
open terminal and execture manually by typing:
python -i path/to/this/script/HS9_Setup_Control_File.py"""

from heatsource9.ModelSetup.Inputs import Inputs
from os.path import abspath
from os.path import dirname
from os.path import join
from os.path import realpath

def getScriptPath():
    """Gets the path to the directory where the script is being executed from."""
    return abspath(join(dirname(realpath(__file__)), '.'))

model_dir = getScriptPath() + '/'
control_file = 'HeatSource_Control.csv'

# create an input object
inputs = Inputs(model_dir, control_file)

# Write a blank control file
inputs.parameterize_cf(overwrite=False)


Ejemplo n.º 7
0
def getScriptPath():
    """Gets the path to the directory where this script is
    being executed from."""
    return abspath(join(dirname(realpath(__file__)), '.'))

model_dir = getScriptPath() + '/'
control_file = 'HeatSource_Control.csv'
nodes_fc = model_dir + r"example_model.gdb\nodes"

if not exists(join(model_dir,control_file)):
    raise Exception("HeatSource_Control.csv not found. \
    Move the executable or place the control file in \
    this directory: {0}.".format(model_dir))

# create an input object
inputs = Inputs(model_dir, control_file)

# Setup control file and paramaterize it
inputs.parameterize_cf(overwrite=False,
                       usertxt = "This model is an example model",
                       name = "example model", 
                       inputdir = model_dir + r"inputs/", 
                       outputdir = model_dir + r"outputs/", 
                       length = 1.8, 
                       outputkm = "all", 
                       datastart = "05/06/2003", 
                       modelstart = "07/01/2003", 
                       modelend = "07/14/2003", 
                       dataend = "09/21/2003", 
                       flushdays = 1, 
                       offset = -7,