Exemple #1
0
def pst_from_io_files(tpl_files,in_files,ins_files,out_files,pst_filename=None):
    """ generate a new pyemu.Pst instance from model interface files.  This
    function is emulated in the Pst.from_io_files() class method.

    Parameters
    ----------
    tpl_files : (list)
        template file names
    in_files : (list)
        model input file names
    ins_files : (list)
        instruction file names
    out_files : (list)
        model output file names
    pst_filename : str
        filename to save new pyemu.Pst.  If None, Pst is not written.
        default is None

    Returns
    -------
    new_pst : pyemu.Pst

    """

    warnings.warn("pst_from_io_files has moved to pyemu.helpers and is also "+\
                  "now avaiable as a Pst class method (Pst.from_io_files())",PyemuWarning)
    from pyemu import helpers
    return helpers.pst_from_io_files(tpl_files=tpl_files,in_files=in_files,
                              ins_files=ins_files,out_files=out_files,
                              pst_filename=pst_filename)
Exemple #2
0
def pst_from_io_files(tpl_files,in_files,ins_files,out_files,pst_filename=None):
    """ generate a new pyemu.Pst instance from model interface files.  This
    function is emulated in the Pst.from_io_files() class method.

    Parameters
    ----------
    tpl_files : (list)
        template file names
    in_files : (list)
        model input file names
    ins_files : (list)
        instruction file names
    out_files : (list)
        model output file names
    pst_filename : str
        filename to save new pyemu.Pst.  If None, Pst is not written.
        default is None

    Returns
    -------
    new_pst : pyemu.Pst

    """
    import warnings
    warnings.warn("pst_from_io_files has moved to pyemu.helpers and is also "+\
                  "now avaiable as a Pst class method (Pst.from_io_files())")
    from pyemu import helpers
    return helpers.pst_from_io_files(tpl_files=tpl_files,in_files=in_files,
                              ins_files=ins_files,out_files=out_files,
                              pst_filename=pst_filename)
Exemple #3
0
 def from_io_files(cls,
                   tpl_files,
                   in_files,
                   ins_files,
                   out_files,
                   pst_filename=None):
     from pyemu import helpers
     return helpers.pst_from_io_files(tpl_files=tpl_files,
                                      in_files=in_files,
                                      ins_files=ins_files,
                                      out_files=out_files,
                                      pst_filename=pst_filename)
Exemple #4
0
def tpl_ins_test():
    import os
    from pyemu import Pst, pst_utils, helpers
    # creation functionality
    dir = os.path.join("..", "verification", "henry", "misc")
    files = os.listdir(dir)
    tpl_files, ins_files = [], []
    for f in files:
        if f.lower().endswith(".tpl") and "coarse" not in f:
            tpl_files.append(os.path.join(dir, f))
        if f.lower().endswith(".ins"):
            ins_files.append(os.path.join(dir, f))

    out_files = [f.replace(".ins", ".junk") for f in ins_files]
    in_files = [f.replace(".tpl", ".junk") for f in tpl_files]

    helpers.pst_from_io_files(tpl_files,
                              in_files,
                              ins_files,
                              out_files,
                              pst_filename=os.path.join("temp", "test.pst"))
    return
Exemple #5
0
def pst_from_io_files(tpl_files,
                      in_files,
                      ins_files,
                      out_files,
                      pst_filename=None):
    import warnings
    warnings.warn("pst_from_io_files has moved to pyemu.helpers and is also "+\
                  "now avaiable as a Pst class method (Pst.from_io_files())")
    from pyemu import helpers
    return helpers.pst_from_io_files(tpl_files=tpl_files,
                                     in_files=in_files,
                                     ins_files=ins_files,
                                     out_files=out_files,
                                     pst_filename=pst_filename)