示例#1
0
def test_nightly_download_and_unzip():
    pth = "./temp/t999"
    pymake.getmfnightly(pth, verbose=True)
    for f in os.listdir(pth):
        fpth = os.path.join(pth, f)
        print("downloaded: {}".format(fpth))
        if not os.path.isdir(fpth):
            errmsg = "{} not executable".format(fpth)
            assert which(fpth) is not None, errmsg

    # clean up directory
    if os.path.isdir(pth):
        print("\nRemoving folder " + pth)
        shutil.rmtree(pth)
示例#2
0
def test_download_nightly_build():
    error_msg = "pymake not installed - cannot download executables"
    assert pymake is not None, error_msg

    # get the current branch
    branch = get_branch()
    print("current branch: {}".format(branch))

    # No need to replace MODFLOW 6 executables
    if branch == "master":
        print("No need to update MODFLOW 6 executables")
    # Replace MODFLOW 6 executables with the latest versions
    else:
        print("Updating MODFLOW 6 executables from the nightly-build repo")
        pymake.getmfnightly(pth=exe_pth, exes=["mf6", "libmf6"], verbose=True)

        move_exe()

    return
示例#3
0
import os
import sys
import numpy as np
import matplotlib as mpl
import flopy
import pymake

# Print python package versions
flopypth = flopy.__path__[0]
pymakepth = pymake.__path__[0]
print("python version:     {}".format(sys.version))
print("numpy version:      {}".format(np.__version__))
print("matplotlib version: {}".format(mpl.__version__))
print("flopy version:      {}".format(flopy.__version__))
print("pymake version:     {}".format(pymake.__version__))
print("")
print("flopy is installed in:  {}".format(flopypth))
print("pymake is installed in: {}".format(pymakepth))

# Update flopy from GitHub repo
flopy.mf6.utils.generate_classes(branch="develop", backup=False)

# Get executables
bin_pth = os.path.join("..", "bin")
if not os.path.isdir(bin_pth):
    os.makedirs(bin_pth)
pymake.getmfexes(pth=bin_pth, verbose=True)

# Replace MODFLOW 6 executables with the latest versions
pymake.getmfnightly(pth=bin_pth, exes=["mf6", "libmf6"], verbose=True)