Skip to content

Commit 0214dda

Browse files
committed
format, lint, cleanup
1 parent f24fb28 commit 0214dda

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

docs/examples/quickstart.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,5 @@
5555
ax.grid(which="both", color="white")
5656
head.plot.imshow(ax=ax)
5757
head.plot.contour(ax=ax, levels=[0.2, 0.4, 0.6, 0.8], linewidths=3.0)
58-
budget.plot.quiver(
59-
x="x", y="y", u="npf-qx", v="npf-qy", ax=ax, color="white"
60-
)
58+
budget.plot.quiver(x="x", y="y", u="npf-qx", v="npf-qy", ax=ax, color="white")
6159
fig.savefig(ws / "quickstart.png")

flopy4/mf6/gwf/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ def convert_grid(value):
2424
return Dis.from_grid(value)
2525
if isinstance(value, Dis):
2626
return value
27-
raise TypeError(
28-
f"Expected Grid or Dis, got {type(value)}"
29-
)
27+
raise TypeError(f"Expected Grid or Dis, got {type(value)}")
3028

3129

3230
@xattree
@@ -58,7 +56,6 @@ def budget(self):
5856
output: Output = attrs.field(
5957
default=attrs.Factory(lambda self: Gwf.Output(self), takes_self=True)
6058
)
61-
grid: Grid = attrs.field(default=None)
6259

6360
@define
6461
class NewtonOptions:

flopy4/mf6/simulation.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pathlib import Path
22

3-
import attrs
3+
from flopy.discretization.modeltime import ModelTime
44
from xattree import field, xattree
55

66
from flopy4.mf6.component import Component
@@ -9,17 +9,14 @@
99
from flopy4.mf6.solution import Solution
1010
from flopy4.mf6.tdis import Tdis
1111

12-
from flopy.discretization.modeltime import ModelTime
13-
1412

1513
def convert_time(value):
1614
if isinstance(value, ModelTime):
1715
return Tdis.from_time(value)
1816
if isinstance(value, Tdis):
1917
return value
20-
raise TypeError(
21-
f"Expected ModelTime or Tdis, got {type(value)}"
22-
)
18+
raise TypeError(f"Expected ModelTime or Tdis, got {type(value)}")
19+
2320

2421
@xattree
2522
class Simulation(Component):
@@ -28,3 +25,7 @@ class Simulation(Component):
2825
solutions: dict[str, Solution] = field()
2926
sim_ws: Path = field(default=None)
3027
tdis: Tdis = field(converter=convert_time)
28+
29+
@property
30+
def time(self) -> ModelTime:
31+
return self.tdis.to_time()

0 commit comments

Comments
 (0)