Skip to content

Commit

Permalink
fix: use postponed evaluation
Browse files Browse the repository at this point in the history
* 6899ae1 switched list[... to List[... for compat with python 3.8
* instead opt into postponed evaluation per suggestion
* drop CI tests from python 3.9 to 3.8
  • Loading branch information
wpbonelli committed Sep 12, 2023
1 parent 6899ae1 commit f36d8b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ex-rtd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.8

- name: Install Python packages
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ex-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.8

- name: Print python version
run: |
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.8

- name: Install Python packages
run: |
Expand Down
2 changes: 2 additions & 0 deletions common/DisvGridMerger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from math import sqrt
import copy

Expand Down
11 changes: 6 additions & 5 deletions common/DisvPropertyContainer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import copy
from itertools import cycle
from typing import List

import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -104,10 +105,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 Expand Up @@ -541,7 +542,7 @@ def plot_grid(
plot_time = -1.0

if not isinstance(grid_color, tuple):
grid_color = (grid_color, )
grid_color = (grid_color,)

ColorCycler = grid_color
if plot_time > 0.0 and grid_color == ("grey",):
Expand Down

0 comments on commit f36d8b6

Please sign in to comment.