@staticmethod
    def load(f, model, ext_unit_dict=None):

        if model.verbose:
            sys.stdout.write('loading pval package file...\n')

        if not hasattr(f, 'read'):
            filename = f
            f = open(filename, 'r')
        else:
            filename = f.name

        #dataset 0 -- header
        while True:
            line = f.readline()
            if line[0] != '#':
                break
        #dataset 1
        t = line.strip().split()
        npval = int(t[0])

        if model.verbose:
            sys.stdout.write('   reading parameter values from "{:<10s}"\n'.format(filename))

        #read PVAL data
        pval_dict = dict()
        for n in range(npval):
            line = f.readline()
            t = line.strip().split()
            if len(t[0]) > 10:
                pvalnam = t[0][0:10].lower()
            else:
                pvalnam = t[0].lower()

            pval_dict[pvalnam] = float(t[1])

        pval = ModflowPval(model, pval_dict=pval_dict)
        return pval
Load an existing package.
dataset/ETHPy150Open modflowpy/flopy/flopy/modflow/mfpval.py/ModflowPval.load