Skip to content

Commit

Permalink
fix: support Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Sep 11, 2023
1 parent 092edef commit e871ce2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions common/DisvPropertyContainer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import copy
from itertools import cycle
from typing import List

import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -103,10 +104,10 @@ class DisvPropertyContainer:
nlay: int
ncpl: int
nvert: int
vertices: list[list] # [[iv, xv, yv], ...]
cell2d: list[list] # [[ic, xc, yc, ncvert, icvert], ...]
vertices: List[list] # [[iv, xv, yv], ...]
cell2d: List[list] # [[ic, xc, yc, ncvert, icvert], ...]
top: np.ndarray
botm: list[np.ndarray]
botm: List[np.ndarray]
origin_x: float
origin_y: float
rotation: float
Expand Down
10 changes: 6 additions & 4 deletions etc/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
from pathlib import Path


def pytest_addoption(parser):
Expand All @@ -8,9 +8,11 @@ def pytest_addoption(parser):
def pytest_generate_tests(metafunc):
if "build" in metafunc.fixturenames:
run = metafunc.config.getoption("run")
path = Path.cwd().parent / "scripts"
files = sorted(list(path.glob("ex-*.py")))
scripts_dict = {
file_name: (run, file_name)
for file_name in sorted(os.listdir(os.path.join("..", "scripts")))
if file_name.endswith(".py") and file_name.startswith("ex-")
file: (run, file)
for file in files
if file.name.endswith(".py") and file.name.startswith("ex-")
}
metafunc.parametrize("build", scripts_dict.values(), ids=scripts_dict.keys())

0 comments on commit e871ce2

Please sign in to comment.