Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion autotest/ci_framework.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sys
import shutil
import sys

import pymake

# command line arguments to:
Expand Down
10 changes: 3 additions & 7 deletions autotest/ci_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
Script to be used to download any required data prior to autotests
"""
import os
import sys
import shutil
import subprocess
import sys

import pymake
import flopy
from ci_framework import download_mf6_examples, get_parent_path

from ci_framework import (
get_parent_path,
create_test_dir,
download_mf6_examples,
)
import flopy

# os.environ["CI"] = "1"

Expand Down
2 changes: 1 addition & 1 deletion autotest/run_notebooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Remove the temp directory and then create a fresh one
import os
import pytest

import pytest

nbdir = os.path.join("..", "examples", "Notebooks")
dpth = nbdir
Expand Down
8 changes: 4 additions & 4 deletions autotest/run_scripts.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Remove the temp directory and then create a fresh one
import pytest
import os
import sys
import shutil
from subprocess import Popen, PIPE
import sys
from subprocess import PIPE, Popen

from ci_framework import get_parent_path, FlopyTestSetup
import pytest
from ci_framework import FlopyTestSetup, get_parent_path

parent_path = get_parent_path()
base_dir = os.path.join(parent_path, "temp")
Expand Down
4 changes: 3 additions & 1 deletion autotest/t003_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os

import pytest

import flopy
import os


def test_loadfreyberg():
Expand Down
13 changes: 5 additions & 8 deletions autotest/t004_test_utilarray.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import os
import numpy as np
import flopy
import warnings
from io import StringIO
from struct import pack
from tempfile import TemporaryFile
from textwrap import dedent
from flopy.utils.util_array import Util2d, Util3d, Transient2d, Transient3d

from ci_framework import base_test_dir, FlopyTestSetup
import numpy as np
from ci_framework import FlopyTestSetup, base_test_dir

import flopy
from flopy.utils.util_array import Transient2d, Transient3d, Util2d, Util3d

base_dir = base_test_dir(__file__, rel_path="temp", verbose=True)

Expand Down Expand Up @@ -802,9 +803,6 @@ def test_mflist():


def test_how():
import numpy as np
import flopy

model_ws = f"{base_dir}_test_how"
test_setup = FlopyTestSetup(test_dirs=model_ws)

Expand Down Expand Up @@ -835,7 +833,6 @@ def test_mflist_fromfile():
the .array attribute will load the file
"""
import pandas as pd
import flopy

model_ws = f"{base_dir}_test_mflist_fromfile"
test_setup = FlopyTestSetup(test_dirs=model_ws)
Expand Down
8 changes: 4 additions & 4 deletions autotest/t005_test.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Test instantiation of flopy classes
import os

from ci_framework import base_test_dir, FlopyTestSetup
import numpy as np
from ci_framework import FlopyTestSetup, base_test_dir

import flopy

cpth = base_test_dir(__file__, rel_path="temp", verbose=True)


def test_modflow_unstructured():
import flopy
import numpy as np

test_setup = FlopyTestSetup(test_dirs=cpth)

mf = flopy.mfusg.MfUsg(structured=False, model_ws=cpth)
Expand Down
3 changes: 2 additions & 1 deletion autotest/t006_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Test reference class
import os

import numpy as np

try:
Expand All @@ -17,7 +18,7 @@
except ImportError:
shapefile = None

from ci_framework import base_test_dir, FlopyTestSetup
from ci_framework import FlopyTestSetup, base_test_dir

cpth = base_test_dir(__file__, rel_path="temp", verbose=True)

Expand Down
24 changes: 11 additions & 13 deletions autotest/t007_test.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Test export module
import sys
import pytest

sys.path.append("..")
import glob
import os
import shutil

import numpy as np
import flopy
import pytest
from ci_framework import FlopyTestSetup, base_test_dir

from ci_framework import base_test_dir, FlopyTestSetup
import flopy

base_dir = base_test_dir(
__file__,
Expand Down Expand Up @@ -336,8 +334,7 @@ def test_write_shapefile():
return

from flopy.discretization import StructuredGrid
from flopy.export.shapefile_utils import shp2recarray
from flopy.export.shapefile_utils import write_grid_shapefile
from flopy.export.shapefile_utils import shp2recarray, write_grid_shapefile

ws_out = f"{base_dir}_shapefile_write"
test_setup = FlopyTestSetup(verbose=True, test_dirs=ws_out)
Expand Down Expand Up @@ -1166,8 +1163,8 @@ def check_vertices():


def test_mapview_plot_bc():
from matplotlib.collections import QuadMesh, PathCollection
import matplotlib.pyplot as plt
from matplotlib.collections import PathCollection, QuadMesh

sim_name = "mfsim.nam"
sim_path = os.path.join(
Expand Down Expand Up @@ -1251,8 +1248,8 @@ def test_mapview_plot_bc():


def test_crosssection_plot_bc():
from matplotlib.collections import PatchCollection
import matplotlib.pyplot as plt
from matplotlib.collections import PatchCollection

sim_name = "mfsim.nam"
sim_path = os.path.join(
Expand Down Expand Up @@ -1330,11 +1327,11 @@ def test_crosssection_plot_bc():


def test_tricontour_NaN():
from flopy.plot import PlotMapView
import numpy as np
from flopy.discretization import StructuredGrid
import matplotlib.pyplot as plt

from flopy.discretization import StructuredGrid
from flopy.plot import PlotMapView

arr = np.random.rand(10, 10) * 100
arr[-1, :] = np.nan
delc = np.array([10] * 10, dtype=float)
Expand Down Expand Up @@ -1741,6 +1738,7 @@ def test_export_contourf():
if import_shapefile() is None:
return
import matplotlib.pyplot as plt

from flopy.export.utils import export_contourf

ws_out = f"{base_dir}_shapefile_export_contourf"
Expand Down
7 changes: 4 additions & 3 deletions autotest/t008_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
These are the examples that are distributed with MODFLOW-2005.
"""

import pytest
import os
import flopy

from ci_framework import base_test_dir, FlopyTestSetup
import pytest
from ci_framework import FlopyTestSetup, base_test_dir

import flopy

pth = os.path.join("..", "examples", "data", "mf2005_test")
namfiles = [namfile for namfile in os.listdir(pth) if namfile.endswith(".nam")]
Expand Down
14 changes: 7 additions & 7 deletions autotest/t009_test.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
__author__ = "aleaf"

import sys

import os
import glob
import shutil
import io
import numpy as np
import os
import shutil

import matplotlib
import matplotlib.pyplot as plt
import numpy as np

from flopy.discretization import StructuredGrid
from flopy.utils.recarray_utils import create_empty_recarray
from flopy.utils.sfroutputfile import SfrFile

try:
import shapefile
Expand All @@ -22,8 +24,6 @@
import flopy

fm = flopy.modflow
from flopy.utils.sfroutputfile import SfrFile
from flopy.discretization import StructuredGrid

path = os.path.join("..", "examples", "data", "mf2005_test")
path2 = os.path.join("..", "examples", "data", "sfr_test")
Expand Down
3 changes: 2 additions & 1 deletion autotest/t010_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
need to add a test case that has elevation input by reach
"""

import os

import pytest

import os
import flopy
from flopy.modflow.mfsfr2 import check

Expand Down
6 changes: 4 additions & 2 deletions autotest/t011_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
Some basic tests for mflistfile.py module (not super rigorous)

"""
import pytest
import os
import flopy

import numpy as np
import pytest

import flopy


def test_mflistfile():
Expand Down
1 change: 1 addition & 0 deletions autotest/t012_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Test loading of MODFLOW and MT3D models that come with MT3D distribution
import os
import sys

import flopy

pthtest = os.path.join("..", "examples", "data", "mt3d_test")
Expand Down
1 change: 1 addition & 0 deletions autotest/t013_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os
import warnings

import flopy


Expand Down
5 changes: 3 additions & 2 deletions autotest/t014_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
Some basic tests for STR load.
"""

import os

import numpy as np
import pytest

import os
import flopy
import numpy as np

path = os.path.join("..", "examples", "data", "mf2005_test")
pthgw = os.path.join("..", "examples", "groundwater_paper", "uspb", "flopy")
Expand Down
2 changes: 1 addition & 1 deletion autotest/t015_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
except:
pymake = None

from ci_framework import base_test_dir, FlopyTestSetup
from ci_framework import FlopyTestSetup, base_test_dir

base_dir = base_test_dir(__file__, rel_path="temp", verbose=True)

Expand Down
6 changes: 4 additions & 2 deletions autotest/t016_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
import flopy

import numpy as np
from ci_framework import base_test_dir, FlopyTestSetup
from ci_framework import FlopyTestSetup, base_test_dir

import flopy

base_dir = base_test_dir(__file__, rel_path="temp", verbose=True)

Expand Down
6 changes: 4 additions & 2 deletions autotest/t017_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Test binary and formatted data readers
import pytest
import os

import numpy as np
import pytest
from ci_framework import FlopyTestSetup, base_test_dir

import flopy
from ci_framework import base_test_dir, FlopyTestSetup

base_dir = base_test_dir(__file__, rel_path="temp", verbose=True)

Expand Down
4 changes: 3 additions & 1 deletion autotest/t018_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os

import numpy as np
from ci_framework import FlopyTestSetup, base_test_dir

import flopy
from ci_framework import base_test_dir, FlopyTestSetup

base_dir = base_test_dir(__file__, rel_path="temp", verbose=True)

Expand Down
4 changes: 3 additions & 1 deletion autotest/t019_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os

import numpy as np
from ci_framework import FlopyTestSetup, base_test_dir

import flopy
from ci_framework import base_test_dir, FlopyTestSetup

base_dir = base_test_dir(__file__, rel_path="temp", verbose=True)

Expand Down
Loading